1、安装es
官网下载链接
https://www.elastic.co/downloads/past-releases
选择版本
Elasticsearch6.2.4 rpm安装
Elasticsearch6.2.4 rpm安装
将下载的rpm包放入系统中

[[email protected] software]$ sudo rpm -ivh elasticsearch-6.2.4.rpm 
warning: elasticsearch-6.2.4.rpm: Header V4 RSA/SHA512 Signature, key ID d88e42b4: NOKEY
Preparing...                          ################################# [100%]
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Updating / installing...
   1:elasticsearch-0:6.2.4-1          ################################# [100%]
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
 sudo systemctl daemon-reload
 sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
 sudo systemctl start elasticsearch.service

2、修改用户和文件配置


[[email protected] software]$ sudo chown -R lyk:lyk /etc/elasticsearch/
[[email protected] software]$ sudo chown -R lyk:lyk /usr/share/elasticsearch
[[email protected] system]$ sudo chown -R lyk:lyk /usr/lib/systemd/system/elasticsearch.service
[[email protected] run]# chown -R lyk:lyk /var/run/elasticsearch/
[[email protected] run]# chown -R lyk:lyk /etc/sysconfig/elasticsearch
修改文件elasticsearch.service中的用户组和用户
User=lyk
Group=lyk

3、装置服务

[[email protected] run]# sudo systemctl daemon-reload
[[email protected] run]# sudo systemctl enable elasticsearch.service
Created symlink from /etc/systemd/system/multi-user.target.wants/elasticsearch.service to /usr/lib/systemd/system/elasticsearch.service.
查看
cd /etc/systemd/system/multi-user.target.wants/

4、修改系统参数

vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096

vi /etc/sysctl.conf
vm.max_map_count=655360

5、修改配置文件:记得修改data和log文件的权限

# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#数据存放目录
path.data: /var/lib/elasticsearch
#
# Path to log files:
#日志存放目录
path.logs: /var/log/elasticsearch
# Set the bind address to a specific IP (IPv4 or IPv6):
#自己的ip
network.host: 192.168.232.6
#
# Set a custom port for HTTP:
#访问端口
http.port: 9200

6、启动

sudo systemctl start elasticsearch.service

相关文章:

  • 2021-05-13
  • 2021-07-03
  • 2021-07-05
  • 2021-11-29
  • 2021-07-10
  • 2021-12-20
  • 2021-07-23
  • 2021-07-09
猜你喜欢
  • 2021-09-08
  • 2021-09-26
  • 2022-12-23
  • 2021-08-03
  • 2021-08-04
  • 2021-08-16
相关资源
相似解决方案