部署gitlab

部署gitlab

//安装git工具
[root@localhost ~]# yum -y install epel-release git
//安装依赖包
[root@localhost ~]# yum -y install curl openssh-server openssh-clients postfix cronie 
[root@localhost ~]# yum -y install policycoreutils-python-utils.noarch
//启动postfix服务并设置开机自启
[root@localhost ~]# systemctl restart postfix
[root@localhost ~]# systemctl enable postfix.service 
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service.
[root@localhost ~]# 
#安装
[root@localhost src]# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/policycoreutils-python-2.5-34.el7.x86_64.rpm
#在清华软件网站上下gitlab-ce-15.3.3ce.0.el7.x86_64.rpm
[root@localhost src]# rpm -ivh policycoreutils-python-2.5-34.el7.x86_64.r
pm --nodeps
warning: policycoreutils-python-2.5-34.el7.x86_64.rpm: Header V3 RSA/SHA2
56 Signature, key ID f4a80eb5: NOKEY
Verifying...                          ################################# [
100%]
Preparing...                          ################################# [
100%]
Updating / installing...
   1:policycoreutils-python-2.5-34.el7################################# [
100%]
[root@localhost src]# rpm -ivh gitlab-ce-15.3.3-ce.0.el7.x86_64.rpm --nodeps
warning: gitlab-ce-15.3.3-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signatu
re, key ID f27eab47: NOKEY
Verifying...                          ################################# [
100%]
Preparing...                          ################################# [
100%]
Updating / installing...
   1:gitlab-ce-15.3.3-ce.0.el7        ####################              ( 60%)
 37%)
It looks like GitLab has not been configured yet; skipping the upgrade script.

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.
  


     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/
[root@localhost src]# vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.237.134'  //这里改成自己服务器的ip
//重载配置文件并重启gitlab
[root@localhost ~]# gitlab-ctl reconfigure  //输入这一行的时候需要等待,如果有报错大概率是缺少依赖包直接下就完事。
yum install glibc-common
yum install -y langpacks-zh_CN
source /etc/locale.conf  //我暂时就发现这些问题。
[root@localhost ~]# gitlab-ctl restart
[root@localhost src]# gitlab-ctl restart
ok: run: alertmanager: (pid 238210) 1s
ok: run: gitaly: (pid 238277) 1s
ok: run: gitlab-exporter: (pid 238318) 0s
ok: run: gitlab-kas: (pid 238320) 1s
ok: run: gitlab-workhorse: (pid 238358) 0s
...
#这里如果加载不出来,就加个-e的参数应该就可以出来了
[root@localhost src]# gitlab-rails console -e production
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
 GitLab:       15.3.3 (c629a47f87f) FOSS
 GitLab Shell: 14.10.0
 PostgreSQL:   13.6
------------------------------------------------------------[ booted in 28.27s ]
Loading production environment (Rails 6.1.6.1)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>  //这里是设置超级管理员.
irb(main):002:0> user.password = '123456789'
=> "123456789"   //密码必须是八位数以上
irb(main):003:0> user.password_confirmation = '123456789'
=> "123456789"
irb(main):004:0> user.save! 
=> true
irb(main):005:0> exit   //退出
[root@localhost src]# ss -antl
State   Recv-Q  Send-Q   Local Address:Port   Peer Address:Port Process  
LISTEN  0       1024         127.0.0.1:8151        0.0.0.0:*             
LISTEN  0       1024         127.0.0.1:8153        0.0.0.0:*             
LISTEN  0       100          127.0.0.1:25          0.0.0.0:*             
LISTEN  0       1024         127.0.0.1:8154        0.0.0.0:*             
LISTEN  0       1024         127.0.0.1:8155        0.0.0.0:*             
LISTEN  0       128          127.0.0.1:8092        0.0.0.0:*             
LISTEN  0       511            0.0.0.0:8060       
...

posted @ 2022-09-23 12:56  舒少`  阅读(36)  评论(0)    收藏  举报