ElasticSearch安裝和使用


https://elasticsearch.cn/download/

 

 

 或者

 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.0.rpm

 

 

 

 

 

[root@localhost bin]# pwd
/usr/share/elasticsearch/bin
[root@localhost bin]# ll
總用量 20
-rwxr-xr-x 1 root root 1523 11月 11 2017 elasticsearch
-rwxr-xr-x 1 root root 1893 11月 11 2017 elasticsearch-env
-rwxr-xr-x 1 root root  239 11月 11 2017 elasticsearch-keystore
-rwxr-xr-x 1 root root  229 11月 11 2017 elasticsearch-plugin
-rwxr-xr-x 1 root root  242 11月 11 2017 elasticsearch-translog

 

[root@localhost share]# su elasticsearch/
su: user elasticsearch/ does not exist
[root@localhost share]# su elasticsearch
This account is currently not available.
[root@localhost share]# cat /etc/passwd |grep elasticsearch
elasticsearch:x:989:984:elasticsearch user:/home/elasticsearch:/sbin/nologin

 

 

今天在一台新服務器下切換用戶的時候出現“This account is currently not available”錯誤
上網檢索了一 下發現是用戶的shell禁止登錄的問題

解決辦法:
比如我是 su elasticsearch的時候出現的問題
用cat看看 apache的帳號信息
# cat /etc/passwd | grep apache
發現它的shell是“/sbin /nologin”,需要改成“/bin/bash”
# vi /etc/passwd
修改完畢后,保存退出

這 樣再 su elasticsearch就可以很容易進去了

 

elasticsearch:x:989:984:elasticsearch user:/home/elasticsearch:/bin/bash

 

 

groupadd elasticsearch
useradd -g elasticsearch elasticsearch
chown -R elasticsearch:eelasticsearchla /usr/local/elasticsearch
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/

 

啟動錯誤收集:
    錯誤一:max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
    解決:
修改/etc/security/limits.conf文件

*               soft    nofile          85536
*               soft    nproc           85536
*               hard    nofile          85536
*               hard    nproc           85536
*                -      nofile          85536
elasticsearch   sfot    nofile          100000
elasticsearch   hard    nofile          100000


vim /etc/sysctl.conf

vm.max_map_count=655360
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.tcp_tw_reuse = 1
fs.file-max = 65536
net.ipv4.tcp_syncookies = 0
net.ipv4.tcp_orphan_retries = 1
net.ipv4.tcp_fin_timeout = 25
net.ipv4.tcp_max_orphans = 8192
net.ipv4.ip_local_port_range = 32768    61000

sysctl -p



vim /etc/security/limits.d/20-nproc.conf

*          soft    nproc     85536
*          hard    nproc     85536
root       soft    nproc     unlimited

vi /etc/ssh/sshd_config

將# UseLogin no

UseLogin yes

重啟sshd服務

 

 

切換到  elasticsearch 運行

su elasticsearch
cd /usr/share/elasticsearch/bin/
./elasticsearch -Ehttp.port=8200 -Epath.data=node2

 

 

http://192.168.2.245:7200/_cat/nodes?v

ip            heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
192.168.2.245           21          96  10    0.11    0.17     0.13 mdi       -      bIjFGK8
192.168.2.245           17          96  10    0.11    0.17     0.13 mdi       -      c_Slakt
192.168.2.245           24          96   6    0.11    0.17     0.13 mdi       *      y4pYif7

 

 

kibana安裝和使用

下載地址:https://elasticsearch.cn/download/

 

 

 tar -zxvf ./kibana-6.0.0-linux-x86_64.tar.gz

 cd kibana-6.0.0-linux-x86_64/

vim kibana.yml

如果要外網可以訪問:

server.host: "0.0.0.0"

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM