添加源
[root@zabbix_server yum.repos.d]# cat gitlab.repo [gitlab] name=gitlab baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/ enabled=1 gpgcheck=0 #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[root@zabbix_server yum.repos.d]# yum -y install gitlab-ce-14.9.5
[root@zabbix_server ~]# vim /etc/gitlab/gitlab.rb
修改完主配置文件后,使用gitlab-ctl reconfifigure重新配置gitlab使配置生效 [root@zabbix_server ~]# gitlab-ctl reconfigure
Running handlers: Running handlers complete Chef Infra Client finished, 602/1616 resources updated in 02 minutes 46 seconds 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@zabbix_server ~]# gitlab-ctl status
run: alertmanager: (pid 3763) 136s; run: log: (pid 3467) 181s run: gitaly: (pid 3673) 136s; run: log: (pid 2758) 274s run: gitlab-exporter: (pid 3650) 137s; run: log: (pid 3378) 199s run: gitlab-kas: (pid 3617) 139s; run: log: (pid 3017) 262s run: gitlab-workhorse: (pid 3631) 139s; run: log: (pid 3145) 219s run: grafana: (pid 3780) 135s; run: log: (pid 3576) 149s run: logrotate: (pid 2687) 288s; run: log: (pid 2715) 285s run: nginx: (pid 3174) 214s; run: log: (pid 3203) 211s run: node-exporter: (pid 3640) 138s; run: log: (pid 3283) 207s run: postgres-exporter: (pid 3773) 135s; run: log: (pid 3490) 174s run: postgresql: (pid 2880) 269s; run: log: (pid 2959) 266s run: prometheus: (pid 3661) 137s; run: log: (pid 3436) 187s run: puma: (pid 3082) 232s; run: log: (pid 3089) 231s run: redis: (pid 2718) 281s; run: log: (pid 2726) 280s run: redis-exporter: (pid 3652) 137s; run: log: (pid 3406) 193s run: sidekiq: (pid 3100) 226s; run: log: (pid 3108) 225s登录GitLab 浏览器访问GitLab服务器地址:http://IP 默认用户名:root root初始密码所在文件:/etc/gitlab/initial_root_password
通过个人资料中心修改root密码
设置密码后会跳转到登录页面重新登录。
修改页面语言
定制Logo及登录页面,可以自定义你希望展示的一些内容。点击左上角的 菜单(Menu)→Admin→设置→外观
关闭注册功能
由于我们Gitlab系统是私有仓库,一般用户都是由管理员创建和分派的, 所以我们需要关闭注册。 点击左上角 菜单(Menu)→管理(Admin)→通用 找到注册限制取消掉 注册功能。将勾选取消,点击 保存更改(Save changes)
新建群组
群组就是把相关的项目和用户放在一起,进行统一的权限管理,点击 菜单 (Menu)→管理(Admin)点击 新建群组在可见性级别处我们选择私有,这样只有经过授权的用户才可以看到该组 内的项目,其他用户无法查看。 配置完相关信息点击最下方的创建群组。
创建仓库
我们在GitLab创建一个项目仓库用于存放项目代码,菜单(Menu)→管 理(Admin)→新建项目
设置SSH Key
请注意最上方的提示,点击提示中的添加SSH密钥 来设置访问方式将本机~/.ssh/id_rsa.pub公钥文件内容复制到GItLab的SSH密钥处。
[root@zabbix_server .ssh]# cat /root/.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDT44jSgVeg6yX0lCN8uylZhTGGPyWMX97SEJHGMEW1HR3mgOZAHcZAINRw1AEOC0kp52JRUQ0oTT7vTb03JvT/alVaWb2jzQGcpvEAArRT7+6WKwxX+gSdGVmNzQdvFCb7TFxJig1joQGKEIGlD3ec2Ps4BxWwQ+hPkXXK8NyAkAsFP1KUDb2z+foeM/5chyM0TKzmIpq1f/yLIEKJ0Eu709TvBX6hLoeZJACkF9uru/c0agqa5dZjYaOYofOWv1Ji3rtx/rUF+00xaCQqhU2zq4NHHyppTLiSrfoKMi58y0VBHTsK9vet7v6Of1+3DOQ+XT2F2X0yraKk26jPg51v root@zabbix_server
粘贴完成后其他默认即可,点击添加密钥 后再次回到项目中
推送代码
标签:run,log,root,gitlab,pid,server,安装 From: https://www.cnblogs.com/xgsh/p/17523581.html