硬件配置: 2 个 CPU 核心, 4G 内存, 50G 硬盘(最低)
操作系统: Linux 发行版 x86_64
Python = 3.6.x
Mysql Server ≥ 5.6
Mariadb Server ≥ 5.5.56
Redis
服务器准备:
192.168.99.101 jumpserver 2c-4G
192.168.99.102 数据库/Redis 2C-2G
192.168.99.103 web 服务器 A 1C-1G
192.168.99.104 web 服务器 B 1C-1G
部署 MySQL 服务:
外置数据库要求:
mysql 版本需要大于等于 5.6
mariadb 版本需要大于等于 5.5.6
数据库编码要求 uft8
导入 MySQL 镜像:
docker load -i mysql-5.6.44.tar.gz
mysqld.cnf 配置文件
将容器中的 MySQL 配置文件在宿主机通过-v 挂载到容器中
mkdir -p /etc/mysql/mysql.conf.d
vim /etc/mysql/mysql.conf.d/mysqld.cnf
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
## This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# The MySQL Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
#log-error = /var/log/mysql/error.log
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
character-set-server=utf8
mysql.cnf 配置文件:
mkdir -p /etc/mysql/conf.d/
vim /etc/mysql/conf.d/mysql.cnf