elastic+ kibana + x-pack破解,親測可行
版本資訊:elasticsearch-5.0.2、kibana-5.0.2-x86_64.rpm、x-pack-5.0.2.zip
操作資訊:CentOS Linux release 7.3.1611 (Core)
1. jdk安裝
cat /etc/profile export JAVA_HOME=/usr/bin/java export CLASSPATH=.:${JAVA_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH
2.系統配置:關閉selinux、防火牆
cat /etc/security/limits.conf * soft nofile 1024000* hard nofile 1024000 * soft memlock unlimited * hard memlock unlimited cat /etc/sysctl.conf vm.max_map_count=262144
3. elastic不能使用root使用者
groupadd elastic
useradd -d /home/elastic -g elastic -p elastic elastic
4. elastic安裝
tar xf elasticsearch-5.0.2.tar.gz -C /home/elstatic/
cat /home/elastic/elasticsearch-5.0.2/config/elasticsearch.yml http.cors.enabled: true http.cors.allow-origin: /.*/ http.cors.allow-credentials: true bootstrap.memory_lock: true cluster.name: es-jhl-1 node.name: es-jhl-node2 node.master: true node.data: true network.host: 0.0.0.0 http.port: 9202 discovery.zen.ping.unicast.hosts: ["192.168.171.251:9300", "192.168.171.252:9300", "192.168.171.253:9300"] discovery.zen.minimum_master_nodes: 2 path.data: /data/elasticsearch
4.安裝kibana
rpm -ivh kibana-5.0.2-x86_64.rpm
修改
/etc/kibana/kibana.yml
server.port: 5601
server.host: "192.168.10.41"
elasticsearch.url: "http://192.168.10.41:9200"
5. x-pack-5.0.2.zip已替換驗證檔案,後續可直接用普通lisense修改後,更改lisense,所有節點都要安裝外掛
su - elastic
/home/elastic/elasticsearch-5.0.2/bin/elasticsearch-plugin install file:///home/elasticsearch/x-pack-5.0.2.zip
修改config/elasticsearch.yml,新增:
xpack.security.audit.enabled: false
到elasticsearch-5.0.2/bin/x-pack/目錄下執行(只需要在一個節點執行)
./syskeygen 生產祕鑰檔案/home/elastic/elasticsearch-5.0.2/config/x-pack/system_key
將此檔案複製到其他節點相同目錄。
重啟所有節點elastic服務
6.
官網申請的普通版license檔案修改:
"type":"platinum" //修改為白金版
"expiry_date_in_millis":3107746200000 //到期時間
將修改的license上傳到任一節點,執行(一個節點執行即可)
curl -XPUT -u elastic 'http://localhost:9202/_xpack/license' -H "Content-Type: application/json" -d @license.json
提示:"acknowledged":true,"license_status":"valid" ,即為成功
也可通過:curl -XGET -u elastic:changeme 'http://localhost:9202/_xpack/license' 檢視資訊
Kibana預設密碼賬號:elastic/changeme
7. 需要進行展示的節點上執行(某一個節點安裝,既能展示叢集資訊)
/usr/share/kibana/bin/kibana-plugin install file:///home/elasticsearch/x-pack-5.0.2.zip
修改配置檔案/etc/kibana/kibana.yml
elasticsearch.username: "elastic"
elasticsearch.password: "changeme"
重啟kibana服務,此時登入頁面http://ip:5601需要輸入預設賬號密碼,即可展示叢集監控資訊,如下下圖: