elasticsearch添加用户名和密码

Elasticsearch设置密码 ES默认没有开启安全组件,如果我们的es直接暴露在公网,那么开启认证是很有必要的。 阅读详情

1.修改elasticsearch.yml配置文件

[bdp@host66 config]$vim elasticsearch.yml
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: elasticsearch-66
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-66
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
#
#-----------------------------Indexing & Cache config---------------------------
#index.max_script_fields: 128

#
#
#
#
#
#
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 
#
# For more information, consult the zen discovery module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
#xpack.license.self_generated.type: trial

 

 
 

2.重新启动es,设置密码

[bdp@host66 bin]$./bin/elasticsearch-setup-passwords interactive
Initiating the setup of passwords for reserved users elastic,apm_system,kibana,logstash_system,beats_system,remote_monitoring_user.
You will be prompted to enter passwords as the process progresses.
Please confirm that you would like to continue [y/N]y


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]: 
Changed password for user [apm_system]
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [beats_system]
Changed password for user [remote_monitoring_user]
Changed password for user [elastic]

3.es启动脚本

[bdp@host66 elasticsearch-6.8.2]$cat start.sh 
export JAVA_HOME=/home/bdp/shangeshishi/jdk1.8.0_131
export PATH=$JAVA_HOME/bin:$PATH

nohup ./bin/elasticsearch > elasticsearch.log 2>&1 &
tail -f elasticsearch.log

4.加密后的访问Header的方式为

http://host:9201/?auth_user=elastic&auth_password=123456

CiteSpace关键词聚类图谱含义详细解析 CiteSpace关键词聚类图谱含义详细解析 回顾上一次推文:CiteSpace关键词共现图谱含义详细解析 其中有一句: 当你人工已经可以很容易的进行归纳后,就不需要再利用CiteSpace聚类功能啦。 我们来看一下上次推文做出来的关键词共现图谱: 人工不好归纳!那怎么聚类呢? 此时便可使用CiteSpace的聚类功能啦! 如下所示:我们可以清晰地看到上边的关键词共现网络聚成了一个个不规则区域... 阅读详情

相关推荐

STM32按键中断切换红绿蓝灯

通过以上步骤,我们实现了使用STM32的按键中断来切换红绿蓝LED灯的功能。在实际应用中,可能还需要考虑更多的细节,如按键消抖、更精确的延时实现等。但上述代码提供了一个基本的框架和思路,可以根据具体需求进行扩展和优化。希望这篇博客对您有所帮助!

2301_79865940的博客 954

elasticSearch 设置用户名密码 && 查询

添加角色接口为:POST /_xpack/security/role/{}]}'{}}pretty'{"all"],{"*"],"all"]}],"elastic"],}}}添加用户接口为:POST/_xpack/security/user/pretty'注:这里要注意的是用户密码最好不要有"$" "!"之类的字符,这样有可能会导致密码认证不成功,其他字符测试过暂时没问题(具体原因不详,反正我遇到过这个坑)...

begefefsef的博客 1万+

Ubuntu桌面消失?可能是lightdm配置在捣鬼:详细解析/etc/lightdm.conf的优先级机制与实战修复

本文详细解析了Ubuntu系统因lightdm显示管理器配置错误导致桌面消失的问题。通过分析/etc/lightdm.conf的优先级加载机制,提供了从systemctl诊断、调试模式运行到实战修复配置语法错误(如缺失[Seat:*]组)的完整方案。文章还探讨了在系统无法启动时使用chroot或恢复模式进行高级救援,并对比了lightdm与gdm3在NVIDIA驱动环境下的不同表现,帮助用户高效恢复图形界面。

weixin_29313547的博客 422

elasticsearch批量提交数据两种方式Python和curl(带用户名和密码)

elasticsearch批量提交数据两种方式Python和curl (带用户名和密码) 1.使用Python批量提交数据 import requests from apscheduler.schedulers.blocking import BlockingScheduler from elasticsearch import Elasticsearch from elasticsearch import helpers def post_dga(): es = Elasticsearch()

weixin_44246962的博客 3112

告别GUI点点点:Formality形式化验证的TCL脚本自动化实战(附完整脚本)

本文详细介绍了如何通过TCL脚本实现Formality形式化验证的全流程自动化,显著提升验证效率并降低错误率。内容涵盖脚本框架解析、参数化设计、验证报告生成及团队协作策略,特别适合芯片设计工程师摆脱传统GUI操作,实现300%以上的效率提升。

weixin_33737134的博客 287

大疆2025八月份校招硬件工程师笔试真题A卷题目分享

大疆2025年笔试真题解析

weixin_63651698的博客 1574

Elasticsearch实战:Centos 8 安装 Elasticsearch 8

es 目录介绍 配置详解参考:https://www.cnblogs.com/xiaochina/p/6855591.html 这个为单机配置,之后还会介绍集群配置。jvm配置这里我采用默认配置,没有修改,可根据自己虚拟机实际情况修改。ES不允许使用root操作es,需要添加用户,操作如下: 五、启动es 1、切换到es的 /bin目录下执行: 如果出现以下错误: 2、需要切换到root用户修改配置: 修改 /etc/security/limits.con...

赵树祥的博客 1932

单片机OTA升级:Bootloader如何多重校验保障APP完整性?

本文详细介绍了单片机OTA升级中Bootloader如何通过CRC校验、数字签名、版本比对和存储位置检查等多重校验机制保障APP完整性。CRC校验作为快速检测数据完整性的核心手段,结合其他安全措施有效防止设备变砖和安全漏洞,确保远程升级的可靠性。

