741057228我QQ 发表于 2019-1-29 08:34:52

Elasticsearch5.1.1集群安装部署

1、准备环境
两台机器ip规划:
主机IPnode-33
192.168.2.33
node-34
192.168.2.34
2、安装JDK
sed -i.ori '$a export JAVA_HOME=/data/jdk\nexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH\nexport 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、启动服务
  
https://s5.运维网.com/wyfs02/M01/8C/8B/wKiom1hvRxXg-CgwAACMy9KT5YU415.png



页: [1]
查看完整版本: Elasticsearch5.1.1集群安装部署