【排错记录】免密、nginx、cgroup、sshd
1、免密登录回显很慢。
现象:
免密登录超级慢,而且巡检脚本跑不起来
解决:
vi /etc/ssh/sshd_config
GSSAPIAuthentication no
UseDNS no
systemctl restart sshd
2、nginx服务起不来
现象:
Redirecting to /bin/systemctl restart nginx.service
Not running (pidfile not found)
Started [2796]
Restarting php-fpm (via systemctl): Job for php-fpm.service failed because the control process exited with error code. See "systemctl statu
s php-fpm.service" and "journalctl -xe" for details.
[FAILED]
Connection to 172.25.44.70 closed.
[2025-01-09 15:15:15][Error] Launching worker at 172.25.44.70 Failed
[root@qingtengserver data]# systemctl restart php-fpm.service
Job for php-fpm.service failed because the control process exited with error code. See "systemctl status php-fpm.service" and "journalctl -x
e" for details.
[root@qingtengserver data]# systemctl status php-fpm.service
● php-fpm.service - LSB: starts php-fpm
Loaded: loaded (/etc/rc.d/init.d/php-fpm; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2025-01-09 15:17:19 CST; 11s ago
Docs: man:systemd-sysv-generator(8)
Process: 3935 ExecStart=/etc/rc.d/init.d/php-fpm start (code=exited, status=1/FAILURE)
Jan 09 15:17:19 qingtengserver php-fpm[3935]: Starting php-fpm [09-Jan-2025 15:17:19] NOTICE: [pool www] 'user' directive is ignor...as root
Jan 09 15:17:19 qingtengserver php-fpm[3935]: [09-Jan-2025 15:17:19] NOTICE: [pool www] 'group' directive is ignored when FPM is n...as root
Jan 09 15:17:19 qingtengserver php-fpm[3935]: [09-Jan-2025 15:17:19] ERROR: unable to bind listening socket for address '/dev/shm/...ed (13)
Jan 09 15:17:19 qingtengserver php-fpm[3935]: [09-Jan-2025 15:17:19] ERROR: FPM initialization failed
Jan 09 15:17:19 qingtengserver runuser[3940]: pam_unix(runuser:session): session closed for user nginx
Jan 09 15:17:19 qingtengserver php-fpm[3935]: [16B blob data]
Jan 09 15:17:19 qingtengserver systemd[1]: php-fpm.service: control process exited, code=exited status=1
Jan 09 15:17:19 qingtengserver systemd[1]: Failed to start LSB: starts php-fpm.
Jan 09 15:17:19 qingtengserver systemd[1]: Unit php-fpm.service entered failed state.
Jan 09 15:17:19 qingtengserver systemd[1]: php-fpm.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
解决:
错误信息:
ERROR: unable to bind listening socket for address '/dev/shm/...ed (13)
ERROR: FPM initialization failed
ls -ld /dev/shm
chmod 777 /dev/shm
3、安装k3s出现CPU cgroup问题。
现象:
Jan 10 10:17:49 qingtengserver dockerd[4747]: time="2025-01-10T10:17:49.241955022+08:00" level=warning msg="Unable to find cpu cgroup in mounts"
Jan 10 10:17:49 qingtengserver dockerd[4747]: time="2025-01-10T10:17:49.241974743+08:00" level=warning msg="Unable to find blkio cgroup in mounts"
Jan 10 10:17:49 qingtengserver dockerd[4747]: time="2025-01-10T10:17:49.241988963+08:00" level=warning msg="Unable to find cpuset cgroup in mounts"
Jan 10 10:17:49 qingtengserver dockerd[4747]: time="2025-01-10T10:17:49.242001892+08:00" level=warning msg="Unable to find pids cgroup in mounts"
Jan 10 10:17:49 qingtengserver dockerd[4747]: time="2025-01-10T10:17:49.242483541+08:00" level=info msg="stopping healthcheck following graceful shutdown" module=libcont
Jan 10 10:17:49 qingtengserver dockerd[4747]: time="2025-01-10T10:17:49.242505783+08:00" level=info msg="stopping event stream following graceful shutdown" error="contex
Jan 10 10:17:50 qingtengserver dockerd[4747]: failed to start daemon: Devices cgroup isn't mounted
Jan 10 10:17:50 qingtengserver systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Jan 10 10:17:50 qingtengserver systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Jan 10 10:17:50 qingtengserver systemd[1]: Unit docker.service entered failed state.
Jan 10 10:17:50 qingtengserver systemd[1]: docker.service failed.
Jan 10 10:17:50 qingtengserver systemd[1]: docker.service holdoff time over, scheduling restart.
Jan 10 10:17:50 qingtengserver systemd[1]: Stopped Docker Application Container Engine.
-- Subject: Unit docker.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has finished shutting down.
Jan 10 10:17:50 qingtengserver systemd[1]: start request repeated too quickly for docker.service
Jan 10 10:17:50 qingtengserver systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Jan 10 10:17:50 qingtengserver systemd[1]: Unit docker.service entered failed state.
Jan 10 10:17:50 qingtengserver systemd[1]: docker.service failed.
解决:
echo 'none /sys/fs/cgroup cgroup defaults 0 0' >> /etc/fstab
reboot
4、ssh服务启动失败
现象:
[root@qingtengserver x86_64]# systemctl status sshd
● sshd.service - SYSV: OpenSSH server daemon
Loaded: loaded (/etc/rc.d/init.d/sshd; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2025-01-10 17:28:31 CST; 1min 8s ago
Docs: man:systemd-sysv-generator(8)
Process: 485146 ExecStart=/etc/rc.d/init.d/sshd start (code=exited, status=1/FAILURE)
Jan 10 17:28:31 qingtengserver sshd[485146]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Jan 10 17:28:31 qingtengserver sshd[485146]: Permissions 0640 for '/etc/ssh/ssh_host_ed25519_key' are too open.
Jan 10 17:28:31 qingtengserver sshd[485146]: It is required that your private key files are NOT accessible by others.
Jan 10 17:28:31 qingtengserver sshd[485146]: This private key will be ignored.
Jan 10 17:28:31 qingtengserver sshd[485146]: sshd: no hostkeys available -- exiting.
Jan 10 17:28:31 qingtengserver sshd[485146]: [FAILED]
Jan 10 17:28:31 qingtengserver systemd[1]: sshd.service: control process exited, code=exited status=1
Jan 10 17:28:31 qingtengserver systemd[1]: Failed to start SYSV: OpenSSH server daemon.
Jan 10 17:28:31 qingtengserver systemd[1]: Unit sshd.service entered failed state.
Jan 10 17:28:31 qingtengserver systemd[1]: sshd.service failed.
解决:
ls -l /etc/ssh/ssh_host_*_key
chmod 600 /etc/ssh/ssh_host_*_key
chown root:root /etc/ssh/ssh_host_*_key
systemctl restart sshd
firewall-cmd --permanent --add-service=ssh
firewall-cmd --reload