温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

centos7环境部署ES集群(3节点)

发布时间:2020-04-25 01:46:20 来源:网络 阅读:296 作者:aiqinghai18596 栏目:系统运维

此文档针对es在centos7环境3节点部署,3节点ip分别为:172.16.10.102.172.16.10.103,172.16.10.104
一、增加host
每个节点下增加host配置
172.16.10.102 HadoopMaster
172.16.10.103 HadoopSlave1
172.16.10.104 HadoopSlave2
二、然后下载es安装包
cd /opt wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.0.tar.gz
三、解压es安装包
tar -zxvf elasticsearch-6.4.0.tar.gz
四、编辑es配置文件(master配置如下,其他2个slave修改node.master:false即可)
vim config/elasticsearch.yml
network.host: 0.0.0.0
discovery.zen.ping_timeout: 120s
client.transport.ping_timeout: 60s
discovery.zen.ping.unicast.hosts: ["172.16.10.102","172.16.10.103", "172.16.10.104"]
cluster.name: escluster
node.name: HadoopMaster
path.data: /opt/elasticsearch-6.4.0/data
path.logs: /opt/elasticsearch-6.4.0/datalog
node.master: true
node.data: true
node.attr.rack: r1
bootstrap.memory_lock: true
bootstrap.system_call_filter: false
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
五、修改系统参数
vim /etc/security/limits.conf
新增

  • soft nofile 65536
  • hard nofile 65536
  • soft nproc 65536
  • hard nproc 65536
  • soft memlock unlimited
  • hard memlock unlimited
    vim /etc/sysctl.conf
    新增
    vm.max_map_count=655360
    然后重新加载系统参数
    sysctl -p
    六、使用es用户启动
    groupadd es
    useradd es -g es-p elasticsearch-6.4.0
    chown -R es:es elasticsearch-6.4.0
    su es
    ./elasticsearch -d
    七、安装head
    在随意个文件夹下 git clone git://github.com/mobz/elasticsearch-head.git

安装nodejs环境

yum -y install nodejs
cd elasticsearch-head/
npm install

npm install -g grunt-cli
grunt server &
Open http://localhost:9100
(如果提示报错phantomjs-prebuilt@2.1.16 install: node install.js
npm install phantomjs-prebuilt@2.1.16 --ignore-scripts 即可
重新启动es程序。
打开网页:http://172.16.10.102:9100(如果head的9200连接不上,检查配置文件的http.cors.enabled: true
http.cors.allow-origin: "*" 是否配置)

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI