搭建猪齿鱼0.6.0出现权限问题

  • Choerodon平台版本: 0.6.0

  • 遇到问题的执行步骤:
    使用helm安装redis,mysql等数据库的时候会有权限问题,报如下错误,
    redis
    [root@master ~]# kubectl logs devops-redis-c57554c5d-6qx9j -n choerodon-devops-prod
    1:C 11 Jun 12:29:42.783 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
    1:C 11 Jun 12:29:42.783 # Redis version=4.0.2, bits=64, commit=00000000, modified=0, pid=1, just started
    1:C 11 Jun 12:29:42.783 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
    1:M 11 Jun 12:29:42.786 * Running mode=standalone, port=6379.
    1:M 11 Jun 12:29:42.786 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
    1:M 11 Jun 12:29:42.786 # Server initialized
    1:M 11 Jun 12:29:42.786 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
    1:M 11 Jun 12:29:42.786 # Fatal error loading the DB: Permission denied. Exiting.

mysql
[root@master ~]# kubectl logs choerodon-mysql-dcb9b88cd-z8pdf -n choerodon-devops-prod
Initializing database
mysqld: Can’t create/write to file ‘/var/lib/mysql/is_writable’ (Errcode: 13 - Permission denied)
2018-06-12T01:42:58.253855Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-06-12T01:42:58.255613Z 0 [ERROR] --initialize specified but the data directory exists and is not writable. Aborting.
2018-06-12T01:42:58.255628Z 0 [ERROR] Aborting

@xinghao 调整下对应目录的权限,mysql等启动时默认不是root用户和您执行命令的用户无关。

redis,mysql等在容器里运行,会和宿主机上的目录权限有关吗?

如果目录只能root读写,而容器中的用户为非root,则容器中的应用无法读写相应目录。

那请问怎么控制容器里的使用的用户呢?直接用helm包管理器安装的。

官方mysql镜像默认不是root用户,建议你修改相关文件夹权限。

The WARNING appeared in Redis container is nothing about permission, it is about kernel parameters which is related with Redis performance.

I found Redis Docker Image official team has anwsered about how to fix this problem.
You can see this Github issue:
Fix Redis container warning problems