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
Git升级迁移的更多相关文章
- gitlab升级迁移(二)
前面我们写了一篇gitlab升级迁移的文章(https://www.cnblogs.com/liangyou666/p/9434158.html),这次我们主要是讲另一种升级迁移方法和其中遇到的一些问 ...
- Git 升级与基础适用
Git 升级 老方法 yum install git 目前centos6安装的 git 版本为1.7相对于 github 以及自己安装的 git 服务器都相对比较老,所以一般不适用此方法安装) 编译安 ...
- centos git 升级应用
在阿里云服务器上部署Git 升级centos 自带的Git yum库自带版本为git1.7.1-3.el6_4.1. -------------------升级-------------------- ...
- git仓库迁移和更新远程仓库地址
一.git仓库迁移 1,从原仓库clone或pull到本地仓库 git clone project_name [old_remote_repository_address] 2,在新的git创建一 ...
- GIT工程迁移方法总结
Git工程迁移方法总结 Git最近准备迁移一下位置,这里采用命令行的方式,做如下操作. 1.git init 初始化git仓库,这个时候发现本地文件夹多了个.git的文件夹. 2.git remot ...
- Git工程迁移方法总结(命令行)
Git工程迁移方法总结 Git工程迁移方法总结 Git最近准备迁移一下位置,这里采用命令行的方式,做如下操作. 1.git init 初始化git仓库,这个时候发现本地文件夹多了个.git的文件夹. ...
- git 仓库迁移,git remote 更改源
git仓库迁移 我们有时候需要迁移git仓库,但又想保留每次commit的记录,所以我们只需要更改git remote [源]的问题即可 首先查看你的remote的地址 git remote -vv ...
- Git工程迁移方法总结(命令行) .(转载)
原文地址:http://blog.csdn.net/hongshan50/article/details/236630433 Git工程迁移方法总结 Git工程迁移方法总结 Git最近准备迁移一下位置 ...
- git仓库迁移的两种解决方案
Git仓库迁移而不丢失log的方法 要求能保留原先的commit记录,应该如何迁移呢? 同时,本地已经clone了原仓库,要配置成新的仓库地址,该如何修改呢? 注意:如果使用了代码审核工具Gerrit ...
随机推荐
- Vue的十个常用指令
1.v-text:用于更新标签包含的文本,作用和{{}}的效果一样. 2.v-html:绑定一些包含html代码的数据在视图上. 3.v-show:用来控制元素的display属性,和显示隐藏有关.v ...
- cvLoadImage,cvCloneImage的内存泄露问题
本文转自: http://hi.baidu.com/%C3%A8%D1%DB%D3%E3/blog/item/9d947e1b2b05555742a9adfd.html/cmtid/9872c2260 ...
- 自定义可伸缩的imageView
直接上代码 /** * 自定义可伸缩的ImageView */ public class ZoomImageView extends ImageView { /** 画笔类 **/ private P ...
- ftpclient 遇到的一些问题
1. FTPFile[] files=ftpClient.listFiles(ftpDirectory); 没有数据 public static boolean ftpLogin(String ser ...
- Stream.iterate方法与UnaryOperator
前提:本人在翻看<Java核心技术II>的时候在p17的时候发现一段代码不是很明白.不知道为什么就输出了1,2,3,4,5,6,7,8,9,10,...也不知道n-n.add(BigInt ...
- 搭建一个入门springboot工程
springboot工程搭建(入门案例) 第一步:创建maven工程 第二步:设置项目信息 第三步:默认项目名称,不用改动(第二步已填写) 第三步:在pom.xml中导入依赖 SpringBoot要 ...
- django连接Oracle过程中出现的问题
开始时版本信息: python 3.6 + ce_oracle 6 最终版本信息: python 3.5 + ce_oracle 5.2 ce_oracle版本问题 cx_Oracle-5 ...
- CPP-基础:C++拷贝构造函数详解
一. 什么是拷贝构造函数 首先对于普通类型的对象来说,它们之间的复制是很简单的,例如: ; int b = a; 而类对象与普通对象不同,类对象内部结构一般较为复杂,存在各种成员变量.下面看一个类对象 ...
- vue 动态合并单元格、并添加小计合计功能
1.效果图 2.后台返回数据格式(平铺式) 3.后台返回数据后,整理所需要展示的属性存储到(items)数组内 var obj = { "id": curItems[i].id, ...
- ubuntu 16.04 安装node.js 8.x
引自 https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04#how-to-in ...