首页 > 其他 > 详细

Elasticsearch 7.2.1 安装

时间:2021-04-05 20:21:02      阅读:32      评论:0      收藏:0      [点我收藏+]

 

OS版本: CentOS 7.8

Elasticsearch版本:elasticsearch 7.2.1

 

一、单机模式

1.1 OS配置

vi /etc/security/limits.conf
----------------------------------------------
# 修改内容
*    soft    nproc    65535
*    hard    nproc    65535
*    soft    nofile    65535
*    hard    nofile    65535

 

  vi /etc/security/limits.d/20-nproc.conf
  ----------------------------------------------------------
  # 修改内容
  * soft nproc 65565
  ----------------------------------------------------------
  ulimit -Sn # 查看打开文件数软限制
  ulimit -Hn # 查看打开文件数硬限制
  ulimit -Su # 查看打开线程软限制
  ulimit -Hu # 查看打开线程硬限制

 

 

vi /etc/sysctl.conf
-------------------------------------------------
# 添加内容
vm.max_map_count=262144
-------------------------------------------------
sysctl -p    # 验证

 

 

1.2 ES安装

cd /opt
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.1-linux-x86_64.tar.gz
tar -zxvf elasticsearch-7.2.1-linux-x86_64.tar.gz
mv elasticsearch-7.2.1-linux-x86_64 elasticsearch

 

 

1.3 配置elasticsearch.yml

vi config/elasticsearch.yml
-----------------------------------------------------
cluster.name: es-test
node.name: node-1
path.data: /opt/elasticsearch/data
path.logs: /opt/elasticsearch/logs
network.host: 192.168.1.11
http.port: 9200
cluster.initial_master_nodes: ["node-1"]
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true

 

 

1.4 ES启动

bin/elasticsearch -d

 

 

1.5 设置账号

# 参数interactive:给用户一一设置密码,auto:自动生成密码
bin/elasticsearch-setup-passwords interactive

 

 

1.6 验证

# 查看集群健康状态
curl -XGET -u elastic:password "http://192.168.100.11:9200/_cluster/health?pretty"

 

 

 

二、集群模式

 2.1 OS设置

与单机模式一致。

 

2.2 ES安装

cd /opt
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.1-linux-x86_64.tar.gz
tar -zxvf elasticsearch-7.2.1-linux-x86_64.tar.gz
mv elasticsearch-7.2.1-linux-x86_64 elasticsearch

 

 

2.3 证书配置

# 如下操作在其中一个node节点执行即可,生成完证书传到集群其他节点目录/opt/elasticsearch/config
# 两条命令均一路回车即可,不需要给秘钥再添加密码。
cd /opt/elasticsearch/config
../bin/elasticsearch-certutil ca
../bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12

 

 

2.4 配置elasticsearch.yml

cluster.name: es-test
node.name: node-1
path.data: /opt/elasticsearch/data
path.logs: /opt/elasticsearch/logs
network.host: 192.168.100.11
http.port: 9200
discovery.seed_hosts: ["192.168.100.11", "192.168.100.12", "192.168.100.13"]
cluster.initial_master_nodes: ["node-1","node-2","node-3"]
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12

 

 

2.5 启动ES

bin/elasticsearch -d

 

 

2.6 设置账号

# 参数interactive:给用户一一设置密码,auto:自动生成密码
bin/elasticsearch-setup-passwords interactive

 

 

2.7 验证

# 查看集群健康状态
curl -XGET -u elastic:password "http://192.168.100.11:9200/_cluster/health?pretty"

 

Elasticsearch 7.2.1 安装

原文:https://www.cnblogs.com/linwenhai/p/14618878.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!