首页 > 其他分享 >Elasticsearch安装

Elasticsearch安装

时间:2023-11-01 17:27:34浏览次数:40  
标签:elastic Changed system Elasticsearch user elasticsearch password 安装

Docker

单节点

修改max_map_count值

sysctl -w vm.max_map_count=262144

创建持久化目录并配置权限

mkdir /opt/elasticsearch
setfacl -m u:1000:rwx -R /opt/elasticsearch/

创建配置文件

mkdir config
$ cat > elasticsearch.yml << EOF
cluster.name: "docker-cluster"
network.host: 0.0.0.0
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
EOF

运行容器

docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-e "cluster.name=elasticsearch" \
-e "ES_JAVA_OPTS=-Xms512m -Xmx1024m" \
-v /opt/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-v /opt/elasticsearch/data:/usr/share/elasticsearch/data \
-v /opt/elasticsearch/logs:/usr/share/elasticsearch/logs \
-v /opt/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-d elasticsearch:7.17.5

初始化密码

$ docker exec -it elasticsearch bash
root@2001b18921ee:/usr/share/elasticsearch# /usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive
Initiating the setup of passwords for reserved users elastic,apm_system,kibana,kibana_system,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_system]: 
Reenter password for [kibana_system]: 
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_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]

Curl登录测试

root@2001b18921ee:/usr/share/elasticsearch# curl -XGET -u elastic 'localhost:9200/_xpack/security/user?pretty'
Enter host password for user 'elastic':
{
  "elastic" : {
    "username" : "elastic",
    "roles" : [
      "superuser"
    ],
    "full_name" : null,
    "email" : null,
    "metadata" : {
      "_reserved" : true
    },
...

标签:elastic,Changed,system,Elasticsearch,user,elasticsearch,password,安装
From: https://www.cnblogs.com/cpw6/p/17803593.html

相关文章

  • Docker安装Oracle19c史上最全步骤
    Docker装置Oracle19c史上最全步调 Docker装置Oracle19c装置第一步:下载镜像第二步:创立挂载文件第三步:装置Oracle第四步:衔接Oracle 先容OracleDatabase19c,也就是12.2.0.3,最初在livesql.oracle.com上宣布,是OracleDatabase12c跟18c系列产物的终极版本,因而也是“临......
  • Nodejs安装教程
    1.下载 在https://nodejs.cn/download/current/ 下载安装包,我下载的是  node-v18.18.0-x64.msi2.双击安装包,一路点击下一步,我选择安装到D:\nodejs\ 目录3.验证安装  在cmd命令行窗口中,运行  node-v 及 npm-v 将显示版本号4 修改全局模块下载路径4.1......
  • 安装 Altium Designer(AD20)
     ComponentFromSupplierSearch   在电路设计中,AltiumDesigner是较为常见的设计软件。但是在安装AD时,可能是会出现如下报错:AD报错内容:Unabletodownloadextension.“ComponentFromSuplierSearch”;Errordetails:Cannotfindextension“ComponentFromSuplierSearch”.解......
  • Centos安装MQTT与基本配置
    1.Centos默认没有mosquitto,需要额外安装一个软件包,EPEL软件库。该库中有很多Linux发行版软件  sudoyum-yinstall epel-release2.安装mostuitto   sudoyum-yinstallmosquitto3.执行完以上两步,mosquitto就已经安装成功4.测试是否安装成功  sudosystemctl......
  • 如何安装Python3.8版本的TensorFlow?
    condainstallkeras 现在tensorflow2.4支持3.63.73.8可以放心安装pipinstalltensorflowDownloadinghttps://mirrors.aliyun.com/pypi/packages/59/9b/tensorflow-2.5.0-cp38-cp38-manylinux2010_x86_64.whl(454.4MB)升级的话可以加个--upgradepipinstalltensorf......
  • linux安装MySQL数据库初始化报错
    在使用如下初始化命令进行数据库初始化时报错,./bin/mysqld--user=mysql--basedir=/usr/local/mysql/mysql/--datadir=/usr/local/mysql/mysql/data/--initialize--lower-case-table-names=1; 权限不足导致,修改命令为:./bin/mysqld--user=root--basedir=/usr/local......
  • linux 安装rabbitmq流程记录
    Linux系统:CentOS7.x(如果是CentOS8.x的话,需要修改下面两个环境版本号中的el7为el8)Erlang:erlang-22.3.4.12-1.el7.x86_64.rpmRabbitMQ:rabbitmq-server-3.8.13-1.el7.noarch.rpm1安装erlangLinux系统:CentOS7.x(如果是CentOS8.x的话,需要修改下面两个环境版本号中的el7为el8......
  • mysql安装步骤(windows版zip包)
    1.官网下载安装包https://cdn.mysql.com//Downloads/MySQL-8.2/mysql-8.2.0-winx64.zip2.在下载后的目录下找到Mysql压缩包并将其解压至自己创建的一个文件夹内(注意:目录名不可以是中文)3.my.ini内容如下,注意路径改成自己的,第5行basedir=、第7行datadir=[mysqld]#设置3306端口port......
  • vmware tools无法安装情况
    Win7无法安装VMwareTools怎么办?Win7无法安装VMwareTools的解决方法 发布时间:2023-06-0716:34:41 作者:佚名   我要评论使用VMwareWorkstation上虚拟机时发现一个问题。上Windows10的时候可以自动安装VMwaretools,但上Windows7却显示无法自动安装VMwaretools,本......
  • 【AutoML】AutoKeras 的安装和环境配置(VSCode)
    本地环境中已经有太多的工作配置了(Python、Java、Maven、Docker等等),为了不影响其他环境运行,我选择直接在VSCode中创建工作空间并配置好AutoKeras(反正最后也是要在VSCode中进行开发的)。<br>打开VSCode后先创建一个工作区,然后在终端运行以下代码:python3-mvenvautokeras-......