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 新机器上安装社区版:

https://about.gitlab.com/installation/#centos-6?version=ce

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 还原

  1. sudo cp xxx_gitlab_backup.tar  /var/opt/gitlab/backups/
  2. sudo gitlab-ctl stop unicorn
  3. sudo gitlab-ctl stop sidekiq
  4. sudo gitlab-rake gitlab:backup:restore BACKUP=xxx       注:xxx是第1步备份文件的前缀
  5. sudo gitlab-ctl start
  6. sudo gitlab-rake gitlab:check SANITIZE=true

  http://blog.csdn.net/jenyzhang/article/details/53928438

6 卸载gitlab

http://www.bubuko.com/infodetail-2310132.html

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

最新文章

  1. OpenCascade Eigenvalues and Eigenvectors of Square Matrix
  2. 使H1 H2等标签不换行
  3. JVM中对象的创建过程
  4. VS.Net 2015 Update3 学习(2) jquery-form, jquery-validation,jquery-validation-unobtrusive一起用
  5. SSRS报表连接超时的问题
  6. jQuery1.9.1源码分析--数据缓存Data模块
  7. LeetCode 326 Power of Three
  8. 《30天自制操作系统》12_day_学习笔记
  9. 【温故而知新-Javascript】理解 DOM
  10. POJ 3440 Coin Toss(概率)
  11. ECSHOP给分类添加图
  12. python实现字体闪图
  13. [terry笔记]IMPDP报错ORA-39083 Object type TYPE failed to create ORA-02304
  14. spring mvc 参数传递的三种方式
  15. QQ空间魔力日志大全SduSRZ
  16. angular指令中的preLink函数和postLink函数
  17. bzoj 1875: [SDOI2009]HH去散步
  18. 《常见排序算法--PHP实现》
  19. log4j2.xml日志文件设置文件路径
  20. LCD_FSMC

热门文章

  1. this详解,对执行上下文说 Yes
  2. Vuex.js状态管理共享数据 - day8
  3. JS基础1 — 代码要注意的一些问题
  4. 20170308web作业1
  5. 基于Myeclipse的三大框架(SSH)整合
  6. VM中python2.7运行skier游戏,shell重启问题!!!!!!
  7. 微信程序开发系列教程(四)使用微信API创建公众号自定义菜单
  8. ConCurrent in Practice小记 (4)
  9. Mac终端(Terminal)自定义颜色,字体,背景
  10. 一、新手必会Python基础