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 ...
随机推荐
- HDU3571 N-dimensional Sphere(高斯消元 同模方程)
每个点到中心距离相等,以第0个点为参考,其他n个点到中心距等于点0到中心距,故可列n个方程 列出等式后二次未知数相消,得到线性方程组 将每个数加上1e17,求答案是再减去,求解时对一个2 * (1e1 ...
- UVA 11464 暴力+位运算 ***
题意:给你一个 n * n 的 01 矩阵,现在你的任务是将这个矩阵中尽量少的 0 转化为 1 ,使得每个数的上下左右四个相邻的数加起来是偶数.求最少的转化个数. 新风格代码 lrj书上说的很清楚了, ...
- [转载]memcached完全剖析--1. memcached的基础
转载自:http://charlee.li/memcached-001.html 翻译一篇技术评论社的文章,是讲memcached的连载.fcicq同学说这个东西很有用,希望大家喜欢. 发表日:200 ...
- [数学]内接多边形求pi
- Linux学习笔记(2)-开机
今天开始学习Linux系统. 打开虚拟机,输入密码后,令人激动的画面就蹦出来了-- Ubuntu的主要基调是橙色,给人一种蠢萌蠢萌的感觉,和Windows不同,它只在左边有一条任务栏,上面有些东西,搜 ...
- 用Python写一个简单的Web框架
一.概述 二.从demo_app开始 三.WSGI中的application 四.区分URL 五.重构 1.正则匹配URL 2.DRY 3.抽象出框架 六.参考 一.概述 在Python中,WSGI( ...
- 【转】oracle 中随机取一条记录的两种方法
oracle 中随机取一条记录的两种方法 V_COUNT INT:=0; V_NUM INT :=0; 1:TBL_MYTABLE 表中要有一个值连续且唯一的列FID BEGIN SELECT COU ...
- 服务器响应HTTP的类型ContentType大全
".*"="application/octet-stream" ".001"="application/x-001" & ...
- Leetcode Valid Sudoku
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be ...
- ZeroMQ接口函数之 :zmq_getsockopt – 获取ZMQ socket的属性
ZeroMQ API 目录 :http://www.cnblogs.com/fengbohello/p/4230135.html 本文地址 :http://www.cnblogs.com/fengbo ...