Centos 8 安装ES

操作系统 :CentOS Linux release 8.4.2105

最新es软件包官网地址:Download Elasticsearch Free | Get Started Now | Elastic | Elastic

部署流程:        

        1、JDK8以上环境安装

        2、Elasticsearch-7.4.2安装

1、下载:

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.4.2-linux-x86_64.tar.gz

2、解压文件

tar -zxvf  tar -zxvf elasticsearch-7.4.2-linux-x86_64.tar.gz

3、添加普通用户

        ES不允许root 用户直接运行

        添加用户:

sudo adduser test

        设置密码:

sudo passwd test
[root@localhost software]# suso adduser test
bash: suso: command not found...
[root@localhost software]# sudo adduser test
[root@localhost software]# sudo passwd test
Changing password for user test.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
 
  

4、文件权限修改

把elasticsearch目录的拥有者改为test用户(将目录的读写和执行权限全部授予给es用户)

sudo chown -R test /home/software/elasticsearch-7.4.2

        修改配置文件

                -Xms1g >> -Xms256m

                -Xmx1g >> -Xmx256m

## JVM configuration
​
################################################################
## IMPORTANT: JVM heap size
################################################################
##
## You should always set the min and max JVM heap
## size to the same value. For example, to set
## the heap to 4 GB, set:
##
## -Xms4g
## -Xmx4g
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
## for more information
##
################################################################
​
# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
​
-Xms256m
-Xmx256m
​
################################################################
## Expert settings
################################################################
##

 5、修改yml文件

                network.host: 0.0.0.0 (本机地址)

                http.port: 9200 (端口)

#bootstrap.memory_lock: true
​
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#

6、切换test用户

su test

7、启动

cd /home/software/elasticsearch-7.4.2/bin

./elasticsearch

你可能感兴趣的:(Centos,ElasticSearch,elasticsearch,centos)