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

[经验分享] ELK日志分析系统安装,多节点(二)

[复制链接]

尚未签到

发表于 2019-1-28 12:28:08 | 显示全部楼层 |阅读模式
  ELK日志分析系统安装,多节点(二)
  
  
  在前面的单节点基础上更改:
  
  一、服务器时间同步:
  查看时间服务器的时间:
  # rdate time-b.nist.gov
  设置时间和时间服务器同步:
  # rdate -s time-b.nist.gov
  二、服务器免密登录:
  1、通过命令”ssh-keygen -t rsa“
  “.ssh”会生成以下几个文件
  authorized_keys:存放远程免密登录的公钥,主要通过这个文件记录多台机器的公钥
  id_rsa : 生成的私钥文件
  id_rsa.pub : 生成的公钥文件
  know_hosts : 已知的主机公钥清单
  2、通过ssh-copy-id的方式
  ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.92.33考到对应服务就可以免密登录了
  
  三、设置hosts:
  
  四、Elasticsearch多节点集群配置文件
  节点1:
http.port: 9200  
node.name: linux4
  
cluster.name: es_cluster
  
network.host: 0.0.0.0
  

  
discovery.zen.ping.unicast.hosts: ["192.168.32.44","192.168.32.55"]
  
discovery.zen.minimum_master_nodes: 2
  

  
bootstrap.memory_lock: false
  
bootstrap.system_call_filter: false
  
path.data: /usr/local/elasticsearch-5.3.0/data
  
path.logs: /usr/local/elasticsearch-5.3.0/logs
  

  
cluster.routing.allocation.disk.threshold_enabled: false
  
#cluster.routing.allocation.disk.watermark.low: 30gb
  
##cluster.routing.allocation.disk.watermark.high: 20g
  

  
http.cors.allow-origin: "/.*/"
  
http.cors.enabled: true
  节点2:
http.port: 9200  
node.name: linux5
  
cluster.name: es_cluster
  
network.host: 0.0.0.0
  

  
discovery.zen.ping.unicast.hosts: ["192.168.32.44","192.168.32.55"]
  
discovery.zen.minimum_master_nodes: 2
  

  
bootstrap.memory_lock: false
  
bootstrap.system_call_filter: false
  
path.data: /usr/local/elasticsearch-5.3.0/data
  
path.logs: /usr/local/elasticsearch-5.3.0/logs
  

  
cluster.routing.allocation.disk.threshold_enabled: false
  
#cluster.routing.allocation.disk.watermark.low: 30gb
  
##cluster.routing.allocation.disk.watermark.high: 20g
  

  
http.cors.allow-origin: "/.*/"
  
http.cors.enabled: true
  然后测试:
  因为只有两个节点的话会出现“脑裂”现象所以一般多节点为3个节点,因为只有两台机所以在一台机里面弄了两个节点方法如下:
ElasticSearch单机双实例的配置方法:
  一个服务器上开多个ES实例,以便达到充分利用资源的目的。
  
配置变更
  要做到单机上开多个实例,需要修改ES的默认配置,以下是一些配置要点:
node.max_local_storage_nodes
  这个配置限制了单节点上可以开启的ES存储实例的个数,我们需要开多个实例,因此需要把这个配置写到配置文件中,并为这个配置赋值为2或者更高。
http.port
  这个配置是elasticsearch对外提供服务的http端口配置,默认情况下ES会取用9200~9299之间的端口,如果9200被占用就会自动使用9201,在单机多实例的配置中这个配置实际是不需要修改的。
  但是为了更好地进行配置管理,以及和老的配置兼容,我们还是手动将第一个实例的http端口配置为9200,第二个实例配置为9201。
transport.tcp.port
  这个配置指定了elasticsearch集群内数据通讯使用的端口,默认情况下为9300,与上面的http.port配置类似,ES也会自动为已占用的端口选择下一个端口号。我们可以将第一个实例的tcp传输端口配置为9300,第二实例配置为9301。
  节点1:
  /usr/local/elasticsearch-5.3.0/config/elasticsearch.yml
http.port: 9200  
node.name: linux4
  
cluster.name: es_cluster
  
network.host: 0.0.0.0
  

  
node.max_local_storage_nodes: 2
  

  
discovery.zen.ping.unicast.hosts: ["192.168.32.44","192.168.32.55","192.168.32.44:9301"]
  
discovery.zen.minimum_master_nodes: 3
  

  
bootstrap.memory_lock: false
  
bootstrap.system_call_filter: false
  
path.data: /usr/local/elasticsearch-5.3.0/data
  
path.logs: /usr/local/elasticsearch-5.3.0/logs
  
cluster.routing.allocation.disk.threshold_enabled: false
  
#cluster.routing.allocation.disk.watermark.low: 30gb
  
##cluster.routing.allocation.disk.watermark.high: 20gb
  

  
http.cors.allow-origin: "/.*/"
  
http.cors.enabled: true
  节点2:
  /usr/local/elasticsearch-5.3.0-rep2/config/elasticsearch.yml
http.port: 9201  
transport.tcp.port: 9301
  
node.name: linux4-rep2
  
cluster.name: es_cluster
  
network.host: 0.0.0.0
  

  
node.max_local_storage_nodes: 2
  

  
discovery.zen.ping.unicast.hosts: ["192.168.32.44","192.168.32.55","192.168.32.44:9301"]
  
discovery.zen.minimum_master_nodes: 3
  

  
bootstrap.memory_lock: false
  
bootstrap.system_call_filter: false
  
path.data: /usr/local/elasticsearch-5.3.0-rep2/data
  
path.logs: /usr/local/elasticsearch-5.3.0-rep2/logs
  
cluster.routing.allocation.disk.threshold_enabled: false
  
#cluster.routing.allocation.disk.watermark.low: 30gb
  
###cluster.routing.allocation.disk.watermark.high: 20gb
  
#
  
http.cors.allow-origin: "/.*/"
  
http.cors.enabled: true
  另一台机改下配置文件的节点设置就是3个节点了
  节点3:
http.port: 9200  
node.name: linux5
  
cluster.name: es_cluster
  
network.host: 0.0.0.0
  

  
discovery.zen.ping.unicast.hosts: ["192.168.32.44","192.168.32.55","192.168.32.44:9301"]
  
discovery.zen.minimum_master_nodes: 3
  

  
bootstrap.memory_lock: false
  
bootstrap.system_call_filter: false
  
path.data: /usr/local/elasticsearch-5.3.0/data
  
path.logs: /usr/local/elasticsearch-5.3.0/logs
  

  
cluster.routing.allocation.disk.threshold_enabled: false
  
#cluster.routing.allocation.disk.watermark.low: 30gb
  
##cluster.routing.allocation.disk.watermark.high: 20g
  

  
http.cors.allow-origin: "/.*/"
  
http.cors.enabled: true
  本文转载自:
  http://www.linuxidc.com/Linux/2017-04/143181.htm
  http://blog.csdn.net/lw305080/article/details/52528731



运维网声明 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-668706-1-1.html 上篇帖子: 搭建部署 分布式ELK平台 (二) 下篇帖子: CentOS 7 源码包安装ELK Stack日志分析平台
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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