Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏多维度架构

117.11. FAQ

117.11.1. 查看日志

				
gitlab-ctl tail
gitlab-ctl tail gitlab-rails
gitlab-ctl tail nginx/gitlab_error.log				
				
		

117.11.2. debug runner

				
gitlab-runner -debug run				
				
		

117.11.3. gitolite 向 gitlab 迁移

早期gitlab使用gitolite为用户提供SSH服务,新版gitlab有了更好的解决方案gitlab-shell。安装新版本是必会涉及gitolite 向 gitlab 迁移,下面是我总结的一些迁移经验。

第一步,将gitolite复制到gitlab仓库目录下

# cp -r /gitroot/gitolite/repositories/* /var/opt/gitlab/git-data/repositories/
			

执行导入处理程序

# gitlab-rake gitlab:import:repos
			

上面程序会处理一下目录结构,例如

进入gitlab web界面,创建仓库与导入的仓库同名,这样就完成了导入工作。

[提示]提示

转换最好在git用户下面操作,否则你需要运行

# chown git:git -R /var/opt/gitlab/git-data/repositories				
				

117.11.4. 修改主机名

默认Gitlab采用主机名,给我使用代理一定麻烦

git@hostname:example.com/www.example.com.git
http://hostname/example.com/www.example.com.git
			

我们希望使用IP地址替代主机名

git@172.16.0.1:example.com/www.example.com.git
http://172.16.0.1/example.com/www.example.com.git
			

编辑 /etc/gitlab/gitlab.rb 配置文件

external_url 'http://172.16.0.1'
			

重新启动Gitlab

# gitlab-ctl reconfigure
# gitlab-ctl restart
			

117.11.5. ERROR: Uploading artifacts as "archive" to coordinator... too large archive

持续集成提示错误

			
ERROR: Uploading artifacts as "archive" to coordinator... too large archive  id=185 responseStatus=413 Request Entity Too Large status=413 token=HKerPDE6
FATAL: too large                                   
ERROR: Job failed: exit status 1			
			
		

解决方案

Admin - Settings - CI/CD - Continuous Integration and Deployment

点击 Expand 展开配置项

Maximum artifacts size (MB): 修改构建无最大尺寸

117.11.6. ERROR: Job failed (system failure): prepare environment: waiting for pod running: timed out waiting for pod to start. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information

Kubernetes 执行器提出该错误,分析原因是 pull 镜像超时。

解决方法,设置 poll_timeout = 3600

117.11.7. 磁盘 100% 怎样清理

删除过期的构建物

		
[root@netkiller ~]# rm -rf /opt/gitlab/data/gitlab-rails/shared/artifacts/*/*/*/2021_*
		
		

清理日志

		
[root@netkiller ~]# find /opt/gitlab/logs -name "*.gz" -exec rm -rf {} \;