1、安装与配置
1)配置yum源
在 /etc/yum.repos.d/ 下新建 gitlab-ce.repo
vi /etc/yum.repos.d/ gitlab-ce.repo
写入如下内容
[gitlab-ce]
name=gitlab-ce
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
Repo_gpgcheck=0
Enabled=1
Gpgkey=https://packages.gitlab.com/gpg.key
2)创建cache,再直接安装gitlab-ce
yum makecache # 这一步会创建大量的数据
# 直接安装最新版
yum install -y gitlab-ce
# 如果要安装指定的版本,在后面填上版本号即可
yum install -y gitlab-ce-13.6.1
# 如果安装时出现gpgkey验证错误,只需在安装时明确指明不进行gpgkey验证
yum install gitlab-ce -y --nogpgcheck
3)、gitlab的配置
配置文件位置 /etc/gitlab/gitlab.rb
#访问ip与端口
external_url 'http://10.0.0.51' # 这里一定要加上http://
修改好配置文件后,要使用 gitlab-ctl reconfigure 命令重载一下配置文件,否则不生效
gitlab-ctl reconfigure # 重载配置文件
4)启动命令
gitlab-ctl start # 启动所有 gitlab 组件
gitlab-ctl stop # 停止所有 gitlab 组件
gitlab-ctl restart # 重启所有 gitlab 组件
gitlab-ctl status # 查看服务状态
gitlab-ctl reconfigure # 启动服务
gitlab-ctl show-config # 验证配置文件
gitlab-ctl tail # 查看日志
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab
2、gitlab 默认密码
gitlab-ce-14初装以后,把密码放在了一个临时文件中了
/etc/gitlab/initial_root_password
这个文件将在首次执行reconfigure后24小时自动删除
Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn't opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.
NOTE: Because these credentials might be present in your log files in plain text, it is highly recommended to reset the password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
gitlab Reconfigured!
[root@c7-192 src]# cat /etc/gitlab/initial_root_password
# WARNING: This value is valid only in the following conditions
# 1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
# 2. Password hasn't been changed manually, either via UI or via command line.
#
# If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
Password: thAXLJhVoo6V9sRvRH5HrLrD5rg88C7gccEGZDT4Lq0=
# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.