启用和禁用
启用和禁用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. semantic-ui 输入框

    1.标准输入框 semantic-ui中定义输入框需要将input标签包含于另外一个标签内,外层标签的class为ui input,注意外层标签可以是div,span.p.i. <div cla ...

  2. spring bean之间的关系:继承,依赖,注入

    一 继承 spring中多个bean之间的继承关系,和面向对象中的继承关系类似,直接看代码. 先定义一个Person类 package com.demo.spring.entity; /** * @a ...

  3. Day3-1 函数

    定义: 函数是指将一组语句的集合通过一个名字(函数名)封装起来,要想执行这个函数,只需调用其函数名即可 特性: 减少重复代码 使程序变的可扩展 使程序变得易维护 语法: def calc(x, y): ...

  4. js获取非行间样式/写入样式(行间)

    <!--DOCTYPE html--> <html> <head> <meta charset="utf-8" /> <sty ...

  5. mac下virtualbox中centos6.5虚拟机实现全屏和调整分辨率

    在visualbox里安装好centos后,发现不能分辨率与原屏幕不一致,很多解决方法是:安装增强包.可是安装增强包后依然达不到效果. 究其原因,原来因为没有安装显卡驱动导致安装了增强包后无法实现分辨 ...

  6. 使用getopts处理输入参数

    在编写shell脚本中,需要输入参数,使用过程中,getopts更加方便.可以很好的处理用户输入的参数和参数值. 参加如下一段脚本: #!/bin/bash while getopts ": ...

  7. Visual Studio 2017调试开源项目代码

    在我们的开发过程中很多时候我们会从GitHub上面下载一些开源的项目代码,然后在此基础上进行调试,正常情况下我们只需要将项目的源代码编译成Dll或者在.Net Core项目中直接引用相应的Nuget包 ...

  8. zabbix-2.4.5的安装配置与使用

    系统最小化安装 环境: zabbix_server     12.1.1.1 zabbix_agent     12.1.1.2 zabbix_proxy      12.1.1.3 1.安装环境: ...

  9. JavaScript控制阻止表单提交

    1.在表单上使用onSubmit方法 <?php $form = ActiveForm::begin([ 'options'=>[ 'class' => 'form-horizont ...

  10. 使用urllib2+re爬取web网站

    应用1,使用urllib2+re爬取淘宝网指定页面的所有图片