当前位置: 首页 > news >正文

docker-compose安装ES7.14和Kibana7.14(有账号密码)

一、docker-compose安装ES7.14.0和kibana7.14.0

1、下载镜像

1.1、ES镜像

docker pull elasticsearch:7.14.0

1.2、kibana镜像

docker pull kibana:7.14.0

2、docker-compose安装ES和kibana

2.1、创建配置文件目录和文件

#创建目录

mkdir -p /home/es-kibana/config

mkdir -p /home/es-kibana/data

mkdir -p /home/es-kibana/plugins

#给挂载目录授权

chmod 777 -R  /home/es-kibana/config

chmod 777  /home/es-kibana/es-data/data

chmod 777  /home/es-kibana/es-data/logs

chmod 777  /home/es-kibana/es-data/plugins

2.2、ES配置文件

1、elasticesearch.yml

cluster.name: "docker-cluster"
network.host: 0.0.0.0

discovery.zen.minimum_master_nodes: 1
discovery.type: single-node

xpack.security.enabled: true     #此项开启账号密码

2、jvm.options
## JVM configuration################################################################
## IMPORTANT: JVM heap size
################################################################
##
## You should always set the min and max JVM heap
## size to the same value. For example, to set
## the heap to 4 GB, set:
##
## -Xms4g
## -Xmx4g
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
## for more information
##
################################################################# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space-Xms1g
-Xmx1g
-XX:+IgnoreUnrecognizedVMOptions
################################################################
## Expert settings
################################################################
##
## All settings below this section are considered
## expert settings. Don't tamper with them unless
## you understand what you are doing
##
################################################################## GC configuration
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly## G1GC Configuration
# NOTE: G1GC is only supported on JDK version 10 or later.
# To use G1GC uncomment the lines below.
# 10-:-XX:-UseConcMarkSweepGC
# 10-:-XX:-UseCMSInitiatingOccupancyOnly
# 10-:-XX:+UseG1GC
# 10-:-XX:InitiatingHeapOccupancyPercent=75## optimizations# pre-touch memory pages used by the JVM during initialization
-XX:+AlwaysPreTouch## basic# explicitly set the stack size
-Xss1m# set to headless, just in case
-Djava.awt.headless=true# ensure UTF-8 encoding by default (e.g. filenames)
-Dfile.encoding=GBK# use our provided JNA always versus the system one
-Djna.nosys=true# turn off a JDK optimization that throws away stack traces for common
# exceptions because stack traces are important for debugging
-XX:-OmitStackTraceInFastThrow# flags to configure Netty
-Dio.netty.noUnsafe=true
-Dio.netty.noKeySetOptimization=true
-Dio.netty.recycler.maxCapacityPerThread=0# log4j 2
-Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true-Djava.io.tmpdir=${ES_TMPDIR}## heap dumps# generate a heap dump when an allocation from the Java heap fails
# heap dumps are created in the working directory of the JVM
-XX:+HeapDumpOnOutOfMemoryError# specify an alternative path for heap dumps; ensure the directory exists and
# has sufficient space
-XX:HeapDumpPath=data# specify an alternative path for JVM fatal error logs
-XX:ErrorFile=logs/hs_err_pid%p.log## JDK 8 GC logging8:-XX:+PrintGCDetails
8:-XX:+PrintGCDateStamps
8:-XX:+PrintTenuringDistribution
8:-XX:+PrintGCApplicationStoppedTime
8:-Xloggc:logs/gc.log
8:-XX:+UseGCLogFileRotation
8:-XX:NumberOfGCLogFiles=32
8:-XX:GCLogFileSize=64m# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m
# due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise
# time/date parsing will break in an incompatible way for some date patterns and locals
9-:-Djava.locale.providers=COMPAT# temporary workaround for C2 bug with JDK 10 on hardware with AVX-512
10-:-XX:UseAVX=2

主要是这3个配置项

2.3、kibana配置

i18n.locale: zh-CN

server.host: "0.0.0.0"

server.shutdownTimeout: "5s"

elasticsearch.hosts: [ "http://10.1.1.197:9200" ]

monitoring.ui.container.elasticsearch.enabled: true

elasticsearch.username: "elastic"
elasticsearch.password: "xxx"

2.4、#创建docker-compose.yml文件(重要)

