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 ...
随机推荐
- IOS开发之----详解在IOS后台执行
文一 我从苹果文档中得知,一般的应用在进入后台的时候可以获取一定时间来运行相关任务,也就是说可以在后台运行一小段时间. 还有三种类型的可以运行在后以,1.音乐2.location 3.voip 文二 ...
- Azure 项目构建 - 构建 WordPress 网站
本课程主要介绍了如何基于 Azure Web 应用和 WordPress 快速构建网站,实践讲解如何使用 Azure Web 应用,创建并连接 MySQL Database on Azure, 使用 ...
- codevs 2919 选择题
时间限制: 1 s 空间限制: 16000 KB 题目等级 : 黄金 Gold 题目描述 Description 某同学考试,在N*M的答题卡上写了A,B,C,D四种答案. 他做完了,又不能交,一 ...
- JavaScript的语音识别
有没有想过给您的网站增添语音识别的功能?比如您的用户不用点鼠标,仅仅通过电脑或者手机的麦克风发布命令,比如"下拉到页面底部",或者"跳转到下一页",您的网站就会 ...
- 欧拉函数求在1-n-1与n互质的个数
long long phi(long long x) { long long res=x,a=x,i; ;i*i<=a;i++) { ) { res=res/i*(i-); ) a=a/i; } ...
- sql视图和表的区别
整理一下视图和表的区别 区别: 1.视图是已经编译好了的sql,表不是 2.视图没有实际的物理存储记录,表有 3.视图是逻辑概念,表可以进行修改 5.表是内模式,视图是外模式 6.视图是我们查看表的方 ...
- NASM 之 helloworld1
SECTION .data msg: db "Hello World!", 0x0a len: equ $-msg SECTION .text global _main kerne ...
- centos7设置sshd端口,firewall,selinux设置
https://blog.csdn.net/qq_31927797/article/details/81095829 #停止firewallsystemctl stop firewalld.servi ...
- Hibernate 中批量处理数据
一.批量处理操作 批量处理数据是指在一个事务场景中处理大量数据.在应用程序中难以避免进行批量操作,Hibernate提供了以下方式进行批量处理数据: (1)使用HQL进行批量操作 数据库层面 ...
- Spring 概念及特点 Spring下载地址 控制反转IoC实现原理
Spring下载地址 http://repo.springsource.org/libs-release-local/org/springframework/spring/ Spring是开源full ...