Git升级迁移
1 原有机器进行升级和备份:
https://about.gitlab.com/update/#centos-6 1. Make a backup (Optional) If you would like to make a backup before updating, the below command will backup data in /var/opt/gitlab/backups by default. sudo gitlab-rake gitlab:backup:create STRATEGY=copy . Update GitLab Update to the latest version of GitLab. sudo yum install -y gitlab-ce
2 新机器上安装社区版:
3 修改配置文件(可选,为改端口)
1) vim /etc/gitlab/gitlab.rb
#unicorn['port'] =
-->改为 unicorn['port'] =
#nginx['listen_port'] = nil
-->改为 nginx['listen_port'] = 5091
2) vim /var/opt/gitlab/gitlab-rails/etc/unicorn.rb #listen "127.0.0.1:8080", :tcp_nopush => true
--> 改为 listen "127.0.0.1:8070", :tcp_nopush => true
3)vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
#listen *:;
--> 改为 listen *:;
gitlab-ctl reconfigure
gitlab-ctl restart
4 nginx 转发配置(可选),
新建 gitlab-http.conf 放到独立nginx下 upstream gitlab-workhorse {
server unix:/var/opt/gitlab/gitlab-workhorse/socket;
} server {
listen ;
server_name gitlab.xf120.com; location / {
proxy_pass http://gitlab.xxx.com:5091;
} }
5 还原
- sudo cp xxx_gitlab_backup.tar /var/opt/gitlab/backups/
- sudo gitlab-ctl stop unicorn
- sudo gitlab-ctl stop sidekiq
- sudo gitlab-rake gitlab:backup:restore BACKUP=xxx 注:xxx是第1步备份文件的前缀
- sudo gitlab-ctl start
- sudo gitlab-rake gitlab:check SANITIZE=true
http://blog.csdn.net/jenyzhang/article/details/53928438
6 卸载gitlab
sudo gitlab-ctl stop
sudo rpm -e gitlab-ce
ps -ef|grep gitlab 会看到如下一个进程
runsvdir -P /opt/gitlab/service log: ........................................................................
..............................................................................................................
..............................................................................................................
.......................................................................................................
把它kill掉
7 修改邮箱(未验证)
配置smtp邮件发送
$ sudo vi /etc/gitlab/gitlab.rb
# Change the external_url to the address your users will type in their browser
external_url 'http://xxhost.com' #Sending application email via SMTP
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] =
gitlab_rails['smtp_user_name'] = "xxuser@163.com"
gitlab_rails['smtp_password'] = "xxpassword"
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = :login
gitlab_rails['smtp_enable_starttls_auto'] = true ##修改gitlab配置的发信人
gitlab_rails['gitlab_email_from'] = "xxuser@163.com"
user["git_user_email"] = "xxuser@163.com"
疑难解答:
1)gitlab上传文件大小限制
# 1修改nginx conf(如果使用了nginx转发,转发的nginx和内部nginx都设置一下)
http内添加client_max_body_size http{
client_max_body_size ;
} # 设置postBuffer(服务器和本地上都设一下)
单独项目设置:
git config http.postBuffer
全局设置:
git config --global http.postBuffer # 重启 nginx 和 gitlab
sudo service nginx restart
sudo gitlab-ctl restart
2)有时候文件过多,下载超时,修改如下:
/var/opt/gitlab/gitlab-rails/etc/unicorn.rb timeout
3) 检查错误
sudo gitlab-ctl status
ok: run: gitaly: (pid 10432) 1s
ok: run: gitlab-monitor: (pid 10480) 1s
ok: run: gitlab-workhorse: (pid 10499) 0s
ok: run: logrotate: (pid 10517) 1s
ok: run: nginx: (pid 10580) 0s
ok: run: node-exporter: (pid 10808) 0s
timeout: down: postgres-exporter: 1s, normally up, want up --有问题的进程
timeout: run: postgresql: (pid 10564) 67237s --有问题的进程
ok: run: prometheus: (pid 13058) 0s
ok: run: redis: (pid 13085) 1s
ok: run: redis-exporter: (pid 13104) 0s
ok: run: sidekiq: (pid 13153) 0s
ok: run: unicorn: (pid 13173) 0s
查看日志
gitlab-ctl tail postgres-exporter
最新文章
- OpenCascade Eigenvalues and Eigenvectors of Square Matrix
- 使H1 H2等标签不换行
- JVM中对象的创建过程
- VS.Net 2015 Update3 学习(2) jquery-form, jquery-validation,jquery-validation-unobtrusive一起用
- SSRS报表连接超时的问题
- jQuery1.9.1源码分析--数据缓存Data模块
- LeetCode 326 Power of Three
- 《30天自制操作系统》12_day_学习笔记
- 【温故而知新-Javascript】理解 DOM
- POJ 3440 Coin Toss(概率)
- ECSHOP给分类添加图
- python实现字体闪图
- [terry笔记]IMPDP报错ORA-39083 Object type TYPE failed to create ORA-02304
- spring mvc 参数传递的三种方式
- QQ空间魔力日志大全SduSRZ
- angular指令中的preLink函数和postLink函数
- bzoj 1875: [SDOI2009]HH去散步
- 《常见排序算法--PHP实现》
- log4j2.xml日志文件设置文件路径
- LCD_FSMC