Elasticsearch 7.13.2 多节点集群(含配置xpack及创建设置证书和私钥)安装部署指南
# 1. 安装Elasticsearch
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install -y apt-transport-https
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update && sudo apt-get install -y elasticsearch
# 2. 配置Elasticsearch
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
# 3. 启动Elasticsearch服务
sudo systemctl start elasticsearch.service
# 4. 配置X-Pack(如果需要)
# 安装X-Pack
sudo elasticsearch-plugin install x-pack
# 启动Elasticsearch并使用X-Pack功能
sudo systemctl restart elasticsearch.service
# 5. 设置密码并创建证书
# 首次运行Elasticsearch后,通过运行以下命令来设置密码并生成证书
sudo /usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive
# 创建证书
sudo /usr/share/elasticsearch/bin/elasticsearch-certutil ca
sudo /usr/share/elasticsearch/bin/elasticsearch-certutil cert --ca
# 6. 配置kibana连接到Elasticsearch
# 编辑kibana配置文件
sudo nano /etc/kibana/kibana.yml
# 在文件中设置Elasticsearch的URL,并启用SSL
elasticsearch.hosts: ["https://localhost:9200"]
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.certificate: /path/to/your/certificate.pem
xpack.security.transport.ssl.key: /path/to/your/key.pem
xpack.security.transport.ssl.certificate_authorities: ["/path/to/your/ca.pem"]
# 7. 启动Kibana服务
sudo systemctl start kibana.service
这个例子展示了如何在Ubuntu系统上安装Elasticsearch 7.x版本,并配置多节点集群,包括启用X-Pack安全功能,设置密码,创建证书,以及配置Kibana连接到Elasticsearch。注意,这个例子假设你已经有了基本的Linux系统管理经验,并且已经解决了任何依赖性问题。
评论已关闭