elasticsearch
es啟動(dòng)先決條件
添加用戶(hù)和權(quán)限
[root@es1 ~]# mv elasticsearch-7.9.3 /opt/elk/elasticsearch
[root@es1 ~]# cd /opt/elk/
[root@es1 elk]# useradd es
[root@es1 elk]# chown -R es:es elasticsearch
調(diào)整進(jìn)程最大打開(kāi)文件數(shù)數(shù)量
# 臨時(shí)設(shè)置
[root@es1 elk]# ulimit -n 65535
# 永久設(shè)置,重啟生效
[root@es1 elk]# vi /etc/security/limits.conf
* hard nofile 65535
* soft nofile 65535
調(diào)整進(jìn)程最大虛擬內(nèi)存區(qū)域數(shù)量
# 臨時(shí)設(shè)置
[root@es1 elk]# sysctl -w vm.max_map_count=262144
vm.max_map_count = 262144
# 永久設(shè)置
[root@es1 elk]# echo "vm.max_map_count=262144" >> /etc/sysctl.conf
[root@es1 elk]# sysctl -p
vm.max_map_count = 262144
ES 集群部署
[root@es1 elasticsearch]# vi config/elasticsearch.yml
cluster.name: elk-cluster # 集群名稱(chēng)
node.name: node-1 # 集群節(jié)點(diǎn)名稱(chēng)
#path.data: /path/to/data # 數(shù)據(jù)目錄
#path.logs: /path/to/logs # 日志目錄
network.host: 0.0.0.0 # 監(jiān)聽(tīng)地址
http.port: 9200 # 監(jiān)聽(tīng)端口
discovery.seed_hosts: ["192.168.153.25"]
ES 服務(wù)啟動(dòng)
[root@es1 elasticsearch]# vi /usr/lib/systemd/system/elasticsearch.service
[Unit]
Description=elasticsearch
[Service]
User=es
LimitNOFILE=65535
ExecStart=/opt/elk/elasticsearch/bin/elasticsearch
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
---------------------------------------------------------------------------------------
[root@es1 system]# systemctl daemon-reload
[root@es1 system]# systemctl start elasticsearch
ES圖形頁(yè)面
[root@es2 ~]# nohup ./ElasticHD &
http://192.168.153.26:9800/