我正在运行influx arm 64arm 64 v8/influxdbdocker image作为容器,但面临以下权限拒绝问题。有人可以帮助解决这个问题吗?先谢谢你。
admin@ynm583:~/***/***/***fa$ docker logs 0b3
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
mkdir: cannot create directory '/var/lib/influxdb2/engine': Permission denied
3条答案
按热度按时间4xrmg8kj1#
我在OpenShift中运行influxdb时遇到过这个问题。OpenShift工作中的问题是:它以非root用户的身份运行容器。看到这个和this
fsi0uk1n2#
这可能是用户权限问题:确保允许用户
admin
执行docker
命令。这可以通过命令sudo usermod -a -G docker $(whoami)
来完成(您可能需要重新启动终端会话/系统才能使其生效)。或者,您可以使用
sudo
运行docker
(-compose
)命令(但不鼓励这样做)。wqnecbli3#
[student@workstation ~]$ oc logs docker-nginx ...output omitted.../docker-entrypoint.sh:配置完成;准备启动2022/12/02 18:51:45 [警告] 1#1:只有当主进程以超级用户权限运行时,“user”指令才有意义,在/etc/nginx/nginx中忽略。conf:2 nginx:[warn]只有当主进程以超级用户权限运行时,“user”指令才有意义,在/etc/nginx/nginx中忽略。conf:2 2022/12/02 18:51:45 [emerg] 1#1:mkdir()“/var/cache/nginx/client_temp”失败(13:Permission denied)nginx:[emerg] mkdir()“/var/cache/nginx/client_temp”失败(13:Permission denied)由于nginx目录的权限问题,pod无法启动。
为docker-nginx pod创建调试pod。
[student@workstation ~]$ oc debug pod/docker-nginx Starting pod/docker-nginx-debug... Pod IP:10.8.0.72如果您没有看到命令提示符,请尝试按Enter。
$在debug pod中,验证/etc/nginx和/var/cache/nginx目录的权限。
$ ls -la /etc/|grep nginx drwxr-xr-x。3 root root 132 Nov 15 13:14 nginx $ ls -la /var/cache| grep nginx drwxr-xr-x。2 root root 6 Oct 19 09:32 nginx