環境:
vmware
centos7
1、下載適合自己的es版本(集群安裝只需要改一個cluster.name引數就可以)
https://www.elastic.co/cn/downloads/past-releases/elasticsearch-7-10-1
2、由于我下載的是二進制包,因為從es7開始自帶了jdk,所以不需要單獨去安裝jdk了,直接解壓就可以使用
tar -xf elasticsearch-7.10.1-linux-x86_64.tar.gz
把解壓后的es移動到相應路徑就可以使用了
安裝es的head插件,因為es7的安裝方式不一樣,我安裝的是elasticsearch-head-master
https://github.com/mobz/elasticsearch-head
下載后進入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 &
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/265797.html
標籤:其他
上一篇:Linux 守護行程
