This commit is contained in:
2022-04-18 11:21:20 +08:00
commit 45a7af638f
210 changed files with 8997 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
# 部署 MySQL 单节点
- 按实际环境修改
- docker-compose.yml
- mysql/my.cnf
- 创建目录
```
grep '\<source:' docker-compose.yml | cut -d: -f2 | xargs mkdir -p
```
- 启动
```
docker-compose up -d
```
- 查看日志,直至出现 "MySQL is ready for connections."
```
docker-compose logs mysql
```

View File

@@ -0,0 +1,27 @@
version: "3.7"
services:
mysql:
image: harbor.colben.cn/general/mysql:8
container_name: mysql
restart: "on-failure"
stop_grace_period: 5m
privileged: true
networks:
mysql:
ports:
- 3306:3306
volumes:
- type: bind
source: ./mysql/my.cnf
target: /etc/my.cnf
- type: bind
source: ./mysql/binlog
target: /var/lib/mysql-bin
- type: bind
source: ./mysql/db
target: /var/lib/mysql
- type: bind
source: ./mysql/log
target: /var/log/mysql

View File

@@ -0,0 +1,19 @@
[mysqld]
mysqlx = OFF
skip-name-resolve = 1
max-user-connections = 600
## this should be less than 80% of total memory
innodb-buffer-pool-size = xxxxG
## this should be half of "innodb-buffer-pool-size"
innodb-buffer-pool-instances = xxxx
# binlog
server-id = 1
log-bin = /var/lib/mysql-bin/master
binlog-format = ROW
binlog-expire-logs-seconds = 172800
gtid-mode = ON
enforce-gtid-consistency = TRUE