Elasticsearch7.7设置账号密码时的逻辑矛盾问题和文章相关评论

news2024/9/28 21:29:55

一、Elasticsearch7.7设置账号密码时的逻辑矛盾问题

    publish:June 19, 2020 -Friday  2019年1月30日,外媒又报道了一起Elasticsearch数据泄露事件!2019年1月份的至少有6起Elasticsearch数据泄露事件了。原因何在,很简单,开发者在服务启动之后总是懒得去修改,哪怕是添加个密码,不信?你去看看你们公司的REDIS服务器,看看有多少设置了密码,至少我公司不相关的部门的业务,他们的REDIS我都能远程登录(因对接关系我知道了redis服务器IP)。

    好吧,回到Elasticsearch7.7的密码设置问题上来吧,说说我遇到的Elasticsearch设置账号密码时的矛盾问题,很扯蛋。不过也不要上纲上线,因为这问题肯定是可以解决的,但我在写这篇笔记的时候还没有找到方法,而我又想基于此留下点笔记。操作过程如下:

#1.开始给elasticsearch设置密码
tiger@n21-045-025:/usr/share/elasticsearch$ sudo bin/elasticsearch-setup-passwords interactive
It doesn't look like the X-Pack security feature is enabled on this Elasticsearch node.
Please check if you have enabled X-Pack security in your elasticsearch.yml configuration file.
ERROR: X-Pack Security is disabled by configuration.
#提示没有在配置文件中开启X-Pack,OK
#2.开启X-Pack配置
tiger@n21-045-025:/opt/elasticsearch$ sudo vim /etc/elasticsearch/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: "*"
#新增加了以下两行配置
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
#3.增加完配置之后要重启elasticsearch不?你说不重启能行吗?不重启就还是没有配置啊。
#重启elasticsearch之后,然后我们再来配置密码
#修改完配置重启es之后使用elasticsearch-setup-passwords interactive
tiger@n21-045-025:/usr/share/elasticsearch$ sudo bin/elasticsearch-setup-passwords interactive
#Initiating the setup of passwords for reserved users elastic,apm_system,kibana,logstash_system,beats_system,remote_monitoring_user.
Enter password for [elastic]: 
Reenter password for [elastic]: 
Enter password for [apm_system]: 
Reenter password for [apm_system]: 
Enter password for [kibana]: 
Reenter password for [kibana]: 
Enter password for [logstash_system]: 
Reenter password for [logstash_system]: 
Enter password for [beats_system]: 
Reenter password for [beats_system]: 
Enter password for [remote_monitoring_user]: 
Reenter password for [remote_monitoring_user]: 
Unexpected response code [503] from calling PUT http://192.21.15.25:9200/_security/user/apm_system/_password?pretty
Cause: Cluster state has not been recovered yet, cannot write to the [null] index
Possible next steps:
* Try running this tool again.
* Try running with the --verbose parameter for additional messages.
* Check the elasticsearch logs for additional error details.
* Use the change password API manually. 
ERROR: Failed to set password for user [apm_system]
#看设置报错:
tiger@n21-045-025:/usr/share/elasticsearch$ sudo bin/elasticsearch-setup-passwords interactive --verbose
Running with configuration path: /etc/elasticsearch
Testing if bootstrap password is valid for http://192.21.15.25:9200/_security/_authenticate?pretty
Checking cluster health: http://192.21.15.25:9200/_cluster/health?pretty
{
  "error" : {
    "root_cause" : [
      {
        "type" : "master_not_discovered_exception",
        "reason" : null
      }
    ],
    "type" : "master_not_discovered_exception",
    "reason" : null
  },
  "status" : 503
}
Failed to determine the health of the cluster running at http://192.21.15.25:9200
Unexpected response code [503] from calling GET http://192.21.15.25:9200/_cluster/health?pretty
Cause: master_not_discovered_exception
It is recommended that you resolve the issues with your cluster before running elasticsearch-setup-passwords.
It is very likely that the password changes will fail when run against an unhealthy cluster.
Do you want to continue with the password setup process [y/N]ERROR: User cancelled operation

        看上面的报错,这时提示9200服务报503错误,什么原因呢?我设置了要要账号密码啊。现在从浏览器访问9200端口也是需要账号密码才能登录的,请求 http://192.21.15.25:9200/_cluster/health?pretty 接口也会阻塞一直不响应,因为在等待账号密码呢。

        这就矛盾了:我没启用xpack.security.enabled时,不能进入设置密码。但我启动了之后设置密码时它会调用_cluster/health?pretty检查集群状态然后就有问题了。这不矛盾了吗?
