gitlab部署、配置更改、备份及恢复
2015-06-08 23:39
671 查看
1、gitlab部署
官网 gitlab.comUbuntu14.04安装
1、Install and configure the necessary dependenciessudoapt-get install postfix2. Download the Omnibus package and install everything
wgethttps://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.9.4-omnibus.1-1_amd64.debsudodpkg -i gitlab_7.9.4-omnibus.1-1_amd64.deb3. Configure and start GitLab
sudogitlab-ctl reconfigure4. Browse to the hostname and login
Username: root
Password: 5iveL!fe
Centos6部署
1.Install and configure the necessary dependenciessudo 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。
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 'http://gitlab.sec.com'
gitlab_rails['gitlab_shell_ssh_port'] = 2222
nginx['listen_addresses']= ['10.18.103.1']
修改url是别人通过url拉取代码,IP对客户端透明。修改ssh port及nginx绑定IP等为环境需要解决冲突。
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恢复
# 停止相关数据连接服务
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
# 从1393513186编号备份中恢复
gitlab-rake gitlab:backup:restore BACKUP=1393513186
# 启动Gitlab
sudo gitlab-ctl start
Gitlab迁移
把备份文件拷贝到gitlab的备份目录下,根据上面gitlab恢复步骤即可。
相关文章推荐
- 路由器备份配置
- 华为路由器密码恢复
- ASP实现SQL备份、恢复
- 路由器版本与密码恢复
- 备份线路的配置
- QQ聊天记录删除了怎么恢复简单方法
- 数据库备份 SQLServer的备份和灾难恢复
- sqlserver 数据库日志备份和恢复步骤
- SQLserver 数据库危险存储过程删除与恢复方法
- 简化SQL Server备份与还原到云工作原理及操作方法
- SQLServer恢复表级数据详解
- sqlserver2005打造自动备份的维护计划图解教程
- MySQL数据备份之mysqldump的使用详解
- 恢复主引导分区
- 详解MySQL数据备份之mysqldump使用方法
- mysql备份与恢复详解
- vbs实现恢复暂停的自动启动服务的脚本
- 我的文档和QQ聊天记录备份与恢复技巧
- MySQL备份与恢复