The elasticsearch learning path---install and start elasticsearch under Linux

1. Go to the elastic official website to download elasticsearch  and click to open the link , select tar, right-click to copy the link

2. Enter the command line and input: wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.3.tar.gz Download to the current directory

3. Enter the command: tar -vxf elasticsearch-6.2.3.tar.gz to decompress, the elasticsearch-6.2.3 file will be generated at this time

4. Enter: vi elasticsearch-6.2.3/config/jvm.options to modify the two values ​​of Xms1g and Xmx1g, I modified Xms512m and Xmx512m, if your memory is large enough, you don’t need to modify

5. Then enter the bin folder and enter: ./elasticsearch to start


If the above error occurs, it means that the root user cannot be used to start, then we need to change to a common user

6. Create a user: Enter: useradd elastic

7. Enter su elastic to log in to the elastic user

8. Enter the elasticsearch-6.2.3 bin directory and enter ./elasticsearch to start elastic


If the above error occurs, the user elastic has insufficient permissions. At this time, we can enter ls -l to view, and we will find that the permissions of elasticsearch are root root, so we need to add permissions for the elastic user at this time.

9. Switch to the root user and go back to the parent directory of the elasticsearch-6.2.3 folder to execute the command: chown elastic elasticsearch-6.2.3 -R

10. Switch to the elastic user and enter the elasticsearch-6.2.3 bin directory and enter: ./elasticsearch to start elasticsearch


As shown in the figure: At this point we can see that elasticSearch has been successfully started, we can enter 127.0.0.1:9200 in the browser for a verification


As shown in the figure: the startup is successful

11. Stop the service: press Ctrl+c; then refresh the browser and it is no longer displayed, indicating that the service has stopped

12. Start elasticsearch in the background, enter: ./elasticsearch -d to start elasticsearch; after a while, you can go to the browser for verification, or enter

    ps aux|grep elasticsearch command to query


Started successfully!

It's simple and rude. If there is something wrong, you are welcome to put forward your opinions and discuss together!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325979019&siteId=291194637