version: '3'services:elasticsearch:image: elasticsearch:7.14.0container_name: es7-14restart: unless-stoppedvolumes:- ./es-data/data:/usr/share/elasticsearch/data- ./es-data/logs:/usr/share/elasticsearch/logs# 挂载分词器的目录#- ./es-data/plugins:/usr/share/elasticsearch/plugins- ./config/jvm.options:/usr/share/elasticsearch/config/jvm.options- ./config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.ymlports:- "9100:9100"- "9200:9200"networks:- eskibana:image: kibana:7.14.0container_name: kibana7-14ports:- "5601:5601"volumes:- ./config/kibana.yml:/usr/share/kibana/config/kibana.ymldepends_on:- elasticsearchnetworks:- esnetworks:es:driver: bridge

2.5、#自我检测自己写的有没有语法上的问题

docker-compose config -q

2.6、#启动和停止

docker-compose up -d

docker-compose down

重启

docker-compose restart 容器id

3、ES设置账号密码

3.1、检查elasticesearch.yml已配置

xpack.security.enabled: true     #此项开启账号密码(只配置这项就可以了)

3.2、设置用户名和密码的命令

参考:【精选】ElasticSearch7.14设置内置用户,使用用户名密码访问

这里需要为4个用户分别设置密码,elastic, kibana, logstash_system,beats_system。(interactive 手动设置, auto 自动生成密码 )

bin/elasticsearch-setup-passwords interactive

#进入es容器操作步骤

$docker exec -it es7-14 /bin/bash

#手动创建密码
$bin/elasticsearch-setup-passwords interactive

3、访问ES和kibana

3.1、访问ES

http://10.1.1.197:9200/

需要输入账号密码即可登录

3.2、访问kibana

http://10.1.1.197:5601/

备注:

设置密码的配置文件,配置这个就可以了

xpack.security.enabled: true     #此项开启账号密码(只配置这项就可以了)

然后进入容器里配置密码bin/elasticsearch-setup-passwords interactive就可用了。

相关文章:

docker-compose安装ES7.14和Kibana7.14(有账号密码)

一、docker-compose安装ES7.14.0和kibana7.14.0 1、下载镜像 1.1、ES镜像 docker pull elasticsearch:7.14.0 1.2、kibana镜像 docker pull kibana:7.14.0 2、docker-compose安装ES和kibana 2.1、创建配置文件目录和文件 #创建目录 mkdir -p /home/es-kibana/config mkdir…...

k8s-----14、controller-Job和Cronjob

Job和Cronjob 1、Job(一次性任务)2、CronJob(定时任务) 1、Job(一次性任务) [rootmaster controlleryaml]# cat job.yaml apiVersion: batch/v1 kind: Job metadata:name: pi spec:template:spec:contain…...

蓝桥杯每日一题2032.10.24

蓝桥杯大赛历届真题 - C 语言 B 组 - 蓝桥云课 (lanqiao.cn) 题目描述 题目分析 由于布局为两个字节为一行&#xff0c;那我们输入两个数就为一行&#xff0c;但是这两个数全部得用二进制进行表示使用bitset bitset:将一个数转化为二进制 bitset<8>:将一个数转化为8位…...

【AGC】更新应用信息报未知错误解决方法

【问题描述】 最近有几个开发者遇到了一个问题&#xff0c;他们在AGC控制台配置好应用信息的图标和截图之后&#xff0c;点击保存按钮会弹出“未知错误&#xff0c;请稍后再试”的异常报错&#xff0c;导致无法正确保存应用配置信息。 出错页面如图所示。 ​​ 【解决方案】 …...

一个注解让 Spring Boot 项目接口返回数据脱敏

1 背景 需求是某些接口返回的信息&#xff0c;涉及到敏感数据的必须进行脱敏操作 2 思路 ①要做成可配置多策略的脱敏操作&#xff0c;要不然一个个接口进行脱敏操作&#xff0c;重复的工作量太多&#xff0c;很显然违背了“多写一行算我输”的程序员规范。思来想去&#xff…...

测试人员的KPI怎么设置

关于测试部的KPI&#xff0c;简单列举下自己所经历部门的考核指标&#xff1a; 工作量。根据平时跟踪的需求&#xff0c;编写的用例&#xff0c;提交的bug数等综合评估&#xff1b; 负责项目的质量。上线项目是否出现重大功能的事故&#xff0c; 如果出现了事故&#xff0c;分…...

Databend 开源周报第 116 期

Databend 是一款现代云数仓。专为弹性和高效设计&#xff0c;为您的大规模分析需求保驾护航。自由且开源。即刻体验云服务&#xff1a;https://app.databend.cn 。 Whats On In Databend 探索 Databend 本周新进展&#xff0c;遇到更贴近你心意的 Databend 。 特性预览&#…...