l3m4n的博客 983

ElasticSearch设置用户名和密码

ES和设置用户密码认证

好记性不如烂笔头 1万+

Power BI常见问题篇1:无法打开文档

Power BI常见问题篇1:无法打开文档

weixin_48273257的博客 3313

机器人中的数值优化(十五)——PHR增广拉格朗日乘子法

本系列文章主要是我在学习《数值优化》过程中的一些笔记和相关思考,主要的学习资料是深蓝学院的课程《机器人中的数值优化》和高立编著的《数值最优化方法》等,本系列文章篇数较多,不定期更新,上半部分介绍无约束优化,下半部分介绍带约束的优化,中间会穿插一些路径规划方面的应用实例

慕羽★的博客 2010

elasticsearch 配置用户名和密码

无密码的其他配置项在:https://blog.csdn.net/Xeon_CC/article/details/132064295。

Xeon_CC的博客 8158

couldn‘t upgrade db schema: insert into ACT_GE_PROPERTY values (‘common.sche[已解决]

启动整合了flowable的项目,初始化时报错。flowable没有自动建表, 原因 测试数据库版本是MySQL5.7。经过查询和尝试,原因是:在这个数据库里面,已经有一个数据库里面有activiti的这些表了,它检索的时候全库检索查到它了,所以flowable不去建表了,但是我们指定的这个schema里卖弄还是空的,所以它报了找不到表。解决方法:mysql的链接上加上参数如下,让本schema成为默认的schema。...

JavaPub 6053

ElasticSearch 6.5.1 添加用户名和密码

需求 设置ElasticSearch的用户名和密码,禁止非法用户访问。 程序版本 elasticsearch-6.5.1 kibana-6.5.1-linux-x86_64 流程 1. 修改elasticsearch.yml配置文件 开启验证权限 xpack.security.enabled: true http.cors.enabled: true http.cors.allow-origin: “*” http.cors.allow-headers: Authorization,X-Requested-

随便写写 3274

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

ES添加用户名和密码

数据安全很重要,ES数据上线必须加密码,告诉你怎么加用户和密码

Baronstar的博客 1万+

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

通过ECK在Kubernetes上部署ElasticSearch添加自定义用户名和密码

由于需要通过自动化脚本在k8s上面部署eck和es。由于部署es的时候会对elastic用户随机生成密码,无法提前知道密码。因此,通过bin/elasticsearch-setup-passwords更改密码,在k8s pod显然不太适用,我们需要提前内置自己的用户和密码。 部署ECK 下载elastic-operator wget -c https://download.elastic.co/downloads/eck/1.5.0/all-in-one.yaml 安装elastic-operator

吃果冻不吐果冻皮 2151

Java客户端添加ES的用户名和密码认证

ElasticSearch8 missing authentication

3655

Linux之Elasticsearch和kibana用户验证

elasticsearch和kibana默认情况下均未使用用户登录验证,因为kibana对elasticsearch上索引具备增删改查的能力,为了数据安全我们需要配置用户验证。

月生的静心苑 4090

第二章 SpringBoot整合ES7

【代码】第二章 SpringBoot整合ES7。

ping的博客 1069

于elasticsearch-rest-high-level-client 操作 Es

安装Java:要求JDK为1.8及以上版本。 创建阿里云Elasticsearch实例:实例版本要求大于等于elasticsearch-rest-high-level-client的版本。本文创建一个6.3.2版本的实例。 注意High Level Client能够向上兼容,例如6.3.2版本的elasticsearch-rest-high-level-client能...

weixin_30672019的博客 1083

kibana设置端口密码

kibana设置端口密码

leveretz的博客 1002

ES启用授权访问-Java代码

Elasticsearch集群需要basic auth验证,通过Elasticsearch实例时设置的用户名和密码创建RestHighLevelClient实例,与与Elasticsearch进行交互。如果出现以下问题:java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.(I)V。

qq_45243068的博客 472

Docker 部署使用Elasticsearch-head的几个坑

Elasticsearch-head 连接Elastichsearch的几个坑

weixin_39080216的博客 894

用户名_如何给ElasticSearch设置用户名和密码

前言:最近在工作中用到了ElasticSearch。由于上线需要设置用户名和密码,发现ES7.7以后的版本将安全认证功能免费开放了。并将X-pack插件集成了到了开源的ElasticSearch版本中。下面将图文介绍如何利用X-pack给ElasticSearch相关组件设置用户名和密码。环境说明:ES7.7.1官方docker 安装宿主机器为centos7单机单节点模式详细步骤:进入ES的安装目...

weixin_39887748的博客 3146

k8s部署带用户名和密码的elasticsearch

k8s部署带用户名和密码的elasticsearch

qq_45502554的博客 3636

Elasticsearch集群和账号密码设置

会弹出三次提示,分别是输入密码,输出文件,输入密码,第一次密码是输入上一步设置的密码,也是123123,输出文件可以直接回车,默认就行。一般来说,主节点如果有数据,不要删除主节点的,先删除从节点的试试。启动主节点和从节点,这个时候可能会报错,提示的大概是证书或者密码错误这些,如果没报错就算完成了,直接访问https://192.168.1.63:9200,如果提示证书不安全,忽略就行,然后就会提示叫输入账号密码。输入 CA 的密码。启动成功的情况,启动成功了但是还没有设置密码,所以登录不进去,先设置密码。

wsyh12345678的博客 4591
上一篇: hive查看表结构占用空间大小
下一篇: spark的thrift-jdbcodbc-server+kerberos编程
SimpleSimpleSimples
博客等级 码龄10年 6452粉丝 115原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址