赞
踩
Yearning是一款开箱即用的MYSQL SQL审核工具,作为MYSQL web端SQL 审核平台。
本次实践为个人测试环境,操作系统版本为centos7.6。
hostname | IP地址 | 操作系统版本 | 内核版本 |
---|---|---|---|
jeven | 192.168.3.166 | centos 7.6 | 3.10.0-957.el7.x86_64 |
1.本次实践部署环境为个人测试环境;
2.在centos7.6环境下部署Yearning SQL审核平台。
检查操作系统版本
[root@jeven ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
检查系统内核版本
[root@jeven ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
检查Docker版本
[root@jeven ~]# docker -v
Docker version 20.10.17, build 100c701
创建数据目录
mkdir -p /data/yearning/db
创建mysql数据库容器
docker run -d --name my_mysql --privileged=true -v /data/yearning/db:/var/lib/mysql --restart always -e MYSQL_ROOT_PASSWORD=admin -e MYSQL_DATABASE=Yearning -p 3710:3306 mysql:5.7 --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci
查看mysql容器状态
[root@jeven yearning]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b2ed01e1d2db mysql:5.7 "docker-entrypoint.s…" 4 minutes ago Up 4 minutes 33060/tcp, 0.0.0.0:3710->3306/tcp, :::3710->3306/tcp my_mysql
下载Yearning二进制包
wget https://github.com/cookieY/Yearning/releases/download/v3.1.4/Yearning-v3.1.4-linux-amd64.zip
解压软件包
[root@jeven yearning]# unzip Yearning-v3.1.4-linux-amd64.zip
Archive: Yearning-v3.1.4-linux-amd64.zip
creating: Yearning/
creating: Yearning/docker/
inflating: Yearning/docker/Dockerfile
inflating: Yearning/docker/README.md
inflating: Yearning/docker/docker-compose.yml
inflating: Yearning/.DS_Store
inflating: Yearning/README.md
inflating: Yearning/conf.toml
inflating: Yearning/migrate
inflating: Yearning/Yearning
查看Yearning文件
[root@jeven yearning]# tree -L 2 ./Yearning
./Yearning
├── conf.toml
├── docker
│ ├── docker-compose.yml
│ ├── Dockerfile
│ └── README.md
├── migrate
├── README.md
└── Yearning
1 directory, 7 files
修改conf.toml内容如下
[Mysql]
Db = "Yearning"
Host = "192.168.3.166"
Port = "3710"
Password = "admin"
User = "root"
[General]
SecretKey = "dbcjqheupqjsuwsm"
Hours = 4
初始化及安装
./Yearning install
启动Yearning服务
./Yearning run
检查Yearning监听端口8000
[root@jeven ~]# ss -tunlp |grep 8000
tcp LISTEN 0 128 :::8000 :::* users:(("Yearning",pid=79667,fd=8))
打开浏览器 http://192.168.3.166:8000,将IP替换成自己服务器的IP地址
默认账号/密码:admin/Yearning_admin
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。