mongodb-gridfs下载文件报Sort exceeded memory limit of 104857600 bytes异常

报错详细信息 com.mongodb.MongoQueryException: Query failed with error code 292 and error message Executor error during find command :: caused by :: Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting. on server 11.51.141.…...

分享一下微信小程序里怎么实现扫码点餐链接

在当今数字化时代&#xff0c;扫码点餐已经成为了餐饮行业的一种趋势。通过微信小程序&#xff0c;实现扫码点餐功能&#xff0c;可以为餐厅带来诸多便利和优势。本文将详细介绍如何在微信小程序中实现扫码点餐功能&#xff0c;帮助餐厅提高服务效率和质量&#xff0c;提升用户…...

安卓开发环境安装教程

在本教程中&#xff0c;我将向您介绍如何在Windows操作系统上安装Android开发环境。Android开发环境包括Java Development Kit&#xff08;JDK&#xff09;&#xff0c;Android Studio IDE和相应的SDK工具。跟随以下步骤&#xff0c;您将能够搭建安卓开发环境并开始开发自己的应…...

深入探究Selenium定位技巧及最佳实践

在使用Selenium进行Web自动化测试时&#xff0c;准确地定位元素是非常重要的一步。Selenium提供了多种元素定位方法&#xff0c;本文将深入探究这八大元素定位方法&#xff0c;帮助读者更好地理解和应用Selenium的定位技巧。 1. ID定位 ID是元素在HTML中的唯一标识符&#xff…...

如何正确安装psycopg2,No module named ‘psycopg2._psycopg‘解决

二、psycopg2安装方法 psycopg2可以通过多种方式安装&#xff0c;我们这里介绍两种常用的方式&#xff1a;通过pip安装和手动安装。 1、通过pip安装psycopg2 如果已经安装了pip&#xff0c;那么在命令行中输入以下命令即可完成psycopg2的安装&#xff1a; pip install psyc…...

go WriteFile文件追加写入(适合小文件)

