一.重新打包x-pack-6.2.4.zip
1.下载官方x-pack包.
wget https://artifacts.elastic.co/downloads/packs/x-pack/x-pack-6.2.4.zip
2.解压缩文件找到x-pack-core-6.2.4.jar
找到文件org.elasticsearch/license/LicenseVerifier.class编辑.
3.代码修改为
package org.elasticsearch.license;
public class LicenseVerifier
{
public static boolean verifyLicense(final License license, final byte[] encryptedPublicKeyData) {
return true;
}
public static boolean verifyLicense(final License license) {
return true;
}
}
4.重新编译文件.
javac -cp "x-pack-core-6.2.4.jar" LicenseVerifier.java
5.重新打包生成新的x-pack-6.2.4.zip 文件.
二.es配置x-pack
/bin/elasticsearch-plugin install file:///tmp/x-pack-6.2.4.zip
重启es,设置密码
./bin/x-pack/set-passwd interactive
三.修改es配置文件.
xpack.security.enabled: false. 作用:kibana不通过验证登陆es
更新license文件信息.
通过kibana配置.
更新type类型 platinum. expiry_date_in_millis:2557532799999 意思为:白金版.到2051年.
四.配置es ssl.
编辑ssl证书配置文件
cat /elk/elasticsearch-6.2.4/bin/x-pack/certs.yml
instances:
- name: "node1"
ip:
- "192.168.0.1"
- name: "node2"
ip:
- "192.168.0.2"
- name: "node3"
ip:
- "192.168.0.3"
生成证书
/elk/elasticsearch-6.2.4/bin/x-pack/certgen -in /elk/elasticsearch-6.2.4/bin/x-pack/certs.yml
生成文件
certificate-bundle.zip
ca node 目录. 拷贝证书到其他节点.
分别配置es节点,重启.
xpack.ssl.key: /usr/local/elasticsearch/bin/x-pack/node1/node1.key
xpack.ssl.certificate: /usr/local/elasticsearch/bin/x-pack/node1/node1.crt
xpack.ssl.certificate_authorities: [ "/usr/local/elasticsearch/bin/x-pack/ca/ca.crt" ]
xpack.security.transport.ssl.enabled: true
五.kibana x-pack
./bin/kibana-plugin install file:///tmp/x-pack-6.2.4.zip
更新配置.重启.
elasticsearch.username: "kibana"
elasticsearch.password: "kibana-passwd"
elasticsearch.ssl.verificationMode: none
六.logstash x-pack
./bin/logstash-plugin install file:///tmp/x-pack-6.2.4.zip
更新配置.logstash.yml.重启
xpack.monitoring.elasticsearch.url: "http://192.168.0.1:9200"
xpack.monitoring.elasticsearch.username: logstash_system
xpack.monitoring.elasticsearch.password: logstash-passwd