ELK实验(六)elasticsearch集群搭建-创新互联

本次实验使用3台虚拟机

创新互联专注于企业网络营销推广、网站重做改版、灌阳网站定制设计、自适应品牌网站建设、成都h5网站建设购物商城网站建设、集团公司官网建设、成都外贸网站建设、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为灌阳等各大城市提供网站开发制作服务。

192.168.209.168

192.168.209.169

192.168.209.170

cp /usr/elasticsearch-6.2.3/config/elasticsearch.yml /usr/elasticsearch-6.2.3/config/elasticsearch.yml.bak

vi /usr/elasticsearch-6.2.3/config/elasticsearch.yml

cluster.name: ES_Cluster_Pcdog

node.name: 192.168.209.168

path.data: /usr/elasticsearch-6.2.3/data

path.logs: /usr/elasticsearch-6.2.3/logs

network.host: 192.168.209.168

node.master: true

node.data: true

discovery.zen.ping.unicast.hosts: ["192.168.209.168","192.168.209.169","192.168.209.170"]

discovery.zen.minimum_master_nodes: 3

discovery.zen.fd.ping_timeout: 120s

discovery.zen.fd.ping_retries: 6

discovery.zen.fd.ping_interval: 30s

cluster.routing.allocation.cluster_concurrent_rebalance: 40

cluster.routing.allocation.node_concurrent_recoveries: 40

cluster.routing.allocation.node_initial_primaries_recoveries: 40

bootstrap.memory_lock: false

bootstrap.system_call_filter: false

检查配置,过滤掉注释

cat elasticsearch.yml | grep -v "^#"

node 168 启动

./bin/elasticssearch

ELK 实验(六)elasticsearch集群搭建

集群状态yellow,因为其他2台还没起。。。

[2018-04-20T11:36:16,000][INFO ][o.e.c.r.a.AllocationService] [192.168.209.168] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[logstash-2018.04.18][1]] ...]).

配置文件复制到其他2个节点

scp elasticsearch.yml 192.168.209.169:/usr/elasticsearch-6.2.3/config

scp elasticsearch.yml 192.168.209.170:/usr/elasticsearch-6.2.3/config

ELK 实验(六)elasticsearch集群搭建

ELK 实验(六)elasticsearch集群搭建

然后在各自的node启动elasticssearch

node 002

ELK 实验(六)elasticsearch集群搭建

node 003

ELK 实验(六)elasticsearch集群搭建

在master node的目录/usr/elasticsearch-6.2.3/logs

ELK 实验(六)elasticsearch集群搭建

可以看到cluster日志

tail -f ES_Cluster_Pcdog.log

尼玛日志毫无更新,去其他2个节点看,2个node都有报错,难道是我克隆出来的机器的问题? 容我修个错误。

[2018-04-20T11:49:10,794][INFO ][o.e.d.z.ZenDiscovery ] [192.168.209.169] failed to send join request to master [{192.168.209.168}{-aU5102ETMW8isf85FWEHA}{V4flu0jLRfixBA0Yf9740w}{192.168.209.168}{192.168.209.168:9300}], reason [RemoteTransportException[[192.168.209.168][192.168.209.168:9300][internal:discovery/zen/join]]; nested: IllegalArgumentException[can't add node {192.168.209.169}{-aU5102ETMW8isf85FWEHA}{1IesX0gaSZWz2_O3eKDvfw}{192.168.209.169}{192.168.209.169:9300}, found existing node {192.168.209.168}{-aU5102ETMW8isf85FWEHA}{V4flu0jLRfixBA0Yf9740w}{192.168.209.168}{192.168.209.168:9300} with the same id but is a different node instance]; ]

原来是data里面有原来的数据,干掉

[pactera@ELK_002 data]$ pwd

/usr/elasticsearch-6.2.3/data

[pactera@ELK_002 data]$ rm -rf nodes/

3个节点都正常了

node 168 ,发现master 角色169

ELK 实验(六)elasticsearch集群搭建

node 169 ,状态黄变绿

ELK 实验(六)elasticsearch集群搭建

node 170 ,发现master 角色169

ELK 实验(六)elasticsearch集群搭建

稍后我需要研究下如何选举master过程,这个cluster 3个master 3个data,实际生产应该是2个master然后多个data的。

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。

分享名称:ELK实验(六)elasticsearch集群搭建-创新互联
网页网址:https://www.cdcxhl.com/article8/dodhip.html

成都网站建设公司_创新互联,为您提供App设计电子商务云服务器手机网站建设服务器托管小程序开发

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

绵阳服务器托管