以下我们在Centos7操作系统上以Elasticsearch7.17.6为例来进行一下安装
环境准备
Elasticsearch https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.6-linux-x86_64.tar.gz
其它包格式:https://www.elastic.co/cn/downloads/past-releases/elasticsearch-7-17-6
开始安装
-
解压
-
修改elasticsearch.yml
cluster.name: TestEs
node.name: node01
path.data: /data/es7/data
path.logs: /data/es7/logs
network.host: 192.168.5.112
http.port: 9200
cluster.initial_master_nodes: ["node01"]
http.max_initial_line_length: 64kb
# 下面这段配置后续在配也行,因为得先生成证书才能配置证书绝对路径
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /opt/app/elasticsearch-7.17.6/config/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /opt/app/elasticsearch-7.17.6/config/elastic-certificates.p12
-
进入到elasticsearch解压目录执行生成CA证书命令
bin/elasticsearch-certutil ca
一路回车即可,成功后会在解压目录下生成elastic-stack-ca.p12文件 -
根据上述产生的CA证书来生成对应的密钥,执行命令
bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12
,一路回车即可,成功后会在解压目录下生成elastic-certificates.p12秘钥文件 -
将elastic-certificates.p12移动到config目录下
-
如果没有添加elasticsearch.yml末尾的配置,那么此时可以添加
-
chown -R bigdata.bigdata es解压目录
-
启动
bin/elasticsearch -d
-
设置密码
bin/elasticsearch-setup-passwords interactive
问题
access denied (“java.io.FilePermission“ “/cert/elastic-certificates.p12“ “read“)
将elastic-certificates.p12移动到config目录下