网上找了一些资料,包括google,但也都没有解决:比如 elasticsearch - Apply security on ELK Cluster - authentication issue - Stack Overflow 这里说把所有的节点都加上上面的X-pack配置重启,然后使用auto进行密码设置。一样会出现无法检查集群健康状态的问题。Failed to determine the health of the cluster running at http://192.21.15.25:9200 Unexpected response code [503] from calling GET ​http://192.21.15.25:9200/_cluster/health?pretty​

        这个肯定不能是个问题!这个也一定能解决的,暂时挺脑火,留个笔记在这里!

二、Elasticsearch7.7设置账号密码时的逻辑矛盾问题文章评论

Level : 1.    User:us20200621125549-604    Time:2020-06-21 13:10:47
N年老友链来访,博主可好?我还没失联,只是博客懒得更新。

Level : 2.    User:us20200621125549-604    Time:2020-06-21 13:11:23
噢 对了 我是回味依旧博客博主

Level : 3.    User:us20200403115246-946    Time:2020-06-21 14:16:29
[04007]我也只是把这当作我的在线笔记,好搜索。

Level : 4.    User:us20200714213936-170    Time:2020-07-14 21:40:44
我也遇到这个问题,请问博主解决了没

Level : 5.    User:us20200716173241-723    Time:2020-07-22 15:04:12
开个普通用户操作,问题解决

Level : 6.    User:us20200724112955-542    Time:2020-07-24 13:29:16
楼主解决这个问题了么

Level : 7.    User:us20201110183802-281    Time:2020-11-10 18:40:19
楼主解决这个问题了么

Level : 8.    User:us20201117095144-969    Time:2020-11-17 09:55:11
没解决写在这里干嘛,晕死

Level : 9.    User:us20190316202924-932    Time:2020-11-18 21:25:54
[04007]不好意思,我后来没怎么用ES了,没再研究

Level : 10.    User:us20201222175155-687    Time:2020-12-22 18:21:54
我也遇到了,各种研究破案了,需要先制作证书,然后在各个节点上添加,集群起来后才能修改,完美解决。

Level : 11.    User:us20201223090022-836    Time:2020-12-23 19:20:40
[04007]感谢:User:us20201222175155

Level : 12.    User:us20210713161623-531    Time:2021-07-13 17:22:43
可参考这篇文章。已解决 https://blog.csdn.net/zhanremo3062/article/details/118703994

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2174808.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

数据的表示和存储 第3讲 C语言中的整数

深耕AI ​互联网行业 算法研发工程师 概括 本讲主要介绍了C语言中的整数表示。 无符号整数能够表示的最大值比带符号整数要大。带符号整数使用补码来表示,补码的运算系统是一种模运算系统,能够实现加减运算的统一。在C语言中,如果一个表达式…

7.MySQL内置函数

目录 日期函数时间函数字符串函数数学函数其他函数 日期函数 函数名称描述current_date()当前日期current_time()当前时间current_timesamp()当前时间戳date(datetime)返回datetime参数的日期部分date_add(date, interval d_value_tyep)在date中添加日期函数或时间。interval后…

JMeter压测HTTPS 在window 11处理SSL证书认证

在此位置,找到chrome 的证书 证书到出到指定的路径, 利用jdk中的keytool.exe工具,重新生成证书 crm 去到命令窗口,再去到JDK路径下,如下 输入 keytool -import -alias “zhengshu.store” -file “D:\Program F…

HarmonyOS鸿蒙系统开发应用程序,免费开源DevEco Studio开发工具

DevEco Studio 是华为为 HarmonyOS 和 OpenHarmony 开发者提供的官方集成开发环境(IDE),它基于 IntelliJ IDEA Community 版本打造,提供了代码编辑、编译、调试、发布等一体化服务。 一、DevEco Studio支持系统 DevEco Studio支持…

63.【C语言】再议结构体(上)

