标签:virt script tor limits least 安装 roc amp _id
下载elasticsearch-6.2.4.tar.gz版本,并通过Xftp5上传到hadoop机器集群的第一个节点node1上的/opt/uploads/目录:
tar zxvf elasticsearch-6.2.4.tar.gz
mv elasticsearch-6.2.4 /opt/app/ && cd /opt/app/
sudo vi /etc/profile
添加如下内容:
export ELASTICSEARCH_HOME=/opt/app/elasticsearch-6.2.4
export PATH=:PATH:PATH:ELASTICSEARCH_HOME/bin
使环境变量生效:source /etc/profile
进入elasticSearch配置文件的目录,cd /opt/app/elasticsearch-6.2.4/conf/
修改elasticsearch.yml文件 vi elasticsearch.yml,将以下内容写入到elasticsearch.yml文件中
#集群名称,通过组播的方式通信,通过名称判断属于哪个集群
cluster.name: bigdata
#节点名称,要唯一
node.name: es-1
#数据存放位置
path.data: /opt/app/elasticsearch-6.2.4/data
#日志存放位置
path.logs: /opt/app/elasticsearch-6.2.4/logs
#es绑定的ip地址
network.host: hadoop1
#初始化时可进行选举的节点
discovery.zen.ping.unicast.hosts: ["hadoop1", "hadoop2", "hadoop3"]
注:配置文件elasticsearch.yml中的属性与属性值之间要有空格,否则会报错,如:
启动es时,报错信息如下:
scp -r /opt/app/elasticsearch-6.2.4/ hadoop@hadoop2:/opt/app/
scp -r /opt/app/elasticsearch-6.2.4/ hadoop@hadoop3:/opt/app/
然后hadoop2、hadoop3分别重复第3步骤,修改环境变量
hadoop2机器节点上修改elasticSearch的elasticsearch.yml配置文件
hadoop3机器节点上修改elasticSearch的elasticsearch.yml配置文件
elasticsearch -d
可能存在的启动异常:
ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
max number of threads [1802] for user [hadoop] is too low, increase to at least [4096]
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决max file descriptors和max number of threads这两个问题:
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
max number of threads [1802] for user [hadoop] is too low, increase to at least [4096]
修改limits.conf文件sudo vi /etc/security/limits.conf,添加如下内容:
* soft nofile 65536
* hard nofile 65536
* soft nproc 4096
* hard nproc 8192
说明:* soft nofile 65536、* hard nofile 65536对应解决max file descriptors [4096];* soft nproc 4096、* hard nproc 8192对应解决max number of threads [1802]。
修改完需要重启系统,limits.conf文件才能生效,可以通过ulimit -n来查看max file descriptors是否有改变
解决max number of threads问题
修改20-nproc.conf文件sudo vi /etc/security/limits.d/20-nproc.conf,添加如下内容:
* soft nproc 4096
root soft nproc unlimited
解决 max virtual memory问题:
修改sysctl.conf文件sudo vi /etc/sysctl.conf,添加如下内容:
vm.max_map_count=262144
修改完需要执行命令sudo sysctl -p,sysctl.conf文件才能生效
参考解决方法:https://blog.csdn.net/weini1111/article/details/60468068
参考修改/etc/security/limits.conf文件无效的解决方法:
https://blog.csdn.net/marco_90/article/details/45147319
https://blog.csdn.net/daxiang12092205/article/details/52100180
http://hadoop1:9200/
标签:virt script tor limits least 安装 roc amp _id
原文地址:https://www.cnblogs.com/momoyan/p/11616477.html