当前位置:   article > 正文

docker 安装 elasticsearch7.2和kinaba7.2_douker部署alert2

douker部署alert2

下载镜像

docker pull elasticsearch:7.2.0
docker pull kibana:7.2.0
  • 1
  • 2

安装 elasticsearch

创建目录

mkdir -pv /opt/elasticsearch/{config,data,plugins}
  • 1

更新配置文件

sudo tee /opt/elasticsearch/config/elasticsearch.yml <<-'EOF'
http.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*" 
EOF
  • 1
  • 2
  • 3
  • 4
  • 5

配置分词器

#在/opt/elasticsearch/plugins目录下下载ik插件 或者进入容器直接执行,本次直接在挂在目录之外配置,配置之后请删除压缩包

wget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.2.0/elasticsearch-analysis-ik-7.2.0.zip

unzip elasticsearch-analysis-ik-7.2.0.zip -d ik
  • 1
  • 2
  • 3

启动容器

[root@localhost elasticsearch]# docker run --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xmx1024m -Xmx1024m" -v /opt/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /opt/elasticsearch/data:/usr/share/elasticsearch/data -v /opt/elasticsearch/plugins:/usr/share/elasticsearch/plugins -d elasticsearch:7.2.0
c6e1e3fa61cd84f0123ce56453cf5350feda9edd7dc60434db3868f74a47059a
[root@localhost elasticsearch]# 
  • 1
  • 2
  • 3

查看进程

[root@localhost config]# docker ps
CONTAINER ID   IMAGE                 COMMAND                  CREATED          STATUS          PORTS                                                                                  NAMES
c6e1e3fa61cd   elasticsearch:7.2.0   "/usr/local/bin/dock…"   13 minutes ago   Up 13 minutes   0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 0.0.0.0:9300->9300/tcp, :::9300->9300/tcp   elasticsearch
[root@localhost config]# 
  • 1
  • 2
  • 3
  • 4

使用curl http://localhost:9200/ 查看对外服务

[root@localhost config]# curl http://localhost:9200/  
{
  "name" : "c6e1e3fa61cd",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "hwZBRInqQDyqSILw3kCN4Q",
  "version" : {
    "number" : "7.2.0",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "508c38a",
    "build_date" : "2019-06-20T15:54:18.811730Z",
    "build_snapshot" : false,
    "lucene_version" : "8.0.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
[root@localhost config]# 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19

更改容器配置

docker update --restart=always elasticsearch

安装kinaba

查看 elasticsearch ip地址

[root@localhost config]# docker inspect elasticsearch | grep IPAddress  
            "SecondaryIPAddresses": null,
            "IPAddress": "172.17.0.2",
                    "IPAddress": "172.17.0.2",
[root@localhost config]# 
  • 1
  • 2
  • 3
  • 4
  • 5

安装kinaba

 docker run -di --name=kibana -e ELASTICSEARCH_URL=http://172.17.0.2:9200 --restart=always -p 5601:5601 kibana:7.2.0 
  • 1
[root@localhost config]# docker run -di --name=kibana -e ELASTICSEARCH_URL=http://172.17.0.2:9200 --restart=always -p 5601:5601 kibana:7.2.0 
ea9ede48dc3c6201c30b9c9803dd7b9360c538f30caf1ef952360520d3be004a
[root@localhost config]# 
  • 1
  • 2
  • 3

在这里插入图片描述

在这里插入图片描述
这个时候需要稍等一会儿,容器还在启动中,稍安勿躁
在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/579016
推荐阅读
相关标签
  

闽ICP备14008679号