Step-by-Step Guide to Installing Elasticsearch 7.x (Single‑Node) and Elasticsearch‑head
This article provides a comprehensive tutorial for installing Elasticsearch 7.x in single‑node mode, configuring its key settings, deploying the Elasticsearch‑head web UI via Tomcat, and includes reference configuration files for Elasticsearch 6.x, complete with command‑line examples and code snippets.
Elasticsearch is a widely used search engine; the first step is to install and deploy it. This guide covers three parts: installing Elasticsearch 7.x (single node), installing the Elasticsearch‑head UI, and providing an online configuration example for Elasticsearch 6.x.
1. Install Elasticsearch 7.x
Download the 7.1.1 package from
https://www.elastic.co/cn/downloads/past-releases/elasticsearch-7-1-1(the latest version is also available at https://www.elastic.co/cn/downloads/elasticsearch). Since Elasticsearch 7.0 bundles JDK, a separate JDK installation is optional.
Create installation and data directories, extract the package, add an elasticsearch system user, and set proper permissions:
# Create directories and extract Elasticsearch
mkdir /{app,data}
tar zxf elasticsearch-7.1.1-linux-x86_64.tar.gz -C /app
# Create elasticsearch user
useradd elasticsearch
passwd elasticsearch
# Rename directory and change ownership
cd /app
mv elasticsearch-7.1.1 elasticsearch
chown elasticsearch:elasticsearch -R elasticsearch/Note: Elasticsearch must not be started as the root user.
2. Configuration
Edit elasticsearch.yml (example key settings):
cluster.name: es-cluster
node.name: es-01
path.data: /data
path.logs: /app/elasticsearch/logs
bootstrap.memory_lock: true
bootstrap.system_call_filter: false
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: 192.168.10.130
http.port: 9200
discovery.seed_hosts: ["192.168.10.130"]
cluster.initial_master_nodes: ["es-01"]
node.master: true
node.data: trueAdjust node.master and node.data according to the number of nodes in your cluster.
Set JVM heap size in jvm.options (recommended up to half of physical memory):
-Xms4g
-Xmx4g3. Start Elasticsearch
Run the startup script in the bin directory: ./bin/elasticsearch -d The -d flag runs the process in the background; you can also specify a PID file with -p. Verify the service with: curl -XGET "192.168.10.130:9200/" If the request returns cluster information, Elasticsearch is running correctly.
4. Install Elasticsearch‑head
Download the master branch from https://github.com/mobz/elasticsearch-head. Deploy the zip package to Tomcat (e.g., /app/tomcat-es-head/webapps) and rename the directory to elasticsearch-head:
unzip -d /app/tomcat-es-head/webapps elasticsearch-head-master.zip
cd /app/tomcat-es-head/webapps
mv elasticsearch-head-master elasticsearch-headStart Tomcat (listening on port 9100 in this example). The Head UI will be accessible via the browser.
Configure the UI by editing /app/tomcat-es-head/webapps/elasticsearch-head/_site/app.js and setting base_uri to the Elasticsearch HTTP address (default http://localhost:9200).
5. Elasticsearch 6.x Reference Configuration
For online deployments of Elasticsearch 6.x (e.g., 6.1.1), the following elasticsearch.yml excerpt can be used:
cluster.name: es-prod-cluster
node.name: es-prod-01
path.data: /data01,/data02,/data03
path.logs: ${ES_HOME}/logs
bootstrap.memory_lock: true
bootstrap.system_call_filter: false
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: ${IP}
http.port: 9200
discovery.zen.ping.unicast.hosts: ["otc-hadoop-es-01","otc-hadoop-es-02","otc-hadoop-es-03","otc-hadoop-es-04","otc-hadoop-es-05","otc-hadoop-es-06"]
discovery.zen.minimum_master_nodes: 3
node.master: true
node.data: trueAdjust file descriptor limits, thread counts, and virtual memory settings as needed; refer to the official Bootstrap Checks documentation for troubleshooting.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Big Data Technology Architecture
Exploring Open Source Big Data and AI Technologies
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
