参考文章:https://blog.csdn.net/zk673820543/article/details/81781534
1.bin目录下运行elasticsearch-certgen:
依次输入生成cert.zip的文件名,节点信息和IP,会在当前目录生成一个zip压缩包
2.config目录下新建cert文件夹,将压缩包解压到文件夹会发现ca文件和各个节点密匙文件夹
3.将解压后的cert文件全部scp到其他节点
4.修改yml配置文件:不同节点指定自己节点的key和crt
xpack.security.transport.ssl.enabled: true
xpack.ssl.key: /home/ql/elasticsearch-6.5.4/config/certs/node1/node1.key
xpack.ssl.certificate: /home/ql/elasticsearch-6.5.4/config/certs/node1/node1.crt
xpack.ssl.certificate_authorities: /home/ql/elasticsearch-6.5.4/config/certs/ca/ca.crt