IT评测·应用市场-qidao123.com
标题:
【gitlab故障解决】服务器不测关闭后,gitlab启动网页提示500
[打印本页]
作者:
数据人与超自然意识
时间:
2025-3-12 05:36
标题:
【gitlab故障解决】服务器不测关闭后,gitlab启动网页提示500
故障描述
gitlab版本:17.3
操纵系统:ubuntu-server 24.04
故障缘故原由:服务器不测关机
故障征象:网页访问gitlab提示500
解决过程:
1.登录服务器检察gitlab组件运行状态
gitlab-ctl status
复制代码
发现redis服务没有运行
2.检察 gitlab redis 组件的日志
sudo gitlab-ctl tail reids
复制代码
表现故障
WARNING Memory overcommit must be enabled! Without it,
a background save or replication may fail under low memory condition.
Being disabled, it can can also cause failures without low memory condition,
see https://github.com/jemalloc/jemalloc/issues/1328.
To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.
conf and then reboot or run the command 'sysctl vm.overcommit_memory=1
' for this to take effect.
复制代码
3.根据提示,检察 vm.overcommit_memory 的值为0
cat /proc/sys/vm/overcommit_memory
复制代码
设置 vm.overcommit_memory 为 1
sysctl vm.overcommit_memory=1
复制代码
此时检察 overcommit_memory 值为 1
参考链接: Redis 优化之内存分配控制 vm.overcommit_memory
4.重新启动gitlab
gitlab-ctl restart
复制代码
网页端仍然表现500
redis服务依然没有运行
5.继续检察 gitlab redis 日志
表现故障变为
Wrong signature trying to load DB from file
Fatal error loading the DB: Invalid argument. Exiting.
复制代码
6.此时停止 gitlab ,删除 /var/opt/gitlab/redis/dump.rdb 这个文件
删除之前先备份
mkdir backup
cp -R /var/opt/gitlab/redis/dump.rdb backup
rm /var/opt/gitlab/redis/dump.rdb
复制代码
7.重新启动 gitlab
全部组件正常运行,网页规复正常
sudo gitlab-ctl start
sudo gitlab-ctl status
复制代码
参考链接: gitlab500错误,redis无法启动
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
欢迎光临 IT评测·应用市场-qidao123.com (https://dis.qidao123.com/)
Powered by Discuz! X3.4