Masalahnya
Saat memulai lxc itu memberikan kesalahan di bawah ini:
lxc-start 1491315722.354 ERROR lxc_cgfs - Device or resource busy - failed to set memory.use_hierarchy to 1; continuing lxc-start 1491315722.354 ERROR lxc_cgfs - Device or resource busy - failed to set memory.use_hierarchy to 1; continuing lxc-start 1497957841.930 ERROR lxc_cgfs - Device or resource busy - failed to set memory.use_hierarchy to 1; continuing lxc-start 1497957841.937 ERROR lxc_cgfs - Device or resource busy - failed to set memory.use_hierarchy to 1; continuing
Solusinya
Mempertimbangkan skenario di mana kita mendapatkan Error:Device or resource busy – failed to set memory.use_hierarchy to 1; melanjutkan:
# lxc-start --name CentOS7 lxc-start: cgfs.c: handle_cgroup_settings: 2077 Device or resource busy - failed to set memory.use_hierarchy to 1; continuing systemd 208 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ) Detected virtualization 'lxc'. Welcome to CentOS Linux Server 7.1! Failed to insert module 'autofs4' Set hostname to [CentOS7]. [ OK ] Reached target Remote File Systems. [ OK ] Created slice Root Slice. [ OK ] Created slice User and Session Slice. [ OK ] Created slice System Slice. [ OK ] Reached target Slices. [ OK ] Created slice system-getty.slice.
Parameter /cgroup/memory/memory.use_hierarchy diatur ke 0 menyebabkan masalah. Gunakan perintah di bawah ini untuk memeriksa nilai parameter saat ini.
# cat /proc/mounts | grep -i mem cgroup /cgroup/memory cgroup rw,relatime,memory 0 0 # ls /cgroup/memory/memory.use_hierarchy /cgroup/memory/memory.use_hierarchy # cat /cgroup/memory/memory.use_hierarchy 0
Jika kami mencoba untuk menetapkan nilai ke 1, itu masih menghasilkan kesalahan yang sama:
# echo 1 > /cgroup/memory/memory.use_hierarchy -bash: echo: write error: Device or resource busy
Untuk menghilangkan Error :Device or resource busy – failed to set memory.use_hierarchy to 1; melanjutkan kita perlu mengikuti langkah-langkah di bawah ini:
- Hentikan wadahnya
- Hentikan layanan cgconfig
- Mulai layanan cgconfig
- Setel parameter /cgroup/memory/memory.use_hierarchy ke 1
- Mulai penampung
# lxc-stop --name CentOS7
# /etc/init.d/cgconfig stop Stopping cgconfig service: [ OK ]
# cat /proc/mounts | grep -i mem #
# /etc/init.d/cgconfig start Starting cgconfig service: [ OK ]
# cat /cgroup/memory/memory.use_hierarchy 0 # echo 1 > /cgroup/memory/memory.use_hierarchy # cat /cgroup/memory/memory.use_hierarchy 1
# lxc-start --name CentOS7 systemd 208 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ) Detected virtualization 'lxc'. Welcome to CentOS Server 7.1! Failed to insert module 'autofs4' Set hostname to. [ OK ] Reached target Remote File Systems. [ OK ] Created slice Root Slice.
-
Ikat ke port 22 pada 0.0.0.0 gagal:alamat sudah digunakan – kesalahan saat memulai layanan sshd CentOS/RHEL
-
"kesalahan:Mengikat ke port 2222 pada 0.0.0.0 gagal:Izin ditolak" – kesalahan saat memulai layanan sshd pada CentOS/RHEL
-
Kesalahan "peta sedang digunakan" saat menghapus perangkat multipath di CentOS/RHEL