ElasticSearch 安装及集群的部署配置

ElasticSearch安装
  • 使用ES软件安装
[root@centos7 download]# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.13.3-linux-x86_64.tar.gz
[root@centos7 download]# tar -zxvf elasticsearch-7.13.3-linux-x86_64.tar.gz -C <软件目录路径>
  • 使用Yum源安装ES
    下载安装ES公用Key
[root@centos7 download]# rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
创建elasticsearch yum源文件并安装elasticsearch
[root@CentOS-7 ~]# vim /etc/yum.repos.d/es.repo
[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md

[root@CentOS-7 ~]# yum install --enablerepo=elasticsearch elasticsearch -y
配置ES集群
ES集群配置
[root@centos7 elasticsearch]# cat elasticsearch.yml  |grep -v '^#'
# 定义ES集群名称
cluster.name: my-esCluster
# 配置集群内同时启动的数据任务个数(默认值:2)
cluster.routing.allocation.cluster_concurrent_rebalance: 16
# 配置添加或删除节点及负载均衡时并发恢复的线程个数(默认值:4)
cluster.routing.allocation.node_concurrent_recoveries: 16
# 配置初始化数据恢复时并发恢复线程的个数(默认值:4)
cluster.routing.allocation.node_initial_primaries_recoveries: 16
# 配置ES节点名称
node.name: <ES节点名称>
# 配置是否可以升级为主节点
node.master: true
node.data: true
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
# 配置节点的IP地址或主机名称
network.host: <ip> or <hostname>
# 配置ES节点的服务端口
http.port: 9200
transport.tcp.port: 9300
# 配置ES集群的节点发现
discovery.seed_hosts: ["es-hostname:9300", "es-hostname:9300"]
# 配置初始化一个新集群时选举的集群的Master
cluster.initial_master_nodes: ["node-01","node-02",..]
network.tcp.keep_alive: true
network.tcp.no_delay: true
transport.tcp.compress: true
# 配置ES集群的跨域访问
http.cors.allow-origin: "*"
http.cors.enabled: true
http.max_content_length: 200mb
Linux系统相关配置

修改 /etc/security/limits.conf 添加如下内容:

elasticsearch  soft    nofile  65536
elasticsearch  hard    nofile  65536

修改 /etc/security/limits.d/20-nproc.conf 添加加配置如下:

*          hard    nproc     4096
elasticsearch   soft    nofile  65536
elasticsearch   hard    nofile  65536

修改 /etc/sysctl.conf 添加加如下配置:

 vm.max_map_count=655360 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值