ubuntu系统部署elasticsearch-7.17.28

ubuntu系统部署elasticsearch-7.17.28

下载

地址:https://www.elastic.co/downloads/past-releases/elasticsearch-7-17-28

解压

使用 tar -zxvf xxx.tar.gz 来解压

创建用户

useradd es
passwd es

将目录权限给es用户

chown -R es:es elasticsearch-7-17-28

配置

jvm配置

vim jvm.options

es配置

vim elasticsearch.yml
具体配置如下【单机版】
cluster.name: es
node.name: node-1
path.data: /opt/software/elasticsearch-7.17.28/data
path.logs: /opt/software/elasticsearch-7.17.28/logs
network.host: 0.0.0.0
http.port: 9200

# 单节点模式配置
discovery.type: single-node

# 安全配置
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.client_authentication: required
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12

证书生成

在es根目录下执行

# 创建一个证书颁发机构
bin/elasticsearch-certutil ca
# 为节点生成证书和私钥
bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12
# 移动到config目录下
mv *.p12 config/

密码设置

bin/elasticsearch-setup-passwords interactive

启动

# 切换es用户执行
./bin/elasticsearch -d
posted @ 2025-03-15 15:35  实习小生  阅读(163)  评论(0)    收藏  举报