Elasticsearch6.2.4 rpm安裝
阿新 • • 發佈:2018-12-17
[[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]lhost 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