ES 6.7.2 集群搭建记录

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.2.tar.gz
tar -xvf elasticsearch-6.7.2.tar.gz

cat /etc/hosts
192.168.100.77    NJ100077 node-10077
192.168.100.78    NJ100078 node-10078
192.168.100.79    NJ100079 node-10079

# cat /data/elasticsearch-6.7.2/config/elasticsearch.yml |grep -v "^#"
cluster.name: flink-es
node.name: node-10078
network.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: ["node-10077", "node-10078","node-10079"]
discovery.zen.minimum_master_nodes: 2

#----登陆验证
xpack.security.enabled: true
http.cors.enabled: true
http.cors.allow-origin: '*'
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type

添加登陆验证 
启用trial license
curl -H "Content-Type:application/json"  -XPOST  http://192.168.100.78:9200/_xpack/license/start_trial?acknowledge=true

设置密码
./bin/elasticsearch-setup-passwords interactive

修改密码
curl -H "Content-Type:application/json" -XPOST -u elastic 'http://192.168.100.78:9200/_xpack/security/user/elastic/_password' -d '{ "password" : "123456" }'

elasticsearch.yml中开启安全验证配置
xpack.security.enabled: true

head插件访问
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type

======
遇到的问题处理:
1,es需用普通用户启动
2,报错    [1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
解 #vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536    
3,[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解 #vim /etc/sysctl.conf
vm.max_map_count=655360
#sysctl -p
 

你可能感兴趣的:(工作日常)