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.官网获取下载链接,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配置
修改堆内存大小为24G,不要超过32G,且不要超过本机的一半内存
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