elasticsearch-7.4.2 environment to build

Basic environment: vm virtual machine Centos7

Extracting installation package

 

Create a non-root user, as users start elasticsearch

Creating user groups groupadd esgroup
create a user useradd estest -g esgroup -p 123456
grant privileges chown -R estest: esgroup elasticsearch-7.4.2 ( username: Group es directory)

 

Profiles

... / elasticsearch-7.4.2 / config / vi elasticsearch.yml
add the following
cluster.name: "Docker-Cluster"
network.host: 0.0.0.0


Custom config #
node.name: "the Node-1"
discovery.seed_hosts: [ "127.0.0.1", "[:: 1]"]
cluster.initial_master_nodes: [ "the Node-1"]
# turn support cross-domain access, the default is false
http.cors.enabled: to true
# allow cross-domain access domain address, (allow all domain names) than using regular
http.cors.allow-origin: /.*/

 

start up

Test
http://127.0.0.1:9200/ internal access test
http: // ip: 9200 / test external access

 

failed to activate:

1. Check your firewall and turn off the firewall
systemctl stop firewalld.service # Stop firewall
systemctl disable firewalld.service # prohibit firewall startup
firewall-cmd --state # View firewall status, whether it is running
firewall restart firewall-cmd --reload #

2. modify the configuration
vi /etc/security/limits.conf

Username hard nofile 65536
Username soft nofile 65536

vi /etc/sysctl.conf
vm.max_map_count = 655360
sysctl -p

After modification test again

 

ps: Common linux command

Close method: Enter the command: ps -ef | grep elasticsearch, find the process, then kill off;
startup method: enter the command: su elastic, then enter ./bin/elasticserach -d 

Port occupancy
netstat -tlnp | grep 5601
the kill -9

 

Guess you like

Origin www.cnblogs.com/guochaolang/p/12031034.html