gitlab部署、配置更改、备份及恢复gitlab部署
1、gitlab
官⽹ gitlab
Ubuntu14.04安装
1、Install and configure the necessary dependencies
sudoapt-get install postfix
2. Download the Omnibus package and install everything
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
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。
gitlab配置更改
2、gitlab
当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 'gitlab.sec'
gitlab_rails['gitlab_shell_ssh_port'] = 2222
nginx['listen_addresses']= ['10.18.103.1']
修改url是别⼈通过url拉取代码,IP对客户端透明。修改ssh port及nginx绑定IP等为环境需要解决冲突。
gitlab数据备份与恢复
3、gitlab
gitlab定时⾃动备份
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create
gitlab修改备份路径:
修改/etc/gitlab/gitlab.rb⽂件
gitlab_rails['backup_path'] = '/mnt/backups'
gitlab恢复
# 停⽌相关数据连接服务
bootstrappedgitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
# 从1393513186编号备份中恢复
gitlab-rake gitlab:backup:restore BACKUP=1393513186
# 启动Gitlab
sudo gitlab-ctl start
Gitlab迁移
把备份⽂件拷贝到gitlab的备份⽬录下,根据上⾯gitlab恢复步骤即可。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。