gitlab部署、配置更改、备份及恢复

简介: 1、gitlab部署官网 gitlab.comUbuntu14.04安装1、Install and configure the necessary dependenciessudoapt-get install postfix2.

1gitlab部署

官网 gitlab.com

Ubuntu14.04安装

1Install and configure the necessary dependencies

sudoapt-get install postfix

2. Download the Omnibus package and install everything

wgethttps://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.9.4-omnibus.1-1_amd64.deb

sudodpkg -i gitlab_7.9.4-omnibus.1-1_amd64.deb

3. Configure and start GitLab

sudogitlab-ctl reconfigure

4. Browse to the hostname and login

Username: root
Password: 5iveL!fe

Centos6部署

1.Install and configure the necessary dependencies

sudo yum install postfix

sudo yum install cronie

sudo service postfix start

sudo chkconfig postfix on

sudo lokkit -s http -s ssh

2.Download the Omnibus package and install everything

curl -O https://downloads-packages.s3.amazonaws.com/centos-6.6/gitlab-7.9.4_omnibus.1-1.el6.x86_64.rpm

sudo rpm -i gitlab-7.9.4_omnibus.1-1.el6.x86_64.rpm

3.Configure and start GitLab

sudo gitlab-ctl reconfigure

4.Browse to the hostname and login

Username: root
Password: 5iveL!fe

 

安装完成后,在浏览器输入gitlab服务器的IP地址,就可以访问。用户名root,密码是5iveL!fe

wKiom1V1tyLwlG5ZAACeGb6ufz8984.jpg

2gitlab配置更改

gitlab安装完成后,根据自己的环境,要修改配置。

如:

gitlab修改nginx端口,绑定IP

gitlab修改ssh端口

gitlab修改访问url

gitlab修改数据库类型(这个没必要,因为这里的数据库只存储些用户名,gitlab代码放在/var/opt/gitlab/git-data/下)

gitlab修改redis,gunicorn配置等等

所有的配置在/etc/gitlab/gitlab.rb中修改,修改完配置后执行gitlab-ctl reconfigure生效

 

gitlab所有的工程目录都在/var/opt/gitlab/

# ls /var/opt/gitlab/

backups bootstrapped  git-data  gitlab-rails gitlab-shell  logrotate  nginx  postgresql  redis

 

修改配置示例:

#grep -v '#' gitlab.rb |grep -v ^$

external_url 'http://gitlab.sec.com'

gitlab_rails['gitlab_shell_ssh_port'] = 2222

 nginx['listen_addresses']= ['10.18.103.1']

修改url是别人通过url拉取代码,IP对客户端透明。修改ssh portnginx绑定IP等为环境需要解决冲突。

 

3gitlab数据备份与恢复

gitlab定时自动备份

0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create

 

gitlab修改备份路径

修改/etc/gitlab/gitlab.rb文件

gitlab_rails['backup_path'] = '/mnt/backups'

 

gitlab恢复

# 停止相关数据连接服务

gitlab-ctl stop unicorn

gitlab-ctl stop sidekiq

 

# 1393513186编号备份中恢复

gitlab-rake gitlab:backup:restore BACKUP=1393513186

 

# 启动Gitlab

sudo gitlab-ctl start

 

Gitlab迁移

把备份文件拷贝到gitlab的备份目录下,根据上面gitlab恢复步骤即可。

 


相关文章
|
3月前
|
存储 Kubernetes 数据库
小笔记:关于 gitlab 运行 gitlab-ctl reconfigure 后数据清空(gitlab数据备份与恢复)
小笔记:关于 gitlab 运行 gitlab-ctl reconfigure 后数据清空(gitlab数据备份与恢复)
101 0
|
5月前
|
jenkins 持续交付
Jenkins备份配置
Jenkins备份配置
35 0
|
10月前
|
存储 Kubernetes 安全
gitlab小笔记:关于 gitlab 运行 `gitlab-ctl reconfigure` 数据清空(gitlab数据备份与恢复)
gitlab小笔记:关于 gitlab 运行 `gitlab-ctl reconfigure` 数据清空(gitlab数据备份与恢复)
531 1
|
11月前
|
SQL 关系型数据库 MySQL
kkitDeploy功能之--备份系统介绍
kkitDeploy功能之--备份系统介绍
|
jenkins 持续交付 开发工具
|
测试技术 数据库 数据库连接
Confluence 6 从生产环境中恢复一个测试实例
请参考 Restoring a Test Instance from Production 页面中的内容获得更多完整的说明。
1117 0
|
关系型数据库 Linux Shell
Confluence 6 用户提交的备份和恢复脚本
下面的代码是用户提交的,在使用的时候需要小心,因为 Atlassian 不提供这些代码的技术支持。如果你在使用或者修改这些代码的时候有任何问题,请粘贴到 post them to Atlassian Answers。
1357 0