15 Star 10 Fork 50

src-openEuler / docker

 / 详情

安装docker-engine后,会使得环境中一些服务重启后出现权限问题

已完成
任务
创建于  
2020-12-17 19:35

【环境信息】
系统:arm及x86
源:everything
【问题复现步骤】
1、不安装docker-engine,测试一下服务的状态rtkit、firewalld、isulad
2、安装docker-engine,测试一下服务的状态rtkit、firewalld、isulad
3、以下服务出现问题:rtkit、firewalld、isulad
具体服务报错参见下面相关issue链接的评论。
【相关issue】
(1)rtkit
#I292QX:【20.03-SP1】重启rtkit服务,查看状态时会出现failedx
(2) firewalld
#I292Z2:【20.03-SP1】装完everything镜像,重启所有服务,journalctl -u firewalld查看会出现告警

评论 (3)

orange-snn 创建了任务
orange-snn 关联仓库设置为src-openEuler/docker
展开全部操作日志

Hey orange-snn, Welcome to openEuler Community.
All of the projects in openEuler Community are maintained by @openeuler-ci-bot.
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at https://gitee.com/openeuler/community/blob/master/en/sig-infrastructure/command.md to find the details.

orange-snn 关联分支设置为openEuler-20.03-LTS-SP1
orange-snn 修改了描述
small_leek 负责人设置为lifeng_isula
jing-rui 负责人lifeng_isula 修改为jing-rui

rtkit-daemon报错的原因是有服务(如docker.service)配置了Delegate=yes。

在没有配置该参数的情况下,rtkit-daemon的cgroup信息如下所示,此时服务表现正常。
[root@openEuler ~]# cat /proc/pidof rtkit-daemon/cgroup | grep system
12:pids:/system.slice/rtkit-daemon.service
7:devices:/system.slice/rtkit-daemon.service
5:memory:/system.slice/rtkit-daemon.service
2:blkio:/system.slice
1:name=systemd:/system.slice/rtkit-daemon.service

在配置了Delegate=yes的情况下,systemd会创建相关slice,并把cpu cgroup也移动到slice中。这样rtkit-daemon服务的cgroup信息如下所示。rtkit-daemon被移动到了3:cpu,cpuacct:/system.slice/rtkit-daemon.service 但是里面的cpu.rt_runtime_us又没有设置合理的数值,所以有报错。
[root@openEuler ~]# cat /proc/pidof rtkit-daemon/cgroup | grep system
12:pids:/system.slice/rtkit-daemon.service
7:devices:/system.slice/rtkit-daemon.service
5:memory:/system.slice/rtkit-daemon.service
3:cpu,cpuacct:/system.slice/rtkit-daemon.service
2:blkio:/system.slice/rtkit-daemon.service
1:name=systemd:/system.slice/rtkit-daemon.service

报错信息如下:
12月 18 09:34:15 openEuler systemd[1]: Started RealtimeKit Scheduling Policy Service.
12月 18 09:34:15 openEuler rtkit-daemon[22560]: Successfully called chroot.
12月 18 09:34:15 openEuler rtkit-daemon[22560]: Successfully dropped privileges.
12月 18 09:34:15 openEuler rtkit-daemon[22560]: Successfully limited resources.
12月 18 09:34:15 openEuler rtkit-daemon[22560]: Running.
12月 18 09:34:15 openEuler rtkit-daemon[22560]: Canary thread running.
12月 18 09:34:15 openEuler rtkit-daemon[22560]: Failed to make ourselves RT: Operation not permitted
12月 18 09:34:15 openEuler rtkit-daemon[22560]: Watchdog thread running.

解决方法一:修改rtkit-daemon.service,添加如下配置,这种方式即使用系统默认cpu cgroup配置。
Slice=-.slice
DisableControllers=cpu cpuacct

解决方法二:修改rtkit-daemon.service,添加如下配置,这种方法即根据需要配置调度参数。
ExecStartPre=/usr/bin/bash -c "mkdir -p /sys/fs/cgroup/cpu,cpuacct/system.slice/rtkit-daemon.service"
ExecStartPre=/usr/bin/bash -c "echo 950000 > /sys/fs/cgroup/cpu,cpuacct/system.slice/cpu.rt_runtime_us"
ExecStartPre=/usr/bin/bash -c "echo 950000 > /sys/fs/cgroup/cpu,cpuacct/system.slice/rtkit-daemon.service/cpu.rt_runtime_us"

docker和firewalld存在兼容问题,请参考
https://docs.docker.com/network/iptables/#integration-with-firewalld

firewall-cmd --zone=trusted --remove-interface=docker0 --permanent
firewall-cmd --reload

https://www.itzgeek.com/how-tos/linux/centos-how-tos/how-to-install-docker-on-centos-8-rhel-8.html
输入图片说明

总结:direwalld和docker存在兼容性问题,最好是把firewalld关了,如果您想要继续使用firewalld,请确保docker在firewalld之后启动。

jing-rui 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(3)
5329419 openeuler ci bot 1632792936
1
https://gitee.com/src-openeuler/docker.git
git@gitee.com:src-openeuler/docker.git
src-openeuler
docker
docker

搜索帮助