启用和禁用
启用和禁用X-Pack功能
默认情况下,所有X-Pack功能都被启用。您可以启用或禁用特定的X-Pack功能elasticsearch.yml,kibana.yml以及logstash.yml 配置文件。
设置 描述
xpack.graph.enabled 设置为false禁用X-Pack图形功能。
xpack.ml.enabled 设置为false禁用X-Pack机器学习功能。
xpack.monitoring.enabled 设置为false禁用X-Pack监视功能。
xpack.reporting.enabled 设置为false禁用X-Pack报告功能。
xpack.security.enabled 设置为false禁用X-Pack安全功能。
xpack.watcher.enabled 设置false为禁用观察器。

Run bin/kibana-plugin in your Kibana installation directory.
bin/kibana-plugin install x-pack
The plugin install scripts require direct internet access to download and install X-Pack. If your server doesn’t have internet access, specify the location of the X-Pack zip file that you downloaded to a temporary directory.
bin/kibana-plugin install file:///path/to/file/x-pack-6.2.4.zip
The Kibana server needs to be able to write to files in the optimize directory. If you’re using sudo or su, run the plugin installation as the built-in kibana user. For example:
sudo -u kibana bin/kibana-plugin install x-pack
For more information, see Installing Plugins.

密码
也就是:
bin/x-pack/setup-passwords auto
1
如果想自己来指定密码的话,执行:
bin/x-pack/setup-passwords interactive

也可以使用shell 终端进行管理:
修改elastic用户的密码:
curl -XPUT -u elastic 'localhost:9200/_xpack/security/user/elastic/_password' -d '{
"password" : "123456"
}'
修改kibana用户的密码:
curl -XPUT -u elastic 'localhost:9200/_xpack/security/user/kibana/_password' -d '{
"password" : "123456"
}'
创建用户组和角色,创建所属用户
eg:创建beats_admin用户组,该用户组对filebeat*有all权限,对.kibana*有manage,read,index权限
curl -XPOST -u elastic 'localhost:9200/_xpack/security/role/beats_admin' -d '{
"indices" : [
{
"names" : [ "filebeat*" ],
"privileges" : [ "all" ]
},
{
"names" : [ ".kibana*" ],
"privileges" : [ "manage", "read", "index" ]
}
]
}'
创建jockbeat用户,密码是jockbeat
curl -XPOST -u elastic 'localhost:9200/_xpack/security/user/jockbeat' -d '{
"password" : "jockbeat",
"full_name" : "jock beat",
"email" : "john.doe@anony.mous",
"roles" : [ "beats_admin" ]
}'

1.解压 x-pack-6.2.3.zip 进入elasticsearch目录,找到x-pack-core-6.2.3.jar,如果如果已经安装过x-pack插件可以在elasticsearch-6.2.3/plugins/x-pack/x-pack-core/目录下找到
2.解压jar包,然后找到如下两个class文件,使用luyten反编译
org/elasticsearch/license/LicenseVerifier.class
org/elasticsearch/xpack/core/XPackBuild.class
3.将反编译后的java 代码复制到自己的IDE中,按照同样的包名创建pack(可以直接创建如下两个文件,省略第二部)
(1)LicenseVerifier 中有两个静态方法,这就是验证授权文件是否有效的方法,我们把它修改为全部返回true.
# cat LicenseVerifier.java
package org.elasticsearch.license;

