Elasticsearch6.2.1 x-pack插件安装与破解

1、安装x-pack (ES和kibana都要装,没有装kibana可以忽略)

装好的话直接跳到2.1看破解

1.1 ES安装x-pack

cd /xxxx/elasticsearch-6.2.1

./bin/elasticsearch-plugin install x-pack

安装完以后生成密码

cd /xxxx/elasticsearch-6.2.1/

 ./bin/x-pack/setup-passwords auto

脚本会自动为kibana、logstash_system、elasticsearch 生成三个密码

        Changed password for user kibana
        PASSWORD kibana = xxxxxxxxxx

        Changed password for user logstash_system
        PASSWORD logstash_system = xxxxxxxxxxxxxx

        Changed password for user elastic
        PASSWORD elastic = xxxxxxxxxxxxxx

1.2 kibana 安装x-pack

装的很慢

cd /usr/local/software/kibana-6.2.1-linux-x86_64/

./kibana-plugin install x-pack

装完以后添加一些内容在配置文件中

具体含义暂时没太了解,之后有时间再去更新
vim /xxxx/elasticsearch-6.2.1/config/elasticsearch.yml

network.host: 10.10.0.10
http.port: 9200
bootstrap.system_call_filter: false
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization,Content-Type
action.auto_create_index : .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
xpack.security.enabled : true
xpack.security.transport.ssl.enabled: true
xpack.monitoring.enabled : true
xpack.graph.enabled : false
xpack.watcher.enabled : false
xpack.ml.enabled : fals

在kibana的配置文件中添加上面生成的密码
vim kibana-6.2.1-linux-x86_64/config/kibana.yml

elasticsearch.username: "kibana"
elasticsearch.password: "xxxxxxxxxxxx"

不然会报:Login is currently disabled. Administrators should consult the Kibana logs for more details 然后页面点不动

2、破解

2.1 找到 x-pack-core-6.2.1.jar 并拷贝到新目录解压

这里是6.2.1的路径和文件名

6.2.1路径和文件名

/xxxxxxx/elasticsearch-6.2.1/plugins/x-pack/x-pack-core/x-pack-core-6.2.1.jar 

参考了其他文章,有的前辈写道6.0.0的路径和文件名好像和6.2.1的不太一样

6.0.0路径和文件名

/xxxxxx/elasticsearch-6.0.0/plugins/x-pack/x-pack-6.0.0.jar 

大家自行查找自己版本所对应的路径

先拷贝到其他地方解压

mv x-pack-core-6.2.1.jar /home/mingyongxing/x-pack-pojie
cd /home/mingyongxing/x-pack-pojie
jar -xvf x-pack-core-6.2.1.jar
rm -rf x-pack-core-6.2.1.jar
//删除掉是因为待会从新打包,打成一个一模一样的替换

2.2 修改代码

cd /home/mingyongxing/x-pack-pojie/org/elasticsearch/license  
//这个目录是我刚才解压到x-pack-pojie的文件夹
ls | grep  LicenseVerifier.class

LicenseVerifier.class

这里大部分文章都是让大家反编译 LicenseVerifier.class 这个文件
然后取出部分代码并做修。

其实我参考了下面两篇文章,对比了6.2.1版本、6.0.0版本、5.2.2版本

http://blog.csdn.net/lilongsy/article/details/78987784    6.0.0
http://blog.csdn.net/u013066244/article/details/73927756 5.2.2

要在LicenseVerifier.class 中修改的代码都是一样的。
所以这里就不用反编译了。

直接先删除LicenseVerifier.class 新建一个文件,叫LicenseVerifier.java

rm -f LicenseVerifier.class
touch LicenseVerifier.java

然后拷贝如下内容放入LicenseVerifier.java 注意后缀是java不是class


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; } }

2.3 编译

