Elasticsearch8版本安装详解,单节点部署、多节点部署,从网络安全语言到AIDL使用与原理讲解

6、启动kibana:elastic-cluster1/kibana-8.1.0/bin/kibana --allow-root

查询结果如下

image-20230403222013578

image-20230403223830460

5、多服务器部署节点加入同一集群

因为生产环境的es是启动着安全设置的,使用TLS加密节点间进行通信,可以参考官网文档:https://www.elastic.co/guide/en/elasticsearch/reference/8.1/security-basic-setup.html#encrypt-internode-communication

5.1、方法论

注意事项:集群中的节点数量应该是奇数个,最少为3个,这样可以避免脑裂问题

就不放截图了,直接口述,跟上面配置没有太大出入,包括注意事项一样,当时这个问题卡了我几天后来把data目录下的数据删除后在启动就可以了

1、如果你是新集群,es内没有任何数据可以使用此方法,把es里面配置的的data和logs目录下的所有内容都删除

2、主机这两个内网主机是否能通信,首先保证通信正常,能ping就行

3、是否设置了node.roles:,如果默认不用管,如果设置了你要确保你设置的是否正确

4、确保你的ca证书,及tls设置是否正确,可以参考下面配置的生成证书然后分配到对应节点上在加入集群,或者用取巧的方法,直接把集群拷贝过去,然后修改一下启动即可

5、不用生成新的token node,新节点也不用指定token

  • 我的操作步骤,复制已有集群到另外一台机器上,然后配置/etc/hosts文件把IP和主机名加入进去,然后,新节点下的data和logs目录内的文件全部删除,配置文件配置好集群信息,启动集群加入新节点即可
  • 3个节点的配置文件:

主节点配置如下:

cluster.name: node-xiao
node.name: master
network.host: 0.0.0.0
http.port: 9200
transport.port: 9300
discovery.seed_hosts: [“192.168.0.160:9300”, “192.168.0.160:9302”, “192.168.0.183:9301”]
cluster.initial_master_nodes: [“master”]
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
enabled: true
keystore.path: certs/http.p12
xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12

node1节点配置如下:

cluster.name: node-xiao
node.name: node1
network.host: 0.0.0.0
http.port: 9202
transport.port: 9302
discovery.seed_hosts: [“192.168.0.160:9300”, “192.168.0.160:9302”, “192.168.0.183:9301”]
cluster.initial_master_nodes: [“master”]
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
enabled: true
keystore.path: certs/http.p12
xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12

node2节点配置如下:

cluster.name: node-xiao
node.name: node2
network.host: 0.0.0.0
http.port: 9201
transport.port: 9301
discovery.seed_hosts: [“192.168.0.183:9301”, “192.168.0.160:9302”, “192.168.0.160:9300”]
cluster.initial_master_nodes: [“master”]
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
enabled: true
keystore.path: certs/http.p12
xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12

image-20230529144854877

  • 我试了两种方法,第一种是集群全部是初始化新的状态,方法二是加入节点,没有太大的差异

跟方法1没有什么出入

image-20230529154819085

  • 18
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值