2-【centOS安装elasticsearch-7.17.0】

2.1下载elasticsearch

sudo wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.0-linux-x86_64.tar.gz

2.2.解压

sudo tar -xvf elasticsearch-7.17.0-linux-x86_64.tar.gz

2.3授权

sudo chmod -R 777 elasticsearch-7.17.0

2.4修改配置文件

vim elasticsearch-7.17.0/config/jvm.options

es启动使用内存大小,最好不要超过服务器总内存数的一半
-Xms6g
-Xmx6g

vim elasticsearch-7.17.0/config/elasticsearch.yml

cluster.name: my-application
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
network.publish_host: 192.168.10.xxx
<集群必须配置>
discovery.zen.ping.unicast.hosts: [“192.168.10.xxx:9300”,“192.168.10.xxx:9300”]
cluster.initial_master_nodes: [“node-1”, “node-2”]
http.cors.enabled: true
http.cors.allow-origin: “*”
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
thread_pool.search.size: 96
thread_pool.search.queue_size: 1200

2.5修改系统文件权限

sudo vim /etc/security/limits.conf
增加如下配置

  • soft nproc 65536

  • hard nproc 65536

  • soft nofile 65536

  • hard nofile 65536

sudo vim /etc/sysctl.conf
增加如下配置
vm.max_map_count=262144
生效
sudo sysctl -p

2.6关闭防火墙

sudo systemctl stop firewalld.service

2.7启动elasticsearch

./bin/elasticsearch -d

2.8验证集群状态

http://ip:9200/_cluster/health?pretty=true
curl -XGET “http://ip:9200/_cluster/health?pretty=true”

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值