Hiện tượng.
Nếu bạn tuân theo khuyến nghị cài đặt ổ cứng của chúng tôi (và của Zimbra) thì phân vùng /opt nên được tách riêng với phân vùng /.
Do không theo dõi và không thực hiện mở rộng kịp thời, đã có trường hợp /opt bị đầy 100% dẫn đến Zimbra ngừng hoạt động và bạn không thể restart lại Zimbra sau khi đã mở rộng dung lượng cho phân vùng này.
zmcontrol restart
Starting zmconfigd...Done.
Starting convertd...Done.
Starting mailbox...Done.
Starting spell...Done.
Starting stats...Failed.
Can't kill a non-numeric process ID at /opt/zimbra/bin/zmstatctl line 204.
Starting service webapp...Done.
Starting zimbra webapp...Done.
Starting zimbraAdmin webapp...Done.
Starting zimlet webapp...Done
Xem trạng thái của dịch vụ zimbra
zmcontrol status
convertd Running
mailbox Stopped
mysql.server is not running.
service webapp Stopped
mysql.server is not running.
spell Running
stats Running
zimbra webapp Stopped
mysql.server is not running.
zimbraAdmin webapp Stopped
mysql.server is not running.
zimlet webapp Stopped
mysql.server is not running.
zmconfigd Running
Log file trong /var/log/zimbra.log
cat /var/log/zimbra.log
Oct 13 03:46:19 mb zmmailboxdmgr[27399]: stale pid 13775 found in /opt/zimbra/log/zmmailboxd_manager.pid: No such process
Oct 13 03:46:19 mb zmmailboxdmgr[27399]: assuming no other instance is running
Oct 13 03:46:19 mb zmmailboxdmgr[27399]: file /opt/zimbra/log/zmmailboxd.pid does not exist
Oct 13 03:46:19 mb zmmailboxdmgr[27399]: assuming no other instance is running
Oct 13 03:46:19 mb zmmailboxdmgr[27399]: no manager process is running
Như vậy có lỗi liên quan đến các file .pid đang bị cũ (stale) trong /opt/zimbra/log và /opt/zimbra/zmstat/pid/
Cách xử lý
Tiến hành shutdown zimbra, tắt toàn bộ các dịch vụ chạy bởi zimbra và remove các file pid cũ.
Tắt zimbra
su - zimbra
zmcontrol stop
Thực hiện bởi quyền user root
ps -elf | grep -i zimbra
kill -9 <pid> #thay <pid> bằng các pid liệt kê trong câu lệnh ps ở trên.
Remove các file pid cũ
ls -ltr /opt/zimbra/log/*.pid
rm /opt/zimbra/log/*.pid #nhập Y khi được hỏi cho từng file.
ls -ltr /opt/zimbra/zmstat/pid/*.pid
rm /opt/zimbra/zmstat/pid/*.pid #nhập Y khi được hỏi cho từng file.
Liên quan đến lỗi mysql, xem log file /opt/zimbra/log/mysql_error.log
241013 22:58:04 mysqld_safe mysqld from pid file /opt/zimbra/log/mysql.pid ended
241013 23:04:49 mysqld_safe Starting mysqld daemon with databases from /opt/zimbra/db/data
2024-10-13 23:04:49 139839205083008 [Note] /opt/zimbra/common/sbin/mysqld (mysqld 10.1.25-MariaDB) starting as process 13877 ...
2024-10-13 23:04:50 139839205083008 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2024-10-13 23:04:50 139839205083008 [Note] InnoDB: The InnoDB memory heap is disabled
2024-10-13 23:04:50 139839205083008 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2024-10-13 23:04:50 139839205083008 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2024-10-13 23:04:50 139839205083008 [Note] InnoDB: Compressed tables use zlib 1.2.3
2024-10-13 23:04:50 139839205083008 [Note] InnoDB: Using Linux native AIO
2024-10-13 23:04:50 139839205083008 [Note] InnoDB: Using SSE crc32 instructions
2024-10-13 23:04:50 139839205083008 [Note] InnoDB: Initializing buffer pool, size = 7.0G
2024-10-13 23:04:50 139839205083008 [Note] InnoDB: Completed initialization of buffer pool
2024-10-13 23:04:50 139839205083008 [Note] InnoDB: Highest supported file format is Barracuda.
2024-10-13 23:04:50 139839205083008 [Note] InnoDB: 128 rollback segment(s) are active.
2024-10-13 23:04:50 139839205083008 [Note] InnoDB: Waiting for purge to start
2024-10-13 23:04:50 139839205083008 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.36-82.0 started; log sequence numbe r 1572998168
2024-10-13 23:04:50 139831107352320 [Note] InnoDB: Dumping buffer pool(s) not yet started
2024-10-13 23:04:50 139839205083008 [Note] Plugin 'FEEDBACK' is disabled.
2024-10-13 23:04:50 139839205083008 [Note] Recovering after a crash using tc.log
2024-10-13 23:04:50 139839205083008 [ERROR] Can't init tc log
2024-10-13 23:04:50 139839205083008 [ERROR] Aborting
241013 23:04:53 mysqld_safe mysqld from pid file /opt/zimbra/log/mysql.pid ended
Có thể thấy sự cố liên quan đến tc log (dòng Can’t init tc log). Tham khảo thêm tại đây.
Bạn chỉ cần đơn giản xóa hoặc đổi tên file /opt/zimbra/db/data/tc.log và khởi động mysql lại.
ls -la /opt/zimbra/db/data/tc.log
mv /opt/zimbra/db/data/tc.log /opt/zimbra/db/data/tc.log.old
su - zimbra
mysql.server start
Sau khi mysql server start ok, tiến hành khởi động zimbra
zmcontrol restart
zmcontrol status