import java.nio.*;
import java.util.*;
import java.security.*;
import org.elasticsearch.common.xcontent.*;
import org.apache.lucene.util.*;
import org.elasticsearch.common.io.*;
import java.io.*;

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)XPackBuild 中 最后一个静态代码块中 try的部分全部删除,这部分会验证jar包是否被修改
# cat XPackBuild.java
package org.elasticsearch.xpack.core;
import org.elasticsearch.common.io.*;
import java.net.*;
import org.elasticsearch.common.*;
import java.nio.file.*;
import java.io.*;
import java.util.jar.*;
public class XPackBuild
{
public static final XPackBuild CURRENT;
private String shortHash;
private String date;
@SuppressForbidden(reason = "looks up path of xpack.jar directly")
static Path getElasticsearchCodebase() {
final URL url = XPackBuild.class.getProtectionDomain().getCodeSource().getLocation();
try {
return PathUtils.get(url.toURI());
}
catch (URISyntaxException bogus) {
throw new RuntimeException(bogus);
}
}
XPackBuild(final String shortHash, final String date) {
this.shortHash = shortHash;
this.date = date;
}
public String shortHash() {
return this.shortHash;
}
public String date() {
return this.date;
}
static {
final Path path = getElasticsearchCodebase();
String shortHash = null;
String date = null;
Label_0157: {
shortHash = "Unknown";
date = "Unknown";
}
CURRENT = new XPackBuild(shortHash, date);
}
}4.编译这两个文件
我们不需要编译整个项目,只需要编译这两个文件,所以要把依赖添加到classpath中,依赖也与之前有所变化,之前只需要x-pack 包本身,现在需要引入 elasticsearch 6.2.3 中 lib 目录下的jar包 以及 x-pack-core-6.2.3.jar 本身
javac -cp "/usr/local/elk/elasticsearch-6.2.3/lib/elasticsearch-6.2.3.jar:/usr/local/elk/elasticsearch-6.2.3/lib/lucene-core-7.2.1.jar:/usr/local/elk/elasticsearch-6.2.3/plugins/x-pack/x-pack-core/x-pack-core-6.2.3.jar" LicenseVerifier.java
javac -cp "/usr/local/elk/elasticsearch-6.2.3/lib/elasticsearch-6.2.3.jar:/usr/local/elk/elasticsearch-6.2.3/lib/lucene-core-7.2.1.jar:/usr/local/elk/elasticsearch-6.2.3/plugins/x-pack/x-pack-core/x-pack-core-6.2.3.jar:/usr/local/elk/elasticsearch-6.2.3/lib/elasticsearch-core-6.2.3.jar" XPackBuild.java
1
2
5.使用重新编译的两个class文件替换原有的class文件,然后重新打jar包
jar -cvf x-pack-core-6.2.3.jar ./*
1
6.将破解好的x-pack-core-6.2.3.jar替换elasticsearch-6.2.3/plugins/x-pack/x-pack-core/目录下原有的jar包即可。
7.更新license:
去官网申请免费license,会发邮件给你进行下载;
将下载的文件重命名为license.json,并做如下修改:
"type":"platinum" #白金版
"expiry_date_in_millis":2524579200999 #截止日期 2050年
或者将license文件上传到服务器通过命令导入:
curl -XPUT -u elastic 'http://192.168.20.101:9200/_xpack/license' -H "Content-Type: application/json" -d @license.json
或者
curl -XPUT -u elastic 'http://192.168.20.60:9200/_xpack/license?acknowledge=true' -H "Content-Type: application/json" -d @license.json
注意:
elasticsearch 6.2.4中默认开启了安全验证,我们暂时修改配置文件以方便导入自己的文件
在elasticsearch.yml 中 添加一下配置
xpack.security.enabled:false

X-PACK详解的更多相关文章

  1. NPM使用详解(下)

    NPM使用详解(下) *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !impo ...

  2. Protocol Buffer技术详解(数据编码)

    Protocol Buffer技术详解(数据编码) 之前已经发了三篇有关Protocol Buffer的技术博客,其中第一篇介绍了Protocol Buffer的语言规范,而后两篇则分别基于C++和J ...

  3. Protocol Buffer技术详解(语言规范)

    Protocol Buffer技术详解(语言规范) 该系列Blog的内容主体主要源自于Protocol Buffer的官方文档,而代码示例则抽取于当前正在开发的一个公司内部项目的Demo.这样做的目的 ...

  4. C语言内存对齐详解(2)

    接上一篇:C语言内存对齐详解(1) VC对结构的存储的特殊处理确实提高CPU存储变量的速度,但是有时候也带来了一些麻烦,我们也屏蔽掉变量默认的对齐方式,自己可以设定变量的对齐方式.VC 中提供了#pr ...

  5. php cookie详解

    各参数详解 注意: 1   当一个Cookie被删除时,它的值在当前页在仍然有效的.原因是删除cookie实际也是设置cookie,  只是把cookie的值设为‘’或者null,或者把cookie的 ...

  6. SCCM 2007 R2部署、操作详解系列之概念

    站点类型 在安装站点时,您决定它将是主站点还是辅助站点.然后,在安装其他站点时,您可以选择将其安排到层次结构关系中,以便父站点管理子站点,中央站点收集所有站点信息,从而进行集中式管理.也可以根据业务和 ...

  7. Protocol Buffers编码详解,例子,图解

    Protocol Buffers编码详解,例子,图解 本文不是让你掌握protobuf的使用,而是以超级细致的例子的方式分析protobuf的编码设计.通过此文你可以了解protobuf的数据压缩能力 ...

  8. ios开发——实用技术OC-Swift篇&本地通知与远程通知详解

    本地通知与远程通知详解 一:本地通知   Local Notification的作用 Local Notification(本地通知) :是根据本机状态做出的通知行为,因此,凡是仅需依赖本机状态即可判 ...

  9. Git命令详解

    一个中文git手册:http://progit.org/book/zh/ 原文:http://blog.csdn.net/sunboy_2050/article/details/7529841 前面两 ...

  10. KVM镜像管理利器-guestfish使用详解

    原文  http://xiaoli110.blog.51cto.com/1724/1568307   KVM镜像管理利器-guestfish使用详解 本文介绍以下内容: 1. 虚拟机镜像挂载及w2k8 ...

随机推荐

  1. Jmeter之发送请求入参必须使用编码格式、Jmeter之发送Delete请求可能入参需要使用编码格式

    这里的其中一个属性值必须要先编码再传参才可以,具体可以通过抓包分析观察:

  2. sql学习内容记录

    1.left函数 left(字段,长度):获取指定字段左侧的数据,类似substring函数 2.union / union all 将多个记录合并成一个完整的数据集 3.insert into se ...

  3. Cannot connect to database because the database client

    问题描述: arcgis server10.1  arcgis sde10出现下面问题 Cannot connect to  database because the database client ...

  4. CentOS7安装k8s

    借鉴博客:https://www.cnblogs.com/xkops/p/6169034.html 此博客里面有每个k8s配置文件的注释:https://blog.csdn.net/qq_359048 ...

  5. C# Note25: .Net Core

    .NET Core全面扫盲贴 .NET Core与.NET Framework.Mono之间的关系 https://www.postgresql.org/

  6. JavaScript中forEach与each

    forEach是ES5中操作数组的一种方法,主要功能是遍历数组,例如: var arr = [1,2,3,4]; arr.forEach(alert); 等价于: var arr = [1, 2, 3 ...

  7. RBAC模型

    1.RBAC(Role-Based Access Control,基于角色的访问控制),就是用户通过角色与权限进行关联.简单地说,一个用户拥有若干角色,每一个角色拥有若干权限.这样,就构造成“用户-角 ...

  8. SCP传送文件时提示No ECDSA host key is known forx.x.x.x and you have requested strict checking.问题的解决办法

    在使用SCP向其他设备传送文件时,打印如下错误: No ECDSA host key is known for x.x.x.x and you have requested strict checki ...

  9. python3 输出系统信息

    一.安装psutil库 pip3 install psutil 二.代码 #!/usr/bin/python3 coding=utf-8 import psutil import uuid impor ...

  10. Android SDK Tools 24.3.2 Build脚本Bug

    如下图版本: 在%Android_home%\tools\ant\build.xml中, 在483行附近, 少了aidl,aapt,dx, zipalign四个变量的声明. 加上就OK了. <p ...