1.复习 20.【C语言】初识结构体(重要) 48.【C语言】结构体补充 2.结构体的特殊声明 01.匿名结构体 *定义 不完全声明,即结构体没有自己的名字(没有结构体标签) *注意事项 1.匿名结构体只能使用一次 2.下列代码合法吗 struct {int a;char b;floa…

使用python获取百度一下,热搜TOP数据详情

一、查找对应链接 # 警告:以下代码仅供学习和交流使用,严禁用于任何违法活动。 # 本代码旨在帮助理解和学习编程概念,不得用于侵犯他人权益或违反法律法规的行为。 1、打开百度页面 百度一下,你就知道 2、点击F12 或 右键鼠标…

text2sql方法:NatSQL和DIN-SQL

NatSQL NatSQL出自2021年9月的论文《Natural SQL: Making SQL Easier to Infer from Natural Language Specifications》(github),它是一种SQL 中间表征(SQL intermediate representation(IR))方法。 NatSQL作者认为Text2SQL的关键挑战是自然语言描述和其对应的SQ…

Cookie、Session、Token(JWT)还不懂?

Cookie、Session、Token(JWT) 三者的区别与用途!如何进行身份认证,保持用户登录状态? Cookie、Session 和 Token 都是在 Web 开发中用于管理用户状态和进行身份认证的技术,它们之间有以下区别和用途&#…

【js逆向学习】酷我音乐排行榜 python+nodejs(webpack)

逆向目标 目标网址: https://www.kuwo.cn/rankList目标接口: https://www.kuwo.cn/api/www/bang/bang/musicList 加密参数: 参数一:secret参数二:reqId 逆向过程 老规矩先分析网络请求,我们可以分析到网络请求是通过ajax进行的&#xff…

【C++】C/C++内存管理(new/delete)

C/C内存分布 代码内存相关问题 int globalVar 1; static int staticGlobalVar 1;void Test() {static int staticVar 1;int localVar 1;int num1[10] { 1, 2, 3, 4 };char char2[] "abcd";const char* pChar3 "abcd";int* ptr1 (int*)malloc(siz…

yolox训练自己的数据集

环境搭建 gpu按自己情况安装 nvidia-smi 查看自己的版本 CUDA和cudnn 按自己的安装,我的驱动551.76,注意不要用最新的,官网只要求驱动是大于等于,可以用低版本的cuda,我安装的是CUDA 11.1 cuda下载后&#xff0c…

报告查询系统小程序开发制作方案

报告查询小程序系统主要是为了解决传统报告查询方式往往依赖于纸质文档或复杂的内网系统,存在查询效率低、信息更新慢、携带不便等问题。 一、目标用户 企业员工:需要频繁查询各类工作报告,如销售人员查询销售业绩报告,财务人员查…

信道衰落的公式

对于天线: 对于天线的面积计算: 天线的接收功率密度: 天线的接收功率: 移动无线信道(I) (xidian.edu.cn)https://web.xidian.edu.cn/zma/files/20150710_153736.pdf 更加常用的考虑了额外的信道衰落pathlo…

基于YOLOv5的农作物病虫害识别系统设计与实现(PYQT+web端+微信小程序+YOLOv5+训练数据集+论文+部署文档+开题报告)

摘要 农作物病虫害是农业生产中的关键问题,病虫害的爆发和侵袭不仅严重影响农作物产量和质量,还可引发局部地区严重的灾害性损失。因此,及时发现和预防农作物病虫害的发生和发展至关重要。本文以农作物病虫害图像为载体,运用深度…

python的高级用法

对于python的使用,我们常见的用法是python xx.py直接执行脚本,有时可能您需要在脚本的第一行添加(#!/usr/bin/env python3 或 #!/usr/local/bin/python3),然后chmod确保脚本文件具有可执行权限。这样脚本就可以在终端直…

从哪里下载高清解压视频素材?推荐五个优质素材资源网站

想制作吸引人的抖音小说推文,但不知道从哪里获取高清解压视频素材?今天就为大家推荐五个优秀的网站,帮助你轻松找到所需的素材,提升你的创作质量。 首先是蛙学网 作为国内顶级的短视频素材网站,蛙学网提供了丰富的4K高…

Vxe UI vue 使用 vxe-tabs 页签实现右侧操作按钮、关闭所有页签、关闭右侧、关闭左侧

Vxe UI vue 使用 vxe-tabs 页签实现右侧操作按钮、关闭所有页签、关闭右侧、关闭左侧 查看 github <template><div><vxe-tabs v-model"selectTab" :options"tabList"><template #extra><vxe-pulldown :options"tabOptio…

Flood Fill模型

这个模型主要用来求连通块的数量&#xff0c;在求连通块时有“8连通”和“4连通”之分。 看上面的图形&#xff0c;如果是4连通那么红色和绿色就不连通&#xff08;只有一个格子的“上下左右”相连才叫连通&#xff09;。如果是8连通那就联通&#xff08;不仅仅包含边相连&…

SwiftUI简明概念(4):如何对shape同时进行fill和stroke

1、iOS17方案 iOS17上可以同时对shape调用fill和stroke&#xff1a; Circle().stroke(.red, lineWidth: 20).fill(.orange).frame(width: 150, height: 150) 效果也如我们所预料的&#xff1a; 而且stroke可以调用任意次&#xff1a; Circle().stroke(.blue, lineWidth: 45…

【路径规划】基于球向量的粒子群优化(SPSO)算法在无人机路径规划中的实现

摘要 本文介绍了基于球形矢量的粒子群优化&#xff08;Spherical Particle Swarm Optimization, SPSO&#xff09;算法&#xff0c;用于无人机&#xff08;UAV&#xff09;路径规划。SPSO算法通过引入球形矢量的概念&#xff0c;增强了粒子群在多维空间中的探索和利用能力&…