go 在做文件追加写入时一般用os.OpenFile 指定 FileMode 为 os.O_APPEND. 如官方文档示例: f, err : os.OpenFile("access.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)if err ! nil {log.Fatal(err)}if _, err : f.Write([]byte("appended some data\n&…...

history 模式上线需要注意什么事项?

结论先行&#xff1a; 首先&#xff0c;需要在服务器上对所有的路由路径进行配置&#xff0c;避免在访问路由时出现 404 的情况&#xff1b; 其次&#xff0c;需要特别注意安全性和兼容性问题。 因为使用 History 模式会暴露出服务器上的文件路径&#xff0c;因此在部署时需要…...

VMware虚拟机安装Ubuntu22.04教程(2023最新最详细)

目录 简介 1 VMware虚拟机下载与安装 2 Ubuntu操作系统安装与配置 2.1 Ubuntu虚拟机配置 2.2 Ubuntu操作系统安装 简介 Linux是一种自由和开放源代码的操作系统内核&#xff0c;被广泛应用于各种计算机系统中。它以稳定性、安全性和灵活性而闻名&#xff0c;并成为服务器…...

yakit使用爆破编码明文_dnslog使用

yakit使用爆破编码密码 文章目录 yakit使用爆破编码密码yakit使用1 yakit编码密码进行爆破2 准备eval.php文件放入web3 访问http://192.168.225.206/eval.php,使用bp抓包,测试后环境准本好4 使用yakit4.1 进入页面&#xff0c;点击这里进行配置默认端口80834.2 发送到模糊测试4…...

3分钟教你用Python+Appium实现自动化测试

一、环境准备 1.脚本语言&#xff1a;Python3.x IDE&#xff1a;安装Pycharm 2.安装Java JDK 、Android SDK 3.adb环境&#xff0c;path添加E:\Software\Android_SDK\platform-tools 4.安装Appium for windows&#xff0c;官网地址 Redirecting 点击下载按钮会到GitHub…...

qt的一些自绘控件

https://download.csdn.net/download/venice0708/88469835...

类图表示法

设计模式&#xff0c;用设计图表示的话&#xff0c;主要用到类图。常见UML类图如下&#xff1a; 1、类图&#xff1a;矩形框&#xff0c;代表一个类&#xff08;Class&#xff09;。类图分为三层&#xff0c;第一层显示类的名称&#xff0c;如果是抽象类&#xff0c;则用斜体显…...

大模型训练框架

一文搞定分布式训练&#xff1a;dataparallel、distirbuted、deepspeed、accelerate、transformers、horovod - 知乎代码地址&#xff1a;taishan1994/pytorch-distributed-NLP: pytorch分布式训练 (github.com)pytorch-distributed-NLPpytorch单机多卡分布式训练-中文文本分类…...

uniapp 对接腾讯云IM群组成员管理(增删改查)

UniApp 实战&#xff1a;腾讯云IM群组成员管理&#xff08;增删改查&#xff09; 一、前言 在社交类App开发中&#xff0c;群组成员管理是核心功能之一。本文将基于UniApp框架&#xff0c;结合腾讯云IM SDK&#xff0c;详细讲解如何实现群组成员的增删改查全流程。 权限校验…...

[特殊字符] 智能合约中的数据是如何在区块链中保持一致的?

&#x1f9e0; 智能合约中的数据是如何在区块链中保持一致的&#xff1f; 为什么所有区块链节点都能得出相同结果&#xff1f;合约调用这么复杂&#xff0c;状态真能保持一致吗&#xff1f;本篇带你从底层视角理解“状态一致性”的真相。 一、智能合约的数据存储在哪里&#xf…...

突破不可导策略的训练难题:零阶优化与强化学习的深度嵌合

强化学习&#xff08;Reinforcement Learning, RL&#xff09;是工业领域智能控制的重要方法。它的基本原理是将最优控制问题建模为马尔可夫决策过程&#xff0c;然后使用强化学习的Actor-Critic机制&#xff08;中文译作“知行互动”机制&#xff09;&#xff0c;逐步迭代求解…...

初学 pytest 记录

安装 pip install pytest用例可以是函数也可以是类中的方法 def test_func():print()class TestAdd: # def __init__(self): 在 pytest 中不可以使用__init__方法 # self.cc 12345 pytest.mark.api def test_str(self):res add(1, 2)assert res 12def test_int(self):r…...

关键领域软件测试的突围之路:如何破解安全与效率的平衡难题

在数字化浪潮席卷全球的今天&#xff0c;软件系统已成为国家关键领域的核心战斗力。不同于普通商业软件&#xff0c;这些承载着国家安全使命的软件系统面临着前所未有的质量挑战——如何在确保绝对安全的前提下&#xff0c;实现高效测试与快速迭代&#xff1f;这一命题正考验着…...

搭建DNS域名解析服务器(正向解析资源文件)

正向解析资源文件 1&#xff09;准备工作 服务端及客户端都关闭安全软件 [rootlocalhost ~]# systemctl stop firewalld [rootlocalhost ~]# setenforce 0 2&#xff09;服务端安装软件&#xff1a;bind 1.配置yum源 [rootlocalhost ~]# cat /etc/yum.repos.d/base.repo [Base…...

Python+ZeroMQ实战:智能车辆状态监控与模拟模式自动切换

目录 关键点 技术实现1 技术实现2 摘要&#xff1a; 本文将介绍如何利用Python和ZeroMQ消息队列构建一个智能车辆状态监控系统。系统能够根据时间策略自动切换驾驶模式&#xff08;自动驾驶、人工驾驶、远程驾驶、主动安全&#xff09;&#xff0c;并通过实时消息推送更新车…...

[ACTF2020 新生赛]Include 1(php://filter伪协议)

题目 做法 启动靶机&#xff0c;点进去 点进去 查看URL&#xff0c;有 ?fileflag.php说明存在文件包含&#xff0c;原理是php://filter 协议 当它与包含函数结合时&#xff0c;php://filter流会被当作php文件执行。 用php://filter加编码&#xff0c;能让PHP把文件内容…...

python爬虫——气象数据爬取

一、导入库与全局配置 python 运行 import json import datetime import time import requests from sqlalchemy import create_engine import csv import pandas as pd作用&#xff1a; 引入数据解析、网络请求、时间处理、数据库操作等所需库。requests&#xff1a;发送 …...

智能职业发展系统:AI驱动的职业规划平台技术解析

智能职业发展系统&#xff1a;AI驱动的职业规划平台技术解析 引言&#xff1a;数字时代的职业革命 在当今瞬息万变的就业市场中&#xff0c;传统的职业规划方法已无法满足个人和企业的需求。据统计&#xff0c;全球每年有超过2亿人面临职业转型困境&#xff0c;而企业也因此遭…...