其他分享
首页 > 其他分享> > Elasticsearch可视化工具-----cerebro(比head更优秀)

Elasticsearch可视化工具-----cerebro(比head更优秀)

作者:互联网

cerebro

1.docker环境的搭建+docker-compose

我之前写过

2. ES环境部署

#1.第一种方法
[root@cerebro ~]# docker pull elastic/elasticsearch:7.6.1  ##提前拉取镜像
[root@cerebro ~]#docker run --name es -p 9200:9200 -p 9300:9300 -d -e “discovery.type=single-node” elasticsearch:7.3.0   ##docker命令直接部署es  -d: 后台运行容器,并返回容器ID,也即启动守护式容器; -e 指定环境变量
[root@cerebro ~]# docker images 
REPOSITORY              TAG       IMAGE ID       CREATED         SIZE
elastic/elasticsearch   7.6.1     41072cdeebc5   17 months ago   790MB
[root@cerebro ~]# docker run --name es -p 9200:9200 -p 9300:9300 -d -e "discovery.type=single-node" elastic/elasticsearch:7.6.1
fd12fa46332bf5e081da0cc00008a8a4d6c9ab02a942ab5af6ab0eece7415123
[root@cerebro ~]# docker ps 
CONTAINER ID   IMAGE                         COMMAND                  CREATED         STATUS         PORTS                                                                                  NAMES
fd12fa46332b   elastic/elasticsearch:7.6.1   "/usr/local/bin/dock…"   4 seconds ago   Up 3 seconds   0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 0.0.0.0:9300->9300/tcp, :::9300->9300/tcp   es

#2.第二种方法
[root@cerebro ~]# cat docker-compose.yml 
version: '2'
services:
  # Elasticsearch service
  es:
    image: elasticsearch:7.3.0
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      - discovery.type=single-node
    restart: "no"
[root@cerebro ~]# docker-compose up -d  ##启动

#3.测试
[root@cerebro ~]# curl localhost:9200
{
  "name" : "fd12fa46332b",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "Rq5oEWaoShOdBe2FVwZ1fw",
  "version" : {
    "number" : "7.6.1",https://blog.csdn.net/qq_40907977/article/details/104743149
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "aa751e09be0a5072e8570670309b1f12348f023b",
    "build_date" : "2020-02-29T00:15:25.529771Z",
    "build_snapshot" : false,
    "lucene_version" : "8.4.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

#4.由于使用dokcer方式的服务启动,可以看到name被设定为启动的容器的hostname,cluster.name被设定为docker-cluster,从version中也可以看到ElasticSearch的版本信息,这样,可以用于验证ElasticSearch功能的环境就可以使用了。

在这里插入图片描述
在这里插入图片描述

3.部署cerebro

[我这里使用的是elk专栏中部署的es集群,小伙伴们可以参考]
docker部署参考
不用docker部署参考

#1.法一:docker直接运行
[root@cerebro ~]# docker pull yannart/cerebro
[root@cerebro ~]# docker images 
REPOSITORY              TAG       IMAGE ID       CREATED         SIZE
elastic/elasticsearch   7.6.1     41072cdeebc5   17 months ago   790MB
yannart/cerebro         latest    5fea7929eee7   3 years ago     505MB
[root@cerebro ~]# docker run --name cerebro -d -p 9100:9000 yannart/cerebro:latest
2dc04e43bc7fb0d3535df0bf734d5473fee6e3c66b645a5c9babee73780be5f0
[root@cerebro ~]# docker ps 
CONTAINER ID   IMAGE                         COMMAND                  CREATED          STATUS          PORTS                                                                                  NAMES
2dc04e43bc7f   yannart/cerebro:latest        "./bin/cerebro"          3 seconds ago    Up 2 seconds    0.0.0.0:9100->9000/tcp, :::9100->9000/tcp                                              cerebro
fd12fa46332b   elastic/elasticsearch:7.6.1   "/usr/local/bin/dock…"   10 minutes ago   Up 10 minutes   0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 0.0.0.0:9300->9300/tcp, :::9300->9300/tcp   es
#2.法二使用docker-compose方法
[root@cerebro ~]# cat docker-compose.yml 
version: '2'
services:
  # cerebro service
  cerebro:
    image: lmenezes/cerebro:0.8.4
    ports:
      - "9100:9000"
    restart: "no"
[root@cerebro ~]# docker-compose up -d

在这里插入图片描述

在这里插入图片描述

标签:head,9200,root,cerebro,tcp,-----,docker,9300
来源: https://blog.csdn.net/qwerty1372431588/article/details/118964056