1.wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.13.4-linux-x86_64.tar.gz
2. root用户下
vim /etc/sysctl.conf 添加vm.max_map_count=262144 退出wq! 保存退出,刷新配置文件 sysctl -p
vim /etc/security/limits.conf
添加 * soft nofile 65536* hard nofile 65536
退出wq!3. useradd es
4.5. sudo chown -R es:es /usr/local/elasticsearch-7.13.45. su es
6. vim /usr/local/elasticsearch-7.13.4/config/elasticsearch.yml
见最下面
7. cd /usr/local/elasticsearch-7.13.4/bin 后台运行./elasticsearch -d 先保持时间同步
8. http://192.168.1.8:9200
#
node.name: node-1
#
# Add custom attributes tothe node:
#
#node.attr.rack: r1
#
# -----------------------------------Paths------------------------------------
#
# Pathtodirectory where tostore the data (separate multiple locations by comma):
#
path.data:/home/es/data
#
# Pathtolog files:
#
path.logs:/home/es/logs
#
# -----------------------------------Memory-----------------------------------
#
# Lock the memory on startup:
#
bootstrap.memory_lock:false
#
# Make sure that the heap size is set toabout half the memory available
# on the system and that the owner of the process is allowed tousethis
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ----------------------------------Network-----------------------------------
#
# BydefaultElasticsearch is only accessible on localhost. Set a different
# address here toexposethis node on the network:
#
network.host:0.0.0.0
#
# BydefaultElasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200.Set a specific HTTP port here:
#
http.port:9200
#
# For more information, consult the network moduledocumentation.
#
# ---------------------------------Discovery----------------------------------
#
# Pass an initial list of hosts toperform discovery when this node is started:
# Thedefault list of hosts is ["127.0.0.1","[::1]"]
#
#discovery.seed_hosts:["host1","host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes:["node-1"]
#
# For more information, consult the discovery and cluster formation moduledocumentation.
#
# ----------------------------------Various-----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name:true