|
環(huán)境: vmware centos7
1、下載適合自己的es版本(集群安裝只需要改一個(gè)cluster.name參數(shù)就可以)
https://www./cn/downloads/past-releases/elasticsearch-7-10-1 2、由于我下載的是二進(jìn)制包,因?yàn)閺膃s7開(kāi)始自帶了jdk,所以不需要單獨(dú)去安裝jdk了,直接解壓就可以使用 tar -xf elasticsearch-7.10.1-linux-x86_64.tar.gz 把解壓后的es移動(dòng)到相應(yīng)路徑就可以使用了 安裝es的head插件,因?yàn)閑s7的安裝方式不一樣,我安裝的是elasticsearch-head-master https://github.com/mobz/elasticsearch-head 下載后進(jìn)入elasticseach-head-master 下面我都在本文件夾里面執(zhí)行 新版的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"; 將目錄移動(dòng)到你的es安裝目錄里面,方便以后啟動(dòng),最后啟動(dòng)head npm run start
nohup npm run start(后臺(tái)啟動(dòng))
es啟動(dòng) 編輯/usr/lib/systemd/system/elasticsearch.service ,設(shè)置開(kāi)機(jī)自啟動(dòng) [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啟動(dòng)不能用root用戶,所以需要先創(chuàng)建es用戶 groupadd es
useradd es -g es
啟動(dòng)es并設(shè)置開(kāi)機(jī)自啟動(dòng) systemctl start elasticseach.service
systemctl enable elasticseach.service
最后在瀏覽器訪問(wèn): http://194.168.50.80:9200 head插件訪問(wèn)地址 http://194.168.50.80:9100
至此es7以及head插件安裝完畢!切記優(yōu)化jvm哦。。。。。 還有優(yōu)化/etc/sysctl.conf vm.max_map_count=524288 執(zhí)行sysctl -p生效
安裝監(jiān)控插件cerebro https://github.com/lmenezes/cerebro/releases unzip cerebro-0.8.4.zip cd cerebro-0.8.4/ nohup bin/cerebro >/dev/null &
|
|
|