Candid photograph of a Linux server terminal with a soft olive-green glow against a dark slate background, conveying a calm technical atmosphere.

Step-by-step guides for system administrators — covering command-line basics, web server setup, and preparation material for technical interviews.

Browse Tutorials

Install Elasticsearch on RHEL for a secure deployment

Elasticsearch is a distributed search and analytics engine suited to RHEL. A dependable service needs deliberate configuration for clustering, memory, TLS, storage and firewall access, not just an installed RPM.

This guide covers a fresh RHEL 8 or 9 installation, from repository setup through security and routine checks. The examples use Elastic’s 9.x repository; replace that branch with a supported release when required by your policy.

Single-node settings are shown for clarity, but production clusters need discovery, replicated data and tested recovery. The same commands work for either model once those architectural differences are accounted for.

Prepare the RHEL host

Begin with a patched RHEL 8 or 9 host, administrative sudo access and a non-root account for Elasticsearch. Check the release, memory and free space before installing anything.

cat /etc/redhat-release
free -h
df -h
systemctl is-active firewalld

Give the service a dedicated data filesystem and keep it separate from logs. If you mount it elsewhere than /var/lib/elasticsearch, set ownership and SELinux labels with semanage fcontext and restorecon; otherwise the JVM may fail to read its data directory.

Australian cloud teams often choose AWS’s Sydney (ap-southeast-2) or Melbourne (ap-southeast-4) region. Keep primary replicas and snapshots in the chosen jurisdiction. For a physical appliance imported into Australia, also budget for GST and any applicable customs duty.

Install the Elastic packages

Import Elastic’s signing key, add the official YUM repository and install the package. Keeping the repository definition under /etc/yum.repos.d makes later maintenance predictable.

sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
sudo tee /etc/yum.repos.d/elasticsearch.repo >/dev/null <<'EOF'
[elasticsearch]
name=Elasticsearch repository for 9.x
baseurl=https://artifacts.elastic.co/packages/9.x/yum
enabled=1
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
EOF
sudo dnf install -y elasticsearch

Start the service before making configuration changes so the packaged first-run process can create its certificate authority, TLS keys and built-in elastic password. Save the password from the journal; it cannot be recovered in plain text later.

sudo systemctl daemon-reload
sudo systemctl enable --now elasticsearch
sudo journalctl -u elasticsearch -b --no-pager

Check the process and query the local HTTPS endpoint. Treat the generated credentials as secrets, and restrict the elastic account to break-glass use.

curl --cacert /usr/share/elasticsearch/config/certs/http_ca.crt \
  -u elastic https://localhost:9200

Elasticsearch is server software, not an handset database. A mobile companion can cache selected records with an Android Room database tutorial, while the cluster remains the source for shared search.

Configure the node and resources

Edit /etc/elasticsearch/elasticsearch.yml and preserve the generated security settings. A minimal starting point is:

cluster.name: anz-search
node.name: rhel-node-01
network.host: 0.0.0.0
http.port: 9200
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch

For a single learning node, discovery.type may be single-node. A real cluster should remove it, configure discovery.seed_hosts and cluster.initial_master_nodes, then let production cluster formation replace the bootstrap list. Keep HTTP and transport TLS enabled and use named roles instead of sharing the elastic password.

Set equal JVM heap limits in /etc/elasticsearch/jvm.options.d/heap.options. For an 8 GB dedicated host, 2 GB is conservative; never exceed half of the available RAM.

-Xms2g
-Xmx2g

On a dedicated host, add bootstrap.memory_lock: true to elasticsearch.yml, raise the service’s memory limit and use low swap preference.

sudo systemctl edit elasticsearch
[Service]
LimitMEMLOCK=infinity

Secure HTTP access

Treat port 9200 as a private service port. If firewalld is active, allow it only from management or application subnets, then reload it. Do not publish Elasticsearch directly to the internet.

sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.0.2.0/24" port port="9200" protocol="tcp" accept'
sudo firewall-cmd --reload

Replace the example network with your own approved range. If clients connect directly, ensure the generated certificate contains the hostname or IP address they validate.

For a public application endpoint, terminate TLS and enforce authentication at a controlled reverse proxy. This Nginx reverse proxy guide shows the RHEL-specific Nginx layout, including certificate paths and upstream settings.

Australian organisations should align retention and access controls with the Privacy Act and the Notifiable Data Breaches scheme. When comparing managed search products available through Australian cloud regions with a self-managed RHEL cluster, include data residency, support hours and network egress charges in the decision.

Validate health and operational readiness

After every restart, confirm process health, cluster health and an actual search. A green systemd status does not prove that indexing or querying works, and the Linuxtpoint reference library provides related RHEL administration guidance.

Run these checks before declaring the node ready:

Then confirm the operational controls:

Repeat these checks from every network location that will use the service, including an Australian office or cloud private network. External accessibility without authentication or TLS should be treated as a failed validation.

Maintain the cluster

Pin the Elasticsearch major and minor version in your change record. Before running dnf upgrade elasticsearch, take a snapshot, confirm cluster health, read the release notes and test the new package in staging. Do not allow unattended upgrades to change a production cluster without a rollback plan.

Monitor disk headroom, JVM pressure, indexing throughput, query latency and rejected requests. Rotate TLS certificates before expiry, review API-key scope and expand replicas before storage pressure affects shard allocation. Keep protected copies of elasticsearch.yml and the keystore in the backup set.

The practical takeaway is to treat Elasticsearch as a secured and monitored service: pin releases, restrict access, replicate data and prove that every backup can be restored.