日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

安装elasticsearch5.4.1集群和head插件

發(fā)布時間:2025/3/15 编程问答 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 安装elasticsearch5.4.1集群和head插件 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

這里用的系統(tǒng)版本是CentOS6.6。

192.168.3.56 ES01 192.168.3.49 ES02 192.168.3.57 ES03

1、為三個節(jié)點安裝java環(huán)境

# yum install -y java java-1.8.0-openjdk-devel # vim /etc/profile.d/java.sh export JAVA_HOME=/usr # source /etc/profile.d/java.sh

2、同步時間

# ntpdate pool.ntp.org

3、上官網(wǎng)下載rpm包,或者按照guide設置官方repo,分別為三個節(jié)點安裝ES

# yum install -y elasticsearch-5.4.1.rpm

https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html

4、修改配置文件

節(jié)點1,ES01:

# vim /etc/elasticsearch/elasticsearch.yml cluster.name: oupenges node.name: es01 bootstrap.system_call_filter: false http.cors.enabled: true http.cors.allow-origin: "*" bootstrap.memory_lock: true network.host: 192.168.3.56 discovery.zen.ping.unicast.hosts: ["192.168.3.56", "192.168.3.49", "192.168.3.57"]

節(jié)點2,ES02:

# vim /etc/elasticsearch/elasticsearch.yml cluster.name: oupenges node.name: es02 bootstrap.system_call_filter: false http.cors.enabled: true http.cors.allow-origin: "*" bootstrap.memory_lock: true network.host: 192.168.3.49 discovery.zen.ping.unicast.hosts: ["192.168.3.56", "192.168.3.49", "192.168.3.57"]

節(jié)點3,ES03:

# vim /etc/elasticsearch/elasticsearch.yml cluster.name: oupenges node.name: es03 bootstrap.system_call_filter: false http.cors.enabled: true http.cors.allow-origin: "*" bootstrap.memory_lock: true network.host: 192.168.3.57 discovery.zen.ping.unicast.hosts: ["192.168.3.56", "192.168.3.49", "192.168.3.57"]

兩個http參數(shù)的含義可以參考這里:
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-http.html

5、修改limits.conf,系統(tǒng)默認的1024太小,這里需要至少2048才能啟動服務

# vim /etc/security/limits.conf * hard nofile 65536 * soft nofile 65536 * hard memlock unlimited * soft memlock unlimited elasticsearch hard nproc 514834 elasticsearch soft nproc 514834

https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-system-settings.html#limits.conf
https://www.elastic.co/guide/en/elasticsearch/reference/current/_memory_lock_check.html

6、啟動服務

# service elasticsearch start # chkconfig elasticsearch on

7、通過cluster API查看集群狀態(tài):

# curl -XGET 'http://192.168.3.56:9200/_cluster/health?pretty=true' {"cluster_name" : "oupenges","status" : "green","timed_out" : false,"number_of_nodes" : 3,"number_of_data_nodes" : 3,"active_primary_shards" : 71,"active_shards" : 142,"relocating_shards" : 0,"initializing_shards" : 0,"unassigned_shards" : 0,"delayed_unassigned_shards" : 0,"number_of_pending_tasks" : 0,"number_of_in_flight_fetch" : 0,"task_max_waiting_in_queue_millis" : 0,"active_shards_percent_as_number" : 100.0 }

8、安裝head插件(需要事先安裝nodejs和phantomjs,這里只說一下phantomjs)

安裝phantomjs:

# wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 # tar xvf phantomjs-2.1.1-linux-x86_64.tar.bz2 # cd phantomjs-2.1.1-linux-x86_64/ # ln -sv /root/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/bin/

運行head:

# git clone https://github.com/mobz/elasticsearch-head.git # cd elasticsearch-head/# npm install # nohup npm run start &

默認監(jiān)聽9100端口,用瀏覽器訪問:http://192.168.3.56:9100/

轉(zhuǎn)載于:https://www.cnblogs.com/keithtt/p/7058958.html

總結(jié)

以上是生活随笔為你收集整理的安装elasticsearch5.4.1集群和head插件的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。