Linux下安装部署ElasticSearch

13 篇文章 0 订阅

系统:CentOS Linux release 7.7.1908 (Core)

软件:elasticsearch-7.9.2

安装步骤

mkdir -p /usr/local/soft/package
cd /usr/local/soft/package
#下载安装包,解压
wget https://mirrors.huaweicloud.com/elasticsearch/7.9.2/elasticsearch-7.9.2-linux-x86_64.tar.gz
tar -xzvf elasticsearch-7.9.2-linux-x86_64.tar.gz
mv elasticsearch-7.9.2 ..
cd ../elasticsearch-7.9.2
#不允许使用root启动 为elasticsearch添加用户
useradd es -p 密码
chown es:es -R /usr/local/soft/elasticsearch-7.9.2
su es
cd /usr/local/soft/elasticsearch-7.9.2/bin
#直接启动
#./elasticsearch
#后台启动
./elasticsearch -d
#查看日志
tail -f /usr/local/soft/elasticsearch-7.9.2/logs/elasticsearch.log

启动报错处理:

#报错日志 max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
#处理 vim /etc/security/limits.conf文件,添加以以下两行
* soft nofile 65535
* hard nofile 65535

#报错日志 max number of threads [3818] for user [admin] is too low, increase to at least [4096]
#处理 vim /etc/security/limits.conf文件,添加以下两行
* soft nproc  4096
* hard nproc  4096

#报错日志 max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
#临时生效处理 重启服务器失效
sysctl -w vm.max_map_count=262144
#永久生效处理 vim /etc/sysctl.conf 文件,添加以下一行
vm.max_map_count=262144

#报错日志 the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
#处理 vim /usr/local/soft/elasticsearch-7.9.2/config/elasticsearch.yml 文件,添加以下行
cluster.initial_master_nodes: ["node-1"]

允许外网访问:

vim /usr/local/soft/elasticsearch-7.9.2/config/elasticsearch.yml
#添加以下内容:
'''
network.host: 0.0.0.0
#如果需要修改端口
http.port: 9200
'''
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值