Sunday, January 19, 2025

Xử lý lỗi service start limit-hit trong Linux

-

Nếu một ngày nào đó bạn gặp lỗi Failed with result start-limit-hit thì nguyên nhân xuất hiện là khi một dịch vụ (service) trên hệ điều hành Linux đã vượt quá số lần khởi động trong khoảng thời gian nhất định. Hệ thống Linux thường áp đặt các giới hạn này để tránh việc lặp lại không ngừng của một dịch vụ khi có sự cố.

Thông báo này thường đi kèm với một số thông tin khác về nguyên nhân mà dịch vụ không khởi động được. Điều này có thể là do lỗi cấu hình, lỗi trong mã nguồn của dịch vụ hoặc một vấn đề nào đó khác liên quan đến môi trường hệ thống.

shell> systemctl status ceph-osd@17
× ceph-osd@17.service - Ceph object storage daemon osd.17
     Loaded: loaded (/lib/systemd/system/ceph-osd@.service; enabled-runtime; preset: enabled)
    Drop-In: /usr/lib/systemd/system/ceph-osd@.service.d
             └─ceph-after-pve-cluster.conf
     Active: failed (Result: start-limit-hit) since Thu 2023-11-23 15:53:42 +07; 3min 29s ago
   Duration: 21.893s
    Process: 1697465 ExecStartPre=/usr/libexec/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --id 17 (code=exited, status=0/S>
    Process: 1697477 ExecStart=/usr/bin/ceph-osd -f --cluster ${CLUSTER} --id 17 --setuser ceph --setgroup ceph (code=killed, >
   Main PID: 1697477 (code=killed, signal=TERM)
        CPU: 12.964s

Nov 23 15:53:42 pve2 systemd[1]: Stopping ceph-osd@17.service - Ceph object storage daemon osd.17...
Nov 23 15:53:42 pve2 systemd[1]: ceph-osd@17.service: Deactivated successfully.
Nov 23 15:53:42 pve2 systemd[1]: Stopped ceph-osd@17.service - Ceph object storage daemon osd.17.
Nov 23 15:53:42 pve2 systemd[1]: ceph-osd@17.service: Consumed 12.964s CPU time.
Nov 23 15:53:42 pve2 systemd[1]: ceph-osd@17.service: Start request repeated too quickly.
Nov 23 15:53:42 pve2 systemd[1]: ceph-osd@17.service: Failed with result 'start-limit-hit'.

Để xem chi tiết lỗi bạn có thể dùng lệnh dưới.

shell> journalctl -xeu ceph-osd@17.service
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A stop job for unit ceph-osd@17.service has finished.
░░ 
░░ The job identifier is 49611 and the job result is done.
Nov 23 15:53:42 pve2 systemd[1]: ceph-osd@17.service: Consumed 12.964s CPU time.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ The unit ceph-osd@17.service completed and consumed the indicated resources.
Nov 23 15:53:42 pve2 systemd[1]: ceph-osd@17.service: Start request repeated too quickly.
Nov 23 15:53:42 pve2 systemd[1]: ceph-osd@17.service: Failed with result 'start-limit-hit'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ The unit ceph-osd@17.service has entered the 'failed' state with result 'start-limit-hit'.
Nov 23 15:53:42 pve2 systemd[1]: Failed to start ceph-osd@17.service - Ceph object storage daemon osd.17.
░░ Subject: A start job for unit ceph-osd@17.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit ceph-osd@17.service has finished with a failure.
░░ 
░░ The job identifier is 49611 and the job result is failed.
Nov 23 15:56:00 pve2 systemd[1]: ceph-osd@17.service: Start request repeated too quickly.
Nov 23 15:56:00 pve2 systemd[1]: ceph-osd@17.service: Failed with result 'start-limit-hit'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ The unit ceph-osd@17.service has entered the 'failed' state with result 'start-limit-hit'.
Nov 23 15:56:00 pve2 systemd[1]: Failed to start ceph-osd@17.service - Ceph object storage daemon osd.17.
░░ Subject: A start job for unit ceph-osd@17.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit ceph-osd@17.service has finished with a failure.
░░ 
░░ The job identifier is 49909 and the job result is failed.
lines 319-360/360 (END)

Cách giải quyết là bạn sử dụng lệnh reset-failed để clear lịch sử của hành động này.

systemctl reset-failed ceph-mgr@pve-03

Bây giờ bạn có thể sử dụng hành động start lại như bình thường.

systemctl start ceph-mgr@pve-03

Và dưới đây là kết quả.

shell> systemctl status ceph-osd@17
● ceph-osd@17.service - Ceph object storage daemon osd.17
     Loaded: loaded (/lib/systemd/system/ceph-osd@.service; enabled-runtime; preset: enabled)
    Drop-In: /usr/lib/systemd/system/ceph-osd@.service.d
             └─ceph-after-pve-cluster.conf
     Active: active (running) since Thu 2023-11-23 15:58:48 +07; 34s ago
    Process: 1699777 ExecStartPre=/usr/libexec/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --id 17 (code=exited, status=0/S>
   Main PID: 1699783 (ceph-osd)
      Tasks: 29
     Memory: 1.4G
        CPU: 27.667s
     CGroup: /system.slice/system-ceph\x2dosd.slice/ceph-osd@17.service
             └─1699783 /usr/bin/ceph-osd -f --cluster ceph --id 17 --setuser ceph --setgroup ceph

Nov 23 15:58:48 pve2 systemd[1]: Starting ceph-osd@17.service - Ceph object storage daemon osd.17...
Nov 23 15:58:48 pve2 systemd[1]: Started ceph-osd@17.service - Ceph object storage daemon osd.17.

Nguồn tham khảo https://mariobrandt.de/archives/linux/proxmox-how-to-resolve-service-start-limit-hit-1552/

LEAVE A REPLY

Please enter your comment!
Please enter your name here

4,956FansLike
256FollowersFollow
223SubscribersSubscribe
spot_img

Related Stories