Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Simple elasticsearch server construction

Shulou Source: shulou.com Published: 2022-06-03 06:48:26 11月23日 Update

1: download and decompress:

Wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.2.tar.gz

2: configure config/elasticsearch.yml

Network.host: 10.99.32.16

Http.port: 9200

Path.logs: / root/elasticsearch/log

Path.data: / root/elasticsearch/data

Node.name: node-1

Cluster.name: mycluster

Discovery.zen.ping.unicast.hosts: ["10.99.32.16", "10.99.32.17", "10.99.32.18"]

Discovery.zen.minimum_master_nodes: 2

Bootstrap.memory_lock: true

3: configure config/jvm.options

4: configure some system kernel parameters:

Can not run elasticsearch as root:

You cannot use a root user to operate. You need to create a user and change the owner of the original directory to that user.

Adduser myuser

Passwd myuser

Chown-R myuser / mypath

Max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

Modify / etc/security/limits.conf

Add: elastic hard nofile 65536

Max file size [67107840] for user [elastic] is too low, increase to [unlimited]

Modify / etc/security/limits.conf

Elastic soft fsize unlimited

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

Solution: sysctl-w vm.max_map_count=262144

5: run:

Bin/elasticsearch

Background operation: bin/elasticsearch-d-p pidFile

A pidFile file is generated to record the pid

As the system starts:

Sudo / bin/systemctl daemon-reload

Sudo / bin/systemctl enable elasticsearch.service

Tags: User configuration system run kernel parameter background owner file directory generation server easy service Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Huawei Shulou Technology Apple MariaDB