问题描述
好的,所以我想为PHP运行在Nginx中托管的网站制作MysqL的主从复制。我已经设法连接到主MysqL,但是,我的从属容器似乎出现了一些错误。我想知道是否有什么问题或应该添加什么才能解决此问题。
You need to specify one of MysqL_ROOT_PASSWORD,MysqL_ALLOW_EMPTY_PASSWORD and MysqL_RANDOM_ROOT_PASSWORD
2020-10-15 09:09:44+00:00 [Note] [Entrypoint]: Entrypoint script for MysqL Server 1:10.5.6+maria~focal started.
2020-10-15 09:09:45+00:00 [Note] [Entrypoint]: Switching to dedicated user 'MysqL'
2020-10-15 09:09:45+00:00 [Note] [Entrypoint]: Entrypoint script for MysqL Server 1:10.5.6+maria~focal started.
2020-10-15 09:09:45+00:00 [ERROR] [Entrypoint]: Database is uninitialized and password option is not specified
You need to specify one of MysqL_ROOT_PASSWORD,MysqL_ALLOW_EMPTY_PASSWORD and MysqL_RANDOM_ROOT_PASSWORD
我的docker-compose.yml文件
version: "3.3"
services:
MysqL:
image: mariadb:latest
restart: always
ports:
- "3306"
environment:
MysqL_REPLICATION_MODE: master
MysqL_REPLICATION_USER: repl_user
MysqL_REPLICATION_PASSWORD: repl_password
MysqL_ROOT_PASSWORD: rootpw
MysqL_DATABASE: database
MysqL_USER: user
MysqL_PASSWORD: mypw
networks:
- my-net
MysqL-slave:
image: mariadb:latest
restart: always
ports:
- "3306"
depends_on:
- MysqL
environment:
MysqL_REPLICATION_MODE: slave
MysqL_REPLICATION_USER: repl_user
MysqL_REPLICATION_PASSWORD: repl_password
MysqL_MASTER_HOST: MysqL
MysqL_MASTER_PORT_NUMBER: 3306
MysqL_MASTER_ROOT_PASSWORD: rootpw
MysqL_ROOT_PASSWORD: rootpw
networks:
- my-net
myPHP:
build: ./src/PHP
restart: always
expose:
- "9000"
volumes:
- ./src:/var/www/html
depends_on:
- MysqL
- MysqL-slave
networks:
- my-net
myNginx:
image: Nginx
restart: always
volumes:
- ./src/Nginx.ini:/etc/Nginx/conf.d/default.conf
- ./src/PHP-fpm.conf:/etc/PHP/7.4/fpm/PHP-fpm.conf
- ./src/www.conf:/etc/PHP/7.4/fpm/pool.d/www.conf
- ./src:/var/www/html/
ports:
- "8080:80"
depends_on:
- myPHP
networks:
- my-net
网络: 我的网: 司机:桥
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)