elasticsearch-7.0.0安裝和遇到的問題
阿新 • • 發佈:2021-01-16
技術標籤:Devops
安裝步驟
1.建立使用者
[[email protected] bin]# groupadd es
[[email protected] bin]# useradd es -g es
[[email protected] bin]# mkdir -p /usr/local/elasticsearch-7.0.0/
[[email protected] bin]# chown -R es:es /usr/local/elasticsearch-7.0.0/
2.解壓縮,啟動命令./bin/elasticsearch,後臺啟動./bin/elasticsearch -d
3.修改conf檔案
#cluster.name: my-application 解開遮蔽
#node.name: node-1 解開遮蔽
#network.host: 192.168.0.1 修改:network.host: 0.0.0.0
#http.port: 9200 解開遮蔽
#cluster.initial_master_nodes: ["node-1", "node-2"] 修改:cluster.initial_master_nodes: ["node-1"]
4.訪問測試:http://192.168.5.226:9200/
問題1
1.[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
vi /etc/security/limits.conf [[email protected] pub]# ulimit -Hn 4096 [[email protected] pub]# ulimit -Sn 1024 * soft nofile 65536 * hard nofile 65536 重新登入
2.[2]: max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
vm.max_map_count:限制一個程序可以擁有的VMA(虛擬記憶體區域)的數量
vi /etc/sysctl.conf
vm.max_map_count=655360
重新登入
3.[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
cluster.initial_master_nodes: ["node-1"] 替換為對應的node名稱