ELK----elasticsearch7.10.1安裝配置

環境:node

vmwarelinux

centos7git

 

一、下載適合本身的es版本(集羣安裝只須要改一個cluster.name參數就能夠)github

 

 

https://www.elastic.co/cn/downloads/past-releases/elasticsearch-7-10-1npm

二、因爲我下載的是二進制包,由於從es7開始自帶了jdk,因此不須要單獨去安裝jdk了,直接解壓就能夠使用centos

tar -xf elasticsearch-7.10.1-linux-x86_64.tar.gz 瀏覽器

把解壓後的es移動到相應路徑就能夠使用了bash

安裝es的head插件,由於es7的安裝方式不同,我安裝的是elasticsearch-head-masterapp

https://github.com/mobz/elasticsearch-headcurl

下載後進入elasticseach-head-master

下面我都在本文件夾裏面執行

新版的head插件須要nodejs支持,因此安裝nodejs

curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -

yum install -y nodejs

查看nodejs是否安裝成功

node -v

npm -v

安裝grunt

npm install -g grunt-cli

npm install

修改Gruntfile.js,添加hostname: '0.0.0.0'

server: {
    options: {
        hostname: '0.0.0.0',
        port: 9100,
        base: '.',
        keepalive: true
    }
}            

修改_site/app.js,將this.prefs.get("app-base_uri") || "localhost:9200"

this._super();
this.prefs = services.Preferences.instance();
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.25.180:9200";

將目錄移動到你的es安裝目錄裏面,方便之後啓動,最後啓動head

npm run start           
nohup npm run start(後臺啓動)

 

es啓動

編輯/usr/lib/systemd/system/elasticsearch.service ,設置開機自啓動

[Unit]
Description=The elasticsearch Application Platform
After=syslog.target network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/usr/local/elasticsearch/es.pid
ExecStart=/usr/local/elasticsearch/bin/elasticsearch -d -p /usr/local/elasticsearch/es.pid
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
User=es
Group=es
LimitNOFILE=65535
LimitNPROC=65535
LimitAS=infinity
LimitFSIZE=infinity
TimeoutStopSec=0
KillSignal=SIGTERM
KillMode=process
SendSIGKILL=no
SuccessExitStatus=143
TimeoutStartSec=75
[Install]
WantedBy=multi-user.target

注意:es啓動不能用root用戶,因此須要先建立es用戶

groupadd es
useradd es -g es

啓動es並設置開機自啓動

systemctl start elasticseach.service
systemctl enable elasticseach.service

最後在瀏覽器訪問:

http://194.168.50.80:9200

head插件訪問地址

http://194.168.50.80:9100

 

至此es7以及head插件安裝完畢!切記優化jvm哦。。。。。

還有優化/etc/sysctl.conf

vm.max_map_count=524288

執行sysctl -p生效

 

安裝監控插件cerebro

https://github.com/lmenezes/cerebro/releases
unzip cerebro-0.8.4.zip
cd cerebro-0.8.4/
nohup bin/cerebro >/dev/null &
相關文章
相關標籤/搜索