Elasticsearch 7.2.1 安装
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Elasticsearch 7.2.1 安装,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3106字,纯文字阅读大概需要5分钟。
内容图文
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 安装全部内容,希望文章能够帮你解决Elasticsearch 7.2.1 安装所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。