Linux install Elasticsearch

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.x.x-linux-x86_64.tar.gz
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.x.x-linux-x86_64.tar.gz.sha512
shasum -a 512 -c elasticsearch-7.x.x-linux-x86_64.tar.gz.sha512
tar -xzf elasticsearch-7.x.x-linux-x86_64.tar.gz
cd elasticsearch-7.x.x/

Note:

If the download speed is slow, find a domestic mirror instead

Starting from 5.x, the security level of ElasticSearch has been improved, and it is not allowed to start with the root account, so we need to add a user, and switch the user after creation

1 Create elasticsearch user group (can be omitted)

root@localhost ~]# groupadd elasticsearch

2 Create user es and set the password to es

[root@localhost ~]# useradd es
[root@localhost ~]# passwd es

3 User es is added to the elasticsearch user group (can be omitted)

[root@localhost ~]# usermod -G elasticsearch es

4 Set sudo permissions (can be omitted)

[root@localhost ~]# visudo

Below the line root ALL=(ALL) ALL
Add es user as follows:

es ALL=(ALL) ALL

5 Switch to es user operation after adding successfully and saving

[root@localhost ~]# su es
[es@localhost root]# cd /xx/xx/es/bin #For the es directory
[es@localhost bin]# ./elasticsearch -d #start

-An error was reported during elasticsearch startup [1]

ERROR: [1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
[2019-06-03T07:05:44,761][INFO ][o.e.n.Node] [hz] stopping ...
[2019-06-03T07:05:44,788][INFO ][o.e.n.Node] [hz] stopped
[2019-06-03T07:05:44,788][INFO ][o.e.n.Node] [hz] closing ...
[2019-06-03T07:05:44,801][INFO ][o.e.n.Node] [hz] closed
[2019-06-03T07:05:44,804][INFO ][o.e.x.m.p.NativeController] [hz] Native controller process has stopped-no new native processes can be started

Solution

Modify the config/elasticsearch.yml, release the node.name comment, you can change the name
node.name: node-1

-An error was reported during elasticsearch startup [2]

ERROR: [1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

Solution

#ip replace host1, etc., for multiple nodes, please add multiple ip addresses, single node can be written by default
#Configure the following three, at least one
#[discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes]
cluster.initial_master_nodes: ["node-1"] #Here node-1 is the value configured for node-name

Cannot access elasticsearch through external ip

Solution

#Modify config/elasticsearch.yml, modify it to the current es address or 0.0.0.0
network.host: 0.0.0.0

Failed to clear cache for realms [[]]

There is no solution yet. Someone has raised an issue on the official github


[status][plugin:spaces@7.1.1] Status changed from yellow to green-Ready

This problem will only appear in the single ELK, no need to bother


max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

Solution:

Temporary solution: switch root user and execute the following command

sysctl -w vm.max_map_count=262144

Permanent solution: add a line at the end of the /etc/sysctl.conf file

vm.max_map_count=262144
sysctl -p #Make the modification effective immediately

View the modified results:

sysctl -a|grep vm.max_map_count

display:

vm.max_map_count = 262144

ERROR: bootstrap checks failed
memory locking requested for elasticsearch process but memory is not locked

This is because the locked memory parameter bootstrap.memory_lock=true is set

Report memory overflow processing

The default heap size setting in the /config/jvm.options file

 -Xms1g
 -Xmx1g

Just adjust it small (the memory is large enough, then increase it. It is recommended to be half of the server memory)

 -Xms108m
 -Xmx108m
点赞(1)

评论列表 共有 0 评论

暂无评论

微信服务号

微信客服

淘宝店铺

support@elephdev.com

发表
评论
Go
顶部