设为首页 收藏本站
查看: 1833|回复: 0

[经验分享] CentOS7部署ElasticSearch

[复制链接]

尚未签到

发表于 2019-1-29 10:59:26 | 显示全部楼层 |阅读模式
  

CentOS7部署ElasticSearch-2.1.1集群

系统规划
  主机名
  IP地址
  系统版本
  软件版本
  node160
  192.168.1.160
  centos7
  ElasticSearch-2.1.1
  node161
  192.168.1.161
  centos7
  ElasticSearch-2.1.1
  node162
  192.168.1.162
  centos7
  ElasticSearch-2.1.1
  
所有节点检查java版本
[root@node160~]# java  -version
javaversion "1.8.0_40"
Java(TM)SE Runtime Environment (build 1.8.0_40-b26)
JavaHotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)  
所有节点配置hosts文件
192.168.1.160   node160
192.168.1.161   node161
192.168.1.162   node162  

所有节点安装ElasticSearch
[root@node160 ~]# mkdir   /opt/elk
[root@node160~]# cd /opt/elk
[root@node160~]#  wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.1.1/elasticsearch-2.1.1.tar.gz  
[root@node160elk]# tar xf  elasticsearch-2.1.1.tar.gz  

创建启动elasticsearch用户
[root@node160bin]# groupadd elk
[root@node160bin]# useradd elk -g elk -p elasticsearch
[root@node162elk]# chown  -R elk.elk  elasticsearch-2.1.1
[root@node160elk]# passwd  elk
更改用户 elk 的密码 。
新的 密码:
无效的密码: 密码少于 8 个字符
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。启动elasticsearch
[root@node162elasticsearch-2.1.1]# su  elk
[elk@node162elasticsearch-2.1.1]$ bin/elasticsearch  

[2016-03-0714:53:09,636][INFO ][node                    ] [Sea Urchin] version[2.1.1], pid[1367],build[40e2c53/2015-12-15T13:05:55Z]
[2016-03-0714:53:09,636][INFO ][node                    ] [Sea Urchin] initializing ...
[2016-03-0714:53:09,796][INFO ][plugins                 ] [Sea Urchin] loaded [], sites []
[2016-03-0714:53:09,867][INFO ][env                     ] [Sea Urchin] using [1] data paths, mounts [[/ (rootfs)]], netusable_space [48.5gb], net total_space [49.9gb], spins? [unknown], types[rootfs]
[2016-03-0714:53:11,972][INFO ][node                    ] [Sea Urchin] initialized
[2016-03-0714:53:11,972][INFO ][node                     ] [Sea Urchin] starting ...
[2016-03-0714:53:12,289][INFO ][transport               ] [Sea Urchin] publish_address {127.0.0.1:9300}, bound_addresses{127.0.0.1:9300}, {[::1]:9300}
[2016-03-0714:53:12,308][INFO ][discovery               ] [Sea Urchin]elasticsearch/dJDdF4-sSdOsVsnzrEBk7g
[2016-03-0714:53:15,485][INFO ][cluster.service         ] [Sea Urchin] new_master {SeaUrchin}{dJDdF4-sSdOsVsnzrEBk7g}{127.0.0.1}{127.0.0.1:9300}, reason:zen-disco-join(elected_as_master, [0] joins received)
[2016-03-0714:53:15,557][INFO ][http                    ] [Sea Urchin] publish_address {127.0.0.1:9200}, bound_addresses{127.0.0.1:9200}, {[::1]:9200}
[2016-03-0714:53:15,558][INFO ][node                    ] [Sea Urchin] started
[2016-03-0714:53:15,579][INFO ][gateway                 ] [Sea Urchin] recovered [0] indices into cluster_state  
所有节点配置elk启动内存
[root@node160bin]# vi  elasticsearch.in.sh
ES_MIN_MEM=32g
ES_MAX_MEM=32g  
所有节点配置elk集群模式
  [root@node160config]# vi  elasticsearch.yml
