本站和网页 http://www.bubuko.com/infodetail-3389629.html 的作者无关,不对其内容负责。快照谨为网络故障时之索引,不代表被搜索网站的即时页面。

centos7.7环境安装elasticsearch7.5.1集群-布布扣-bubuko.com
[首页] [文章] [教程]   首页 Web开发 Windows开发 编程语言 数据库技术 移动平台 系统服务 微信 设计 布布扣 其他 数据分析 > > 详细
centos7.7环境安装elasticsearch7.5.1集群
时间:
2020-01-20 20:04:51
     阅读:
486
     评论:
     收藏:
    
[点我收藏+]
centos7.6系统的elasticsearch7.5.1集群部署
整体策略:
将集群配置好,并且通过命令 curl 10.10.17.19:9200/_cluster/health?pretty 检查状态为green
然后再次修改配置文件启用xpack认证,并拷贝认证文件到各节点,重启集群的节点
1.配置新版本的elasticsearch使用自带的openjdk13
# vim bin/profile
export JAVA_HOME=/usr/local/elk/elasticsearch-7.5.1/jdk
export PATH=$JAVA_HOME/bin:$PATH
# 创建相关的日志和数据目录
mkdir -p /data/es/data
mkdir -p /data/es/logs
mkdir -p /data/esback
groupadd -g 1500 elasticsearch
useradd -u 1500 -g elasticsearch elasticsearch
swapoff -a
echo "fs.file-max = 1000000" >> /etc/sysctl.conf
echo "vm.max_map_count=262144" >> /etc/sysctl.conf
echo "vm.swappiness = 1" >> /etc/sysctl.conf
sysctl -p
sed -i ‘s/* soft nofile 65535/* soft nofile 655350/g‘ /etc/security/limits.conf
sed -i ‘s/* hard nofile 65535/* hard nofile 655350/g‘ /etc/security/limits.conf
sed -i ‘s#*          soft    nproc     4096##‘ /etc/security/limits.d/20-nproc.conf
chown -R elasticsearch.elasticsearch /data/es
chown -R elasticsearch.elasticsearch /data/esback
chown -R elasticsearch.elasticsearch /usr/local/elk/elasticsearch-7.5.1
# 主节点配置
[root@sz_ms_influenex_es_dev01_17_19 elasticsearch-7.5.1]# cat config/elasticsearch.yml
cluster.name: influenex_elk_uat
node.name: influenex_elk01
path.data: /data/es/data
path.logs: /data/es/logs
path.repo: ["/data/esback"]
bootstrap.memory_lock: true
network.host: 10.10.17.19
http.port: 9200
transport.tcp.port: 9300
node.master: true
node.data: true
discovery.seed_hosts: ["10.10.17.19:9300", "10.10.17.20:9300", "10.10.17.21:9300"]
cluster.initial_master_nodes: ["10.10.17.19"]
gateway.recover_after_nodes: 2
transport.tcp.compress: true
# 以下配置可以减少当es节点短时间宕机或重启时shards重新分布带来的磁盘io读写浪费
discovery.zen.fd.ping_timeout: 300s
discovery.zen.fd.ping_retries: 8
discovery.zen.fd.ping_interval: 30s
discovery.zen.ping_timeout: 180s
# 密码部分的配置最好等集群配置没有问题后再进行
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /usr/local/elk/elasticsearch-7.5.1/config/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /usr/local/elk/elasticsearch-7.5.1/config/elastic-certificates.p12
influenex_elk02
# 第二个节点配置
[elasticsearch@sz_ms_influenex_es_dev02_17_20 elasticsearch-7.5.1]$ cat config/elasticsearch.yml
node.name: influenex_elk02
network.host: 10.10.17.20
node.master: false
influenex_elk03 配置
[elasticsearch@sz_ms_influenex_es_dev03_17_21 elasticsearch-7.5.1]$ cat config/elasticsearch.yml
node.name: influenex_elk03
network.host: 10.10.17.21
[elasticsearch@sz_ms_influenex_es_dev01_17_19 elasticsearch-7.5.1]$ bin/elasticsearch-setup-passwords interactive
Initiating the setup of passwords for reserved users elastic,apm_system,kibana,logstash_system,beats_system,remote_monitoring_user.
You will be prompted to enter passwords as the process progresses.
Please confirm that you would like to continue [y/N]y
Enter password for [elastic]:
Reenter password for [elastic]:
Enter password for [apm_system]:
Reenter password for [apm_system]:
Enter password for [kibana]:
Reenter password for [kibana]:
Enter password for [logstash_system]:
Reenter password for [logstash_system]:
Enter password for [beats_system]:
Reenter password for [beats_system]:
Enter password for [remote_monitoring_user]:
Reenter password for [remote_monitoring_user]:
Changed password for user [apm_system]
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [beats_system]
Changed password for user [remote_monitoring_user]
Changed password for user [elastic]
# 检查集群的配置
[elasticsearch@sz_ms_influenex_es_dev01_17_19 elasticsearch-7.5.1]$ curl -u elastic:pass10.10.17.19:9200/_cluster/health?pretty
  "cluster_name" : "influenex_elk_uat",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 3,
  "number_of_data_nodes" : 3,
  "active_primary_shards" : 1,
  "active_shards" : 2,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
原文:https://www.cnblogs.com/reblue520/p/12219116.html
举报
评论
一句话评论(
登录后才能评论!
分享档案
更多>
2021年09月23日
(328)
2021年09月24日
(313)
2021年09月17日
(191)
2021年09月15日
(369)
2021年09月16日
(411)
2021年09月13日
(439)
2021年09月11日
(398)
2021年09月12日
(393)
2021年09月10日
(160)
2021年09月08日
(222)
最新文章
">更多>
2021/09/28 scripts
2022-05-27
vue自定义全局指令v-emoji限制input输入表情和特殊字符
9.26学习总结
vim操作
深入理解计算机基础 第三章
C++ string 作为形参与引用传递(转)
python 加解密
JavaScript-对象数组里根据id获取name,对象可能有children属性
SQL语句——保持现有内容在后面增加内容
virsh命令文档
教程昨日排行
1.
list.reverse()
2.
Django Admin 管理工具
3.
AppML 案例模型
4.
HTML 标签列表(功能排序)
5.
HTML 颜色名
6.
HTML 语言代码
7.
jQuery 事件
8.
jEasyUI 创建分割按钮
9.
jEasyUI 创建复杂布局
10.
jEasyUI 创建简单窗口
友情链接
汇智网
  
PHP教程
插件网
王者荣耀
刺激战场
金铲铲
冰封王座
魔兽世界
哔哩哔哩
狼人杀
元神
-->
关于我们
联系我们
留言反馈
- 联系我们:wmxa8@hotmail.com
© 2014
bubuko.com
版权所有
打开技术之扣,分享程序人生!