gitlab 安装
GitLab的安装方式
GitLab的两种安装方法:
编译安装
优点:可定制性强。数据库既可以选择MySQL,也可以选择PostgreSQL;服务器既可以选择Apache,也可以选择Nginx。
缺点:国外的源不稳定,被墙时,依赖软件包难以下载。配置流程繁琐、复杂,容易出现各种各样的问题。依赖关系多,不容易管理,卸载GitLab相对麻烦。
通过rpm包安装
优点:安装过程简单,安装速度快。采用rpm包安装方式,安装的软件包便于管理。
缺点:数据库默认采用PostgreSQL,服务器默认采用Nginx,不容易定制。
由于公司只配备了一台阿里云服务器,并且没有分配任何的域名。该服务器上需要运行版本控制软件、bug管理软件、知识库等多套程序,只能采用ip的方式访问。原先采用GitLab+Apache+MySQL编译安装的方式,并且将GitLab配置为可通过xxx.xx.xxx.xx/gitlab的形式访问,由于bug管理软件(禅道)也运行于Apache之上,两套软件之间彼此有互斥的影响,找不到解决方法。同时,GitLab的注册需要邮箱验证,由于网上提供的配置方法都是基于域名的,在阿里云上多次进行配置都无法正常使用。
因此,只能放弃编译安装的方式,而采取rpm包的方式重新进行安装。
安装GitLab CE Omnibus包
yum install curl policycoreutils openssh-server openssh-clients postfix
systemctl enable sshd
systemctl start sshd
systemctl enable postfix
systemctl start postfix
2. Add the GitLab package server and install the package
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce
If you are not comfortable installing the repository through a piped script, you can find the entire script here and select and download the package manually and install using
curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-XXX.rpm/download
rpm -i gitlab-ce-XXX.rpm
3. Configure and start GitLab
sudo gitlab-ctl reconfigure
配置文件 cat /etc/gitlab/gitlab.rb
[root@git gitlab]# grep -v "#" gitlab.rb | sed '/^$/d'
external_url 'http://git.cinyi.com'
gitlab_rails['gitlab_email_from'] = 'fengjian1585@163.com'
gitlab_rails['backup_path'] = "/data/gitlab/backups"
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "fengjian1585@163.com"
gitlab_rails['smtp_password'] = "123456"
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
user['git_user_name'] = "Git_Senyint_Admin"
user['git_user_email'] = "fengjian1585@163.com"
为了更好的管理起来我们关闭开放注册
用户注册


Gitlab 修改备份文件默认目录
你也可以通过修改/etc/gitlab/gitlab.rb来修改默认存放备份文件的目录:
gitlab_rails['backup_path'] = '/data/gitlab/backups'
/mnt/backups修改为你想存放备份的目录即可, 修改完成之后使用gitlab-ctl reconfigure命令重载配置文件即可.
Gitlab 自动备份
加入以下, 实现每天凌晨2点进行一次自动备份:
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create
Gitlab 恢复
同样, Gitlab的从备份恢复也非常简单:
# 停止相关数据连接服务
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
# 从1393513186编号备份中恢复

gitlab-rake gitlab:backup:restore BACKUP=1393513186
# 启动Gitlab
sudo gitlab-ctl start
. 保证恢复的gitlab版本是相同的
. 保证/etc/gitlab/gitlab.rb 相同
. 备份的路径是相同的/data/gitlab/backups chown git.root /data/gitlab/backups
chmod /data/gitlab/backups
chown git.git -R /data/gitlab/backups/*
cd /data/gitlab/backups/
ls
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq gitlab-ctl status
gitlab-rake gitlab:backup:restore BACKUP=1510250560
gitlab-ctl start
gitlab-ctl status
还原写在脚本中,新版和老板有区别
[root@gitlab data]# cat restore-gitlab.sh
#!/bin/bash cd /data/gitlab/backups/ restorename=`find /data/gitlab/backups/ -mtime -1 -name "*.tar" | awk -F "/" '{print $5}' | cut -d '_' -f 1-5` gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq chown git.root /data/gitlab/backups
chmod 700 /data/gitlab/backups
chown git.git -R /data/gitlab/backups/* gitlab-rake gitlab:backup:restore BACKUP=${restorename} gitlab-ctl start #恢复后,可以使用check检查
gitlab-rake gitlab:check SANITIZE=true
当恢复检查是,会出现一下问题
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: FAILED: Failed to connect to internal API
gitlab-shell self-check failed
Try fixing it:
Make sure GitLab is running;
Check the gitlab-shell configuration file:
sudo -u git -H editor /opt/gitlab/embedded/service/gitlab-shell/config.yml
Please fix the error above and rerun the checks. Checking GitLab Shell ... Finished Checking Gitaly ... default ... OK Checking Gitaly ... Finished Checking Sidekiq ... Running? ... no
Try fixing it:
sudo -u git -H RAILS_ENV=production bin/background_jobs start
For more information see:
doc/install/installation.md in section "Install Init Script"
see log/sidekiq.log for possible errors
Please fix the error above and rerun the checks.
修改 vim /opt/gitlab/embedded/service/gitlab-shell/config.yml gitlab_url 变成 0.0.0.0
# GitLab user. git by default
user: git # Url to gitlab instance. Used for api calls. Should end with a slash.
gitlab_url: "http://0.0.0.0:8080"
#gitlab_url: "http://127.0.0.1:8080"
gitlab配置文件
[root@gitlab data]# grep -v "#" /etc/gitlab/gitlab.rb | sed '/^$/d'
external_url 'http://git.senyint.com'
gitlab_rails['gitlab_email_reply_to'] = 'fengjian1585@163.com'
gitlab_rails['gitlab_default_can_create_group'] = false #禁止在自己账户建立工程
gitlab_rails['backup_path'] = "/data/gitlab/backups"
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.qiye.163.com"
gitlab_rails['smtp_port'] =
gitlab_rails['smtp_user_name'] = "fengjian@qq.com"
gitlab_rails['smtp_password'] = ""
gitlab_rails['smtp_domain'] = "qiye.163.com"
gitlab_rails['smtp_authentication'] = :login
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = 'fengjian@senyint.com'
gitlab 安装的更多相关文章
- GitLab安装说明
GitLab,是一个使用 Ruby on Rails 开发的开源应用程序,与Github类似,能够浏览源代码,管理缺陷和注释,非常适合在团队内部使用. gitlab是基于Ruby on Rails的, ...
- Gitlab安装、汉化及使用
环境:centos 关闭防火墙和selinux [root@Gitlab ~]# setenforce [root@Gitlab ~]# service iptables stop && ...
- git\CentOS6.5中gitlab安装教程
一.Git 起源: Git是一个开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目. Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本 ...
- Ubuntu gitlab安装文档及邮件通知提醒配置
1.安装依赖包,运行命令 sudo apt-get install curl openssh-server ca-certificates postfix 2.由于gitlab官方源可能被“墙”,首先 ...
- gitlab安装随记
gitlab安装 配置yum源 sudo vim /etc/yum.repos.d/gitlab-ce.repo 按照网上别人的例子,修改为清华的源 [gitlab-ce] name=Gitlab C ...
- CentOS 7 环境下GitLab安装及基本配置
新实验室要求重新建设GitLab,对于我来讲,是第一次有机会当元老参与实验室的建设.下面分享我自己的实测经验: 1. 安装依赖软件并设置开机启动 yum install curlpolicycoreu ...
- GitLab安装及使用
GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目. GitLab拥有与Github类似的功能,能够浏览 ...
- gitlab之一: gitlab安装配置使用
参考: gitlab 安装和配置 gitlab下载地址: https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/ 官方教程: https://about.gitl ...
- Gitlab安装以及汉化
Gitlab安装以及汉化 系统环境: CentOS 7.5 IP:192.168.1.2 关闭selinux.firewalld gitlab-ce-10.8.4 rpm包:下载地址 一.下载并安装g ...
- GITLAB安装笔记
CentOS 7 最小安装后操作 设置时区timedatectl set-timezone Asia/Shanghai 添加 Gitlab 清华源 vi /etc/yum.repos.d/gitlab ...
随机推荐
- Ajax请求安全性讨论
今天我们来讨论一下ajax请求的安全性,我相信各位在系统开发过程中肯定会绞尽脑汁的想怎样可以尽量少的防止伪造ajax请求进行攻击,尤其是开发跟用户交互比较多的互联网系统.那么就请大家来分享讨论一下你在 ...
- Struts2 动态方法调用
01.Struts 2基本结构 使用Struts2框架实现用登录的功能,使用struts2标签和ognl表达式简化了试图的开发,并且利用struts2提供的特性对输入的数据进行验证,以及访问Servl ...
- 【MongoDB】4.MongoDB 原子修改器的 极速修改
文档转自:http://blog.csdn.net/mcpang/article/details/7752736 对于文档的更新除替换外,针对某个或多个文档只需要部分更新可使用原子的更新修改器,能够高 ...
- python lambda
匿名函数和lambda: lambda [args1,[args2]] : expression python 使用lambda来创建匿名函数,匿名函数不需要以标准的方式进行创建,但是作为函数,它们也 ...
- Quick Apps for Sharepoint小型BI解决方案
Quick Apps for Sharepoint介绍 Quick Apps for Sharepoint前身是Quest Webpart ,由企业软件开发商QuestSoftware开发,Quest ...
- 冰球项目日志2-yjw
我们小组在12.31号进行了讨论,确定了基本的任务及分工,后面是元旦放假,大家没有做很多的东西,我也是把自己分工的部分方案想了下. 后面在1.3号,我们会再进行一次小组讨论,确定下最终的方案,然后进行 ...
- requerjs 合并 优化配置
/* * This is an example build file that demonstrates how to use the build system for * require.js. * ...
- javascript面向对象(一):封装
本文来自阮一峰 学习Javascript,最难的地方是什么? 我觉得,Object(对象)最难.因为Javascript的Object模型很独特,和其他语言都不一样,初学者不容易掌握. 下面就是我的学 ...
- VMware与virtualbox安装centos7连接网络不可达问题解决笔记(连接网络)
我最初是安装vmware遇到访问不到网络,按网上的配置方法都不能解决.然后我感觉可能跟系统有关,我装的是centos,然后我试着在virtualbox上安装看遇到什么问题. 用virtualbox安装 ...
- dede判断当前文章
<li><a href="/info/info3.html" class=s >企业文化 </a></li><li> ...