1.jdk安裝
cd /usr/java;
tar -zxvf jdk-8u131-linux-x64.tar.gz
vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_131
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin
export PATH=$PATH:${JAVA_PATH}
2.es安裝
1.官網(wǎng)獲取下載鏈接,https://www.elastic.co/downloads/elasticsearch
2.解壓縮
3.修改es.yml配置
cluster.name: shark
node.name: node-1
path.data: /search/data
network.host: 0.0.0.0
http.port: 9200
discovery.zen.ping.unicast.hosts: ["10.146.x.32", "10.146.x.78","10.146.x.90"]
node.data: true
http.cors.enabled: true
http.cors.allow-origin: "*"
4.修改jvm配置
修改堆內(nèi)存大小為24G,不要超過32G,且不要超過本機的一半內(nèi)存
3.啟動
./bin/elasticsearch -d
4.錯誤處理
啟動報錯max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
修改 /etc/security/limits.conf中的 soft nofile和hard nofile值為65536
vi /etc/security/limits.conf
# End of file
### sat-set
* soft nofile 65536
* hard nofile 65536
* soft nproc unlimited
* hard nproc unlimited
啟動報錯[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
vi /etc/sysctl.conf
vm.max_map_count=262144