In the process of starting to access ES encountered a variety of wonderful problems.
1. On-line various versions of the start-up mode is confusing to know how to start. Simple and rude--execute directly in the bin directory of ES
./elasticsearch//display start, CTRL + C can stop, such as to operate, change the terminal./elasticsearch-d background boot, can continue operation at the current terminal//background start, such as to stop the execution of kill-9 PID //Haha, Direct kill process//Search ES process pid can jiangzi PS aux | grep elasticsearch//Note, not sure that is the PID words more execute several times this command, see the execution results of the same number is the same ~
You'll see Jiangzi's message when you're successful.
and test it.
Curl ' http://localhost:9200 '
In normal words, the output of Jiangzi will appear.
OK, so far all normal, and then use IP access to the words do not pass. I this is a virtual machine, I can ping the virtual machine in this machine, but unable to access ES, in the virtual machine with IP access is not, hint connection refused.
Specific error See picture:
Workaround: Locate the elasticsearch.yml file for the Config folder of es, edit
Vim Config/elasticsearch.yml
Find Network.host, colon: followed by a space, and then changed to 0.0.0.0
And then take the first # off, #是注释的意思最终变成酱紫
Referenced here from: Http://www.jianshu.com/p/658961f707d8 Thank you to the author for the love of running Mia
OK, restart ES after saving
Well, there may be an error. Common, such as
ERROR: [2] Bootstrap checks failed[1]: Max file descriptors [4096] for Elasticsearch process was too low, increase to at Le AST [65536][2]: Max virtual memory Areas Vm.max_map_count [65530] is too low, increase to at least [262144]
Generally appear in these locations
Max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] workaround referenced here from: http://blog.c sdn.net/u012371450/article/details/51776505 thanks to the original author for sharing valuable experience
Open another terminal with root operation//Enter the password .... [Email protected] ~]# cp/etc/security/limits.conf/etc/security/limits.conf.bak[[email protected] ~]# cat/etc/ security/limits.conf | Grep-v "Esadmin" >/tmp/system_limits.conf[[email protected] ~]# echo "Esadmin hard nofile 65536" >>/tmp/system _limits.conf [[email protected] ~]# echo "Esadmin soft nofile 65536" >>/tmp/system_limits.conf [[email protected] ~ ]# mv/tmp/system_limits.conf/etc/security/limits.conf
Remember to change to your ES username, my esadmin
Finally ask if you want to save, enter Yes
Then, after you execute the ES user terminal, exit your ES user and then re-enter. Otherwise the change will not take effect!
For example Su root//enter the password ... su esadmin
and then verify
Ulimit-hn
65536//output This is even right.
Max virtual Memory Areas Vm.max_map_count [65530] likely too low, increase to at least [262144] workaround referenced here from: HTTP://WWW.CNBL Ogs.com/sloveling/p/elasticsearch.html. Thanks to the original author for sharing valuable experience
Switch to the root user to modify the configuration sysctl.confvi/etc/sysctl.conf add the following configuration: vm.max_map_count=655360 and execute the command: sysctl-p then, restart Elasticsearch, can start successfully.
OK, now restart ES, if successful, the basic is done.
Accessed separately with localhost and IP.
Haha, es! You,know,for Search!
Learning Elasticsearch (i) Linux environment Construction (2)--Start Elasticsearch