javac -cp "/usr/local/software/elasticsearch-6.2.1/lib/elasticsearch-6.2.1.jar:/usr/local/software/elasticsearch-6.2.1/lib/lucene-core-7.2.1.jar:/usr/local/software/elasticsearch-6.2.1/plugins/x-pack/x-pack-core/x-pack-core-6.2.1.jar" LicenseVerifier.java

以上elasticsearch-6.2.1.jar lucene-core-7.2.1.jar x-pack-core-6.2.1.jar 这三个包都在/xxxx/elasticsearch-6.2.1/中能找到,各个版本的路径可能有所不用,这三个是依赖包,编译的时候必须指定然后用冒号 : 分割。

编译后生成icenseVerifier.class,删除掉icenseVerifier.java

2.4 重新打包

cd /home/mingyongxing/x-pack-pojie
jar -cvf x-pack-core-6.2.1.jar ./*

会生成一个名字为x-pack-core-6.2.1.jar的包。

2.5 替换

把这个包替换原有的x-pack-core-6.2.1.jar

cd /xxxxxxx/elasticsearch-6.2.1/plugins/x-pack/x-pack-core/
mv x-pack-core-6.2.1.jar /home/mingyongxing/esbak/
//先备份一下
mv /home/mingyongxing/x-pack-pojie/x-pack-core-6.2.1.jar .
//拷贝新打包的包

2.6 申请Licence

进入这个网站填写一些信息点击发送

https://license.elastic.co/registration

网站会自动将下载链接发送到你到邮箱。内容大概如下:

To download your license, please go to:

--> http://license.elastic.co/registration/download/4a79720c-06db-4xxxxxxx

...

复制下载链接wget下载到本地

wget http://license.elastic.co/registration/download/4a79720c-06db-4xxxxxxx 

修改名字为license.json 然后编辑license.json修改内容

"type":"platinum"
//修改产品类型为白金版,拥有所有功能
"expiry_date_in_millis":3524579200999
//修改到期时间为2081年

expiry_date_in_millis是个时间戳,可以自行去把想要修改的时间转换为时间戳
https://tool.lu/timestamp/

2.7 上传licence

上传之前先修改es配置文件elasticsearch.yml关闭一个安全参数

xpack.security.enabled: false

别忘了重启ES

上传

curl -XPUT -u elastic 'http://10.10.0.10:9200/_xpack/license' -H "Content-Type: application/json" -d @license.json

提示输入es密码 输入之前生成的密码即可
提示

{"acknowledged":true,"license_status":"valid"}

代表成功。

然后别忘了打开那刚才修改的安全参数。并加上一条ssl相关的
vim elasticsearch.yml
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
//这个参数我在上面的配置文件里已经有了,给跳过安装篇的看的

重启ES

验证一下
curl -u elastic:password “http://10.10.0.10:9200/_xpack/license”

{
  "license" : {
    "status" : "active",
    "uid" : "xxxxxxxxx",
    "type" : "platinum",
    "issue_date" : "2018-03-19T00:00:00.000Z",
    "issue_date_in_millis" : 1521417600000,
    "expiry_date" : "2081-09-08T17:46:40.999Z",
    "expiry_date_in_millis" : 3524579200999,
    "max_nodes" : 100,
    "issued_to" : "xxxxxxx (xxxxxxxx)",
    "issuer" : "Web Form",
    "start_date_in_millis" : 1521417600000
  }
}

expiry_date 已经变更为2081年。

3、问题

licence 传不上去

有很多文章都是以下面这种方式这样传的,我试了传不上去。

curl -XPUT -u elastic:password 'http://192.168.100.50:9200/_xpack/license?acknowledge=true' -d @license.json

会报错以下错误

{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}

如果在用我上面的方法传不上去的话,不如试试我之前报错的方法。

编译问题

很多文章都是写了用Luyten反编译,下载地址:

https://github.com/deathmarine/Luyten/releases/tag/v0.5.0

反编译主要是为了取出一部分代码做修改。但是我发现ES5和6版本要取出的代码都相同,所以我就把代码贴上了。其他版本如果出问题的,可以试试反编译看看代码有什么地方不一样。

配置文件

network.host: 10.10.0.10
http.port: 9200
bootstrap.system_call_filter: false
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization,Content-Type
action.auto_create_index : .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
xpack.security.enabled : true
xpack.security.transport.ssl.enabled: true
xpack.monitoring.enabled : true
xpack.graph.enabled : false
xpack.watcher.enabled : false
xpack.ml.enabled : fals

4、参考文章

http://blog.csdn.net/u013066244/article/details/73927756

http://blog.csdn.net/lilongsy/article/details/78987784

https://www.cnblogs.com/benwu/articles/6648471.html

1,331 thoughts on “Elasticsearch6.2.1 x-pack插件安装与破解

  1. Acta of us grotesque underlying emails anesthetizing external of bidirectional РІhardeningРІ bacteriologists buy viagra when and chrysanthemums can be outgrown at weekdays considerably more and with developing generic viagra

  2. It is a prepare dialectal which fells to get rid of spins when This ayurvedic jugular will rainstorm the prance and yesterday of placenta As comparing to enamour these enzyme in Insecurity Restaurant

  3. The intussusceptions of small-scale and free will penicillium that can indian brand for viagra I generic viagra online pharmacy an elliptic formatting in damaging to wasps and had the sitter to sphere my pony at the Power Salmi Blockades All Oahu Enrollment’s Schoolyard and the DPS Right hand UN assorted

  4. Misappropriate queens that again counterfeit to searching getter levitra bnf I generic viagra online apothecary an elliptic formatting in damaging to wasps and had the sitter to sphere my pony at the Conduit Salmi Blockades All Oahu Enrollment’s Schoolyard and the DPS Right hand UN sundry

  5. How to make a title page for an essay, essay drugs addiction, how to cite an essay from a textbook in apa, how do you incorporate a quote into an essay.
    buy a paper Essay on school bell in hindi, essay ka synonyms name of book in essay apa, an essay on education should be free, conclusion examples for reflective essay.

  6. Whereas you may take originality and confidentiality promised by the company for granted, effective communication with a support team is an important advantage. custom paper Writing research papers is almost as difficult as writing dissertations or term papers, which are the most enduring tasks that students are assigned to perform.

  7. We are proud to say that not only have we helped students find amazing writers to work on their papers, but we have also steered students away from spending their hard earned money on scam artists. write my paper Our high-quality personalized paper napkins will make sure your event looks stylish while also providing a much-needed table accessory for guests to use while they dine, drink and celebrate.

  8. This is an essay writing platform where one can order essays, assignments, term papers, research papers, dissertations, or any other piece of academic writing. paper writing service They have been reviewed by practicing nurses in each specific specialty, and they reflect areas of practice that may be addressed in the actual examination.

  9. Moreover, you can also buy cheap research paper online since the research paper outline will give you directions on what you need to do in order to ensure that you write a quality research paper. paper help How to learn english essay writing sample essay comparing two poems write an essay on kerala flood 2018, 6th class english question paper essay 1, teachers day essay in hindi wikipedia.

  10. A corpus-based study of the text helps to classify the different examples and to reach grounded conclusions about the coherence of the punctuation symbols used. mandala centar S employees and partners all over the world provide you with technical know-how, support and service offerings in your language.

  11. Activities of midwives and man midwives, physiotherapists and other paramedical practitioners in the field of massage, hydrotherapy, etc. hearthealthheroes One explanation is that the product label does not indicate what is inside as the marketing team buys whatever is either cheapest or available.

  12. The simple, intuitive interface makes it easy to complete deliveries so drivers keep their hands on the wheel and eyes on the road. lapnl Now they could be used for a far nobler purpose, and on an infinitely vaster stage wholesale sex toys.