# ======================== Elasticsearch Configuration =========================
#  ---------------------------------- Cluster -----------------------------------
cluster.name: elastic
#  ------------------------------------ Node ------------------------------------
node.name: elastic160
#node.master: true
node.data: true
#  ----------------------------------- Paths ------------------------------------
path.conf    : /application/elasticsearch-2.1.1/config
path.data    : /application/elasticsearch-2.1.1/data
path.logs    : /application/elasticsearch-2.1.1/logs
path.plugins : /application/elasticsearch-2.1.1/plugins
path.work    : /tmp
#  ----------------------------------- Memory -----------------------------------
bootstrap.mlockall: true
#  ---------------------------------- Http -----------------------------------
http.enabled:       true
http.host:          192.168.1.160
http.bind_host:     192.168.1.160
http.publish_host:  192.168.1.160
http.port:          9200
http.max_content_length:      100mb
http.max_initial_line_length: 4kb
http.max_header_size:         8kb
http.compression:             true
http.compression_level:       3
http.cors.max-age:            1728000
# ----------------------------------- Index -------------------------------------
index.number_of_shards: 5
index.number_of_replicas: 1
#  ---------------------------------- Network -----------------------------------
#  关系推到: 通过network.host  ----->network.bind_host ------>network.publish_host
network.host:         192.168.1.160
network.bind_host:    192.168.1.160
network.publish_host: 192.168.1.160
#  ---------------------------------- Transport-----------------------------------
transport.host:                192.168.1.160
transport.bind_host:           192.168.1.160
transport.publish_host:        192.168.1.160
transport.tcp.connect_timeout: 10s
transport.ping_schedule:       2s
transport.tcp.port:            9300
transport.publish_port:        9300
transport.tcp.compress:        true
#  ---------------------------------- Descovery-----------------------------------
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["elastic160", "elastic161","elastic162"]
discovery.zen.join_timeout: 3s
#配置当前集群中最少的主节点,对于多于两个节点的集群环境,建议配置大于1.
discovery.zen.minimum_master_nodes: 2
ping_interval:   1
ping_timeout:    15
ping_retries:    3
#  ---------------------------------- Gateway -----------------------------------
gateway.recover_after_nodes: 3
# ---------------------------------- Various -----------------------------------
action.destructive_requires_name: true  

  [root@node161 config]# vi  elasticsearch.yml
# ======================== Elasticsearch Configuration =========================
#  ---------------------------------- Cluster -----------------------------------
cluster.name: elastic
#  ------------------------------------ Node ------------------------------------
node.name: elastic161
#node.master: true
node.data: true
#  ----------------------------------- Paths ------------------------------------
path.conf    : /application/elasticsearch-2.1.1/config
path.data    : /application/elasticsearch-2.1.1/data
path.logs    : /application/elasticsearch-2.1.1/logs
path.plugins : /application/elasticsearch-2.1.1/plugins
path.work    : /tmp
#  ----------------------------------- Memory -----------------------------------
bootstrap.mlockall: true
#  ---------------------------------- Http -----------------------------------
http.enabled:       true
http.host:          192.168.1.161
http.bind_host:     192.168.1.161
http.publish_host:  192.168.1.161
http.port:          9200
http.max_content_length:      100mb
http.max_initial_line_length: 4kb
http.max_header_size:         8kb
http.compression:             true
http.compression_level:       3
http.cors.max-age:            1728000
# ----------------------------------- Index -------------------------------------
index.number_of_shards: 5
index.number_of_replicas: 1
#  ---------------------------------- Network -----------------------------------
#  关系推到: 通过network.host  ----->network.bind_host ------>network.publish_host
network.host:         192.168.1.161
network.bind_host:    192.168.1.161
network.publish_host: 192.168.1.161
#  ---------------------------------- Transport-----------------------------------
transport.host:                192.168.1.161
transport.bind_host:           192.168.1.161
transport.publish_host:        192.168.1.161
transport.tcp.connect_timeout: 10s
transport.ping_schedule:       2s
transport.tcp.port:            9300
transport.publish_port:        9300
transport.tcp.compress:        true
#  ---------------------------------- Descovery-----------------------------------
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["elastic160", "elastic161","elastic162"]
discovery.zen.join_timeout: 3s
#配置当前集群中最少的主节点,对于多于两个节点的集群环境,建议配置大于1.
discovery.zen.minimum_master_nodes: 2
ping_interval:   1
ping_timeout:    15
ping_retries:    3
#  ---------------------------------- Gateway -----------------------------------
gateway.recover_after_nodes: 3
# ---------------------------------- Various -----------------------------------
action.destructive_requires_name: true  

  
  
  [root@node162 config]# vi  elasticsearch.yml
# ======================== Elasticsearch Configuration =========================
#  ---------------------------------- Cluster -----------------------------------
cluster.name: elastic
#  ------------------------------------ Node ------------------------------------
node.name: elastic162
#node.master: true
node.data: true
#  ----------------------------------- Paths ------------------------------------
path.conf    : /application/elasticsearch-2.1.1/config
path.data    : /application/elasticsearch-2.1.1/data
path.logs    : /application/elasticsearch-2.1.1/logs
path.plugins : /application/elasticsearch-2.1.1/plugins
path.work    : /tmp
#  ----------------------------------- Memory -----------------------------------
bootstrap.mlockall: true
#  ---------------------------------- Http -----------------------------------
http.enabled:       true
http.host:          192.168.1.162
http.bind_host:     192.168.1.162
http.publish_host:  192.168.1.162
http.port:          9200
http.max_content_length:      100mb
http.max_initial_line_length: 4kb
http.max_header_size:         8kb
http.compression:             true
http.compression_level:       3
http.cors.max-age:            1728000
# ----------------------------------- Index -------------------------------------
index.number_of_shards: 5
index.number_of_replicas: 1
#  ---------------------------------- Network -----------------------------------
#  关系推到: 通过network.host  ----->network.bind_host ------>network.publish_host
network.host:         192.168.1.162
network.bind_host:    192.168.1.162
network.publish_host: 192.168.1.162
#  ---------------------------------- Transport-----------------------------------
transport.host:                192.168.1.162
transport.bind_host:           192.168.1.162
transport.publish_host:        192.168.1.162
transport.tcp.connect_timeout: 10s
transport.ping_schedule:       2s
transport.tcp.port:            9300
transport.publish_port:        9300
transport.tcp.compress:        true
#  ---------------------------------- Descovery-----------------------------------
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["elastic160", "elastic161","elastic162"]
discovery.zen.join_timeout: 3s
#配置当前集群中最少的主节点,对于多于两个节点的集群环境,建议配置大于1.
discovery.zen.minimum_master_nodes: 2
ping_interval:   1
ping_timeout:    15
ping_retries:    3
#  ---------------------------------- Gateway -----------------------------------
gateway.recover_after_nodes: 3
# ---------------------------------- Various -----------------------------------
action.destructive_requires_name: true  

  
所有节点安装ElasticSearch插件
  head插件:
  ./plugin   install  mobz/elasticsearch-head
  kosf插件
  ./plugin   install  lmenezes/elasticsearch-kopf/master
  delete-by-query插件
  ./plugin  install  delete-by-query
  
所有节点启动elasticsearch
  su   elk -c  "/opt/elk/elasticsearch-2.1.1/bin/elasticsearch  & "
  或者
  su   elk -c  "/opt/elk/elasticsearch-2.1.1/bin/elasticsearch  -d"
  

所有节点访问启动是否正常
  http://192.168.1.160:9200
  http://192.168.1.161:9200
  http://192.168.1.162:9200
  
访问集群节点是否正常,使用head插件
  http://192.168.1.160:9200/_plugin/head/


  

  http://192.168.1.160:9200/_plugin/kopf/

  





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-669096-1-1.html 上篇帖子: elasticsearch6.x {"error":"Content 下篇帖子: ElasticSearch入门介绍之会当凌绝顶(一)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表