1、安装相关依赖
yum -y install policycoreutils-python openssh-clients postfix
2、启动ssh服务&设置为开机启动
systemctl enable sshd & sudo systemctl start sshd
3设置postfix开机自启,并启动,postfix支持gitlab发信功能
systemctl enable postfix && systemctl start postfix
4、开放ssh 以及http服务,然后重新加载防火墙列表
$ firewall-cmd --add-service=ssh --permanent
$ firewall-cmd --add-service=http --permanent
$ firewall-cmd --reload
5、下载gitlab 包,并且安装
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.12.10-ce.0.el7.x86_64.rpm
rpm -i gitlab-ce-13.12.10-ce.0.el7.x86_64.rpm
6、修改gitlab 配置
external_url'http://192.168.66.100:82'
nginx['listen_port']=82 #这行是注释掉了,直接打开即可
7、重载配置及启动gitlab
gitlab-ctl reconfigure
gitlab-ctl restart
gitlab-ctl start # 启动所有 gitlab 组件;
gitlab-ctl stop # 停止所有 gitlab 组件;
gitlab-ctl restart # 重启所有 gitlab 组件;
gitlab-ctl status # 查看服务状态;
gitlab-ctl reconfigure # 启动服务;
vim /etc/gitlab/gitlab.rb # 修改默认的配置文件;
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab;
gitlab-ctl tail # 查看日志;
此时有可能报错
报错:There was an error running gitlab-ctl reconfigure:
ruby_block[authorize Grafana with Gitlab] (monitoring::grafana line 92) had an error: NoMethodError: undefined method ‘zero?’ for nil:NilClass
解决办法
分配2G空间
sudo dd if=/dev/zero of=/root/swapfile bs=1M count=1500;
制作文件并生效
sudo mkswap /root/swapfile
sudo swapon /root/swapfile
设置开机启动
sudo vim /etc/fstab 在最后一行加进去
/root/swapfile swap swap defaults 0 0
最后free -m查看是否生效
生效后重新执行gitlab-ctl reconfigure 即可
end
[root@VMwareCentOS7 ~]# rpm -i gitlab-ce-13.12.10-ce.0.el7.x86_64.rpm
警告:gitlab-ce-13.12.10-ce.0.el7.x86_64.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID f27eab47: NOKEY
错误:依赖检测失败:
policycoreutils-python 被 gitlab-ce-13.12.10-ce.0.el7.x86_64 需要
yum install policycoreutils-python
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,.
_______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ `/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/
Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure
For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
Help us improve the installation experience, let us know how we did with a 1 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=13-12
————————————————
版权声明:本文为CSDN博主「半夏_2021」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/fd2025/article/details/124336330
版权归属:
ABin
许可协议:
本文使用《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》协议授权
评论区