Elasticsearch5.1.1集群安装部署
1、准备环境两台机器ip规划:主机IP
node-33192.168.2.33
node-34192.168.2.34
2、安装JDK
sed -i.ori '$a export JAVA_HOME=/data/jdkexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATHexport CLASSPATH=.$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar'/etc/profile
. /etc/profile
3、sudo授权:(elasticseatch只能普通用户执行)
sed -ir '99 i elasticsearch ALL=(ALL) NOPASSWD: ALL' /etc/sudoers
4、修改集群配置config/elasticsearch.yml
node-33:
$ grep "^" elasticsearch.yml
cluster.name: my-application
node.name: node-33
node.master: true
node.data: true
network.host: 192.168.2.33
http.port: 9200
http.enabled: true
http.cors.enabled: true
http.cors.allow-origin: "*"
node-44:
$ grep "^" elasticsearch.yml
cluster.name: my-application
node.name: node-34
node.master: false
node.data: true
network.host: 192.168.2.34
http.port: 9200
http.enabled: true
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["192.168.2.33", "192.168.2.34"]
5、启动服务
学习了!
页:
[1]