之前写过一篇通过cerebro openresty做的ES的日常运维界面,链接: https://cloud.tencent.com/developer/article/2314215
最近在网上又看到一款 ElasticView 也是可以管理ES的,简单试了下,安装部署特别的简单。
代码语言:javascript复制mkdir -pv /usr/local/software/elasticview
# 创建目录,用于数据持久化
mkdir -pv mysql_data
chmod 777 -R mysql_data
$ cat docker-compose.yaml
version: '3'
networks:
monitor:
driver: bridge
services:
elasticview:
image: 1340691923/elastic_view:latest
container_name: elastic_view
hostname: elastic_view
restart: always
volumes:
- ./mysql_data:/var/lib/mysql
ports:
- "8090:8090"
networks:
- monitor
docker-compose up -d 即可后台启动
查看下启动日志,如下:
$ docker logs elastic_view -f
MySQL Community Server 5.7.38 is not running.
启动mysql....
Stopping MySQL Community Server 5.7.38.
MySQL Community Server 5.7.38 is already stopped.
Re-starting MySQL Community Server 5.7.38.
su: warning: cannot change directory to /home/mysql: No such file or directory
2023-08-24T14:27:34.438042Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-08-24T14:27:34.739339Z 0 [Warning] InnoDB: New log files created, LSN=45790
2023-08-24T14:27:34.789243Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2023-08-24T14:27:34.796546Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 5e2c99ba-428a-11ee-a8b8-0242c0a84002.
2023-08-24T14:27:34.797535Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-08-24T14:27:35.088356Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-08-24T14:27:35.088468Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-08-24T14:27:35.088944Z 0 [Warning] CA certificate ca.pem is self signed.
2023-08-24T14:27:35.158254Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
su: warning: cannot change directory to /home/mysql: No such file or directory
..
MySQL Community Server 5.7.38 is started.
MySQL Community Server 5.7.38 is running.
[ElasticView] init starting...
开始导入数据....
导入数据完毕....
MySQL Community Server 5.7.38 is running.
开始修改密码....
host user
localhost mysql.session
localhost mysql.sys
localhost root
修改密码完毕....
MySQL Community Server 5.7.38 is running.
/mysql/setup.sh: 1: /mysql/setup.sh: mysql容器启动完毕,且数据导入成功: not found
[ElasticView] mysql init success!
启动ElasticView...
启动ElasticView完毕!!!
2023/08/24 14:27:47 日志组件初始化成功!日志所在目录:logs,保存天数为:4
2023/08/24 14:27:47 mysql组件初始化成功!连接:worker:1340691923@tcp(127.0.0.1:3306)/es_view,最大打开连接数:10,最大等待连接数:10
2023/08/24 14:27:47 Rbac组件初始化成功!连接:worker:1340691923@tcp(127.0.0.1:3306)/es_view
┌───────────────────────────────────────────────────┐
│ ElasticView │
│ Fiber v2.27.0 │
│ http://127.0.0.1:8090 │
│ (bound on host 0.0.0.0 and port 8090) │
│ │
│ Handlers ........... 171 Processes ........... 1 │
│ Prefork ....... Disabled PID ............... 519 │
└───────────────────────────────────────────────────┘
浏览器访问页面,我这里是 http://192.168.1.181:8090/
账号密码都是 admin
这个工具的好处是:
1、带了角色和权限管理,可以用在测试环境或者uat环境,可以给研发较大的宽松度
2、自带了很多的命令帮助和命令历史记录功能
目前看下来, “开发工具”里面的 DELETE的权限还是不好控制的,如果误操作可以把整个索引都给删除掉,但是如果不开放这个“开发工具”的权限,则开发人员的基本上没法使用这个平台了。