gitlab的安装和基本维护
2017-02-06 17:25
302 查看
基本介绍
GitLab是一个自托管的Git项目仓库,可以自己搭建个人代码管理的仓库,功能与github类似。安装
操作系统:CentOS6.5gitlab官网下载安装地址:https://about.gitlab.com/downloads/#centos6
1.安装依赖的包yum install curl openssh-server openssh-clients postfix cronie service postfix start chkconfig postfix on lokkit -s http -s ssh
2.使用gitlab官网的脚本安装
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash yum install gitlab-ce
或者使用gitlab的rpm安装gitlab
curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/6/gitlab-ce-XXX.rpm/download rpm -i gitlab-ce-XXX.rpm
如果一切顺利,gitlab将安装完成!
3.这里我先修改下配置文件(将访问地址改为主机的ip地址),默认为主机名访问(http://hostname 默认的访问地址)
修改结果如下:
[root@locahost~]# grep -n "^[a-Z]" /etc/gitlab/gitlab.rb 11:external_url 'http://10.10.100.38'
4.配置并启动gitlab
gitlab-ctl reconfigure
5.安装完毕后,使用Web登录
打开浏览器输入http://10.10.100.38 #10.10.100.38为我的gitlab主机ip地址.第一次登录要求设置root密码
登录成功之后,是这样的
至此,gitlab的安装访问正常...
安装完gitlab后的运维操作:
初次配置服务
sudo gitlab-ctl reconfigure
启动服务
sudo gitlab-ctl start
停止服务
sudo gitlab-ctl stop
重启服务
sudo gitlab-ctl restart
检查服务状态
sudo gitlab-ctl status
一般服务状态显示信息
显示格式:
状态 : 进程名称:(进程ID)运行时间(秒);进程的日志服务进程和运行时间
[root@localhost~]# gitlab-ctl status run: gitlab-workhorse: (pid 14584) 3325s; down: log: 0s, normally up, want up run: logrotate: (pid 14593) 3324s; run: log: (pid 31243) 612s run: nginx: (pid 14602) 3323s; down: log: 0s, normally up, want up run: postgresql: (pid 11749) 3741s, want down; down: log: 3721s, normally up, want up run: redis: (pid 14613) 3322s; down: log: 0s, normally up, want up run: sidekiq: (pid 8677) 4118s, got TERM; down: log: 0s, normally up, want up run: unicorn: (pid 14619) 3322s; run: log: (pid 7844) 4153s
状态 | 说明 |
run | 运行状态 |
down | 服务停止 |
检查服务的日志信息
# 检查redis的日志 sudo gitlab-ctl tail redis # 检查postgresql的日志 sudo gitlab-ctl tail postgresql # 检查gitlab-workhorse的日志 sudo gitlab-ctl tail gitlab-workhorse # 检查logrotate的日志 sudo gitlab-ctl tail logrotate # 检查nginx的日志 sudo gitlab-ctl tail nginx # 检查sidekiq的日志 sudo gitlab-ctl tail sidekiq # 检查unicorn的日志 sudo gitlab-ctl tail unicorn
gitlab管理员密码忘记,怎么重置密码
Gitlab 修改root用户密码使用rails工具打开终端
sudo gitlab-rails console production
查询用户的email,用户名,密码等信息,id:1 表示root账号
user = User.where(id: 1).first
重新设置密码
user.password = '新密码' user.password_confirmation = '新密码'
保存密码
user.save!
完整的操作ruby脚本
user = User.where(id: 1).firstuser.password = '新密码'
user.password_confirmation = '新密码'
user.save!
然后使用重置过的密码重新登录。
Git 图形界面操作工具
SourceTree https://www.sourcetreeapp.com/
TortoiseGit https://code.google.com/p/tortoisegit/wiki/Download?tm=2
参考文档:
http://www.cnblogs.com/stevendes/p/6218928.html
http://www.cnblogs.com/yangliheng/p/5760185.html
https://about.gitlab.com/downloads/#centos6
http://www.tuicool.com/articles/mEbAZbE
相关文章推荐
- GoldenGate基本原理、安装过程和基本维护
- FreeBSD 下 MySQL 安装与基本维护
- 学习一些在 Linux 上安装、运行和维护 Oracle 数据库所需的基本 bash shell 脚本。
- 【Linux】Mysql数据库安装以及基本维护
- gitlab从安装到维护
- gitlab基本维护和使用
- CentOS 7.4 安装GitLab CE 10.3.4和使用中的基本问题解答
- Gitlab 社区版安装部署和维护指南
- gitlab基本维护和使用
- gitlab基本维护和使用
- gitlab基本维护和使用
- gitlab基本维护和使用
- Windows系统的安装维护技巧与加速的基本方法介绍
- gitlab基本维护和使用
- gitlab 安装和基本介绍
- 笔记:gitlab-ce 基本安装(1)
- ORACLE数据库基本维护命令
- 23条硬件维护基本技巧必看
- AD学习笔记8——活动目录服务的基本安装和配置