Apache Solr 10.1 on Ubuntu 26.04
von Carles Mateo
Technical books
DevOps
Symfony
Ubuntu
Ibexa
Solr
Symfony
Ubuntu
Ubuntu 26.04
Search is the part of an application that users notice first. They type three letters and expect suggestions; they type a misspelled brand and expect "Did you mean…?"; they click "Brand: Aurex" and "Under 500 €" and expect the list to change instantly, with the counters of every other filter updated. A relational database is excellent at storing products, orders and users, but it was not designed to answer that kind of question fast and well. A search engine was.
This book is a practical guide to Apache Solr 10.1 on Ubuntu 26.04 LTS. You will install Solr as a single standalone server, then build a three-node SolrCloud cluster with ZooKeeper, secure it, put a load balancer in front of it, back it up, upgrade it, monitor it and load-test it. Then you will connect two real applications to Solr: an electronics store written with Symfony 7.4 on PHP 8.5, running on two web nodes with MySQL 8.4, and a content management system, Ibexa DXP 5.0, using the SolrCloud cluster as its search engine.
Everything in the book was executed. Every command, every configuration file and every screenshot comes from a lab of Ubuntu 26.04 servers built while writing it. When something did not work the first time (and several things did not), the book tells you what happened and how it was fixed.
- Who this book is for and what you need before you start.
- What you are going to build, server by server.
- How the book is organized and which conventions it uses.
- The exact software versions the book was tested with.
- How the example code is organized and how to use it.
- How to reproduce the whole lab on your own computer with Docker.
This book is for system administrators who have to install and operate Solr, for developers who have to integrate Solr into a PHP application, and for technical leads who have to decide how to deploy search in production and want to understand the trade-offs.
You do not need previous experience with Solr, Lucene, ZooKeeper or search engines in general. Chapter 1 explains the concepts from the beginning, and every new idea is introduced before it is used. You do need:
- Basic Linux command-line skills: moving between directories, editing files with an editor such as
nanoorvim, reading command output and usingsudo. - Some familiarity with
systemd(systemctl start,status,journalctl). The book explains every unit file it creates. - Basic networking: IP addresses, ports, what a firewall does.
- For chapters 11, 12 and 13, some PHP. You do not need to be a Symfony or Ibexa expert: the code is short and every class is explained.
You need one or more Ubuntu 26.04 servers (virtual machines, cloud instances or physical machines), or simply a computer with Docker: the whole lab can run in containers (see Appendix A).
- solr-standalone is a single Solr 10.1 server in user-managed (standalone) mode. You install it in chapter 3, create the
productscore in chapter 4 and use it to learn search features in chapter 5. The Ohm Store uses it in chapters 11 and 12. - The Ohm Store is the electronics store of the book: a load balancer (
web-lb, HAProxy), two web servers (web1andweb2, nginx and PHP 8.5-FPM running Symfony 7.4) and a database server (db1, MySQL 8.4 LTS). The products live in MySQL; Solr holds a searchable copy. - The SolrCloud cluster (centre) is three servers,
solr1,solr2andsolr3. Each one runs a member of the ZooKeeper ensemble and a Solr node. In front of them,solr-lb(HAProxy) gives clients a single HTTPS address. You build it in chapter 6 and make it production-ready in chapters 7 to 10. - Ibexa DXP 5.0 runs on
ibexa1and uses the cluster as its search engine throughsolr-lb(chapter 13). - monitor1 runs Prometheus, Grafana and the k6 load-testing tool (chapter 10).
- Source code and Docker Containers lab creation scripts (184.3 KB)