Jnu2021 发表于 2024-12-6 10:46:08

docker-compose启动greatsql失败

2024-12-06T10:10:29.104640+08:00 0 Basedir set to /usr/.
2024-12-06T10:10:29.104657+08:00 0 /usr/sbin/mysqld (mysqld 8.0.32-26) starting as process 53
2024-12-06T10:10:29.109954+08:00 0 Could not open file './error.log' for error logging: Permission denied
2024-12-06T10:10:29.110181+08:00 0 Aborting
2024-12-06T10:10:29.110255+08:00 0 Binlog end
2024-12-06T10:10:29.110452+08:00 0 /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.32-26)GreatSQL (GPL), Release 26, Revision a68b3034c3d.

权限应该是都加上了吧
下面是install.sh里的命令
export mem_greatsql=512m
chmod 755 $CURDIR/../../data/greatsql/logs/error.log
chown mysql:mysql /etc/my.cnf
chown -R mysql:mysql /var/log
chmod -R 755 /var/log
docker-compose -f$CURDIR/../../config/docker-compose-yml/greatsql.yml -p greatsql up -d greatsql


下面是docker-compose映射
volumes:
      - ../../data/greatsql/logs/error.log:/data/GreatSQL/error.log
      - ../../data/greatsql/config/my.cnf:/etc/my.cnf
      - ../../data/greatsql/config/my.client.cnf:/etc/my.client.cnf
      - ../../data/greatsql/init:/docker-entrypoint-initdb.d/
      - ../../data/greatsql/sh/greatsql-init.sh:/greatsql-init.sh





yejr 发表于 2024-12-6 10:55:46

不建议把针对单个 error.log 文件做映射到docker里,建议映射整个目录

看你的 install.sh 脚本里只修改了 error.log 文件的权限模式及,但没修改其属主以及上一级目录,应该是这个原因造成的权限不足

说句题外话,感觉GreatSQL镜像被你改的面目全非,有点乱套了,在没能熟练玩转docker前,不建议做这么深度的自定义改动
页: [1]
查看完整版本: docker-compose启动greatsql失败