zoukankan      html  css  js  c++  java
  • gitlab安装

    一, 服务器快速搭建gitlab方法

    可以参考gitlab中文社区 的教程
    centos7安装gitlab:https://www.gitlab.cc/downloads/#centos7
    centos6安装gitlab:https://www.gitlab.cc/downloads/#centos6
    如下方法按照官网来操作,手工安装过于麻烦。当前测试平台为小鸟云的三个月centos 7测试机.
    1. 安装配置依赖项

    如想使用Postfix来发送邮件,在安装期间请选择’Internet Site’. 您也可以用sendmai或者 配置SMTP服务 并 使用SMTP发送邮件.
    在 Centos 6 和 7 系统上, 下面的命令将在系统防火墙里面开放HTTP和SSH端口. 

    1. sudo yum install curl policycoreutils openssh-server openssh-clients
    2. sudo systemctl enable sshd
    3. sudo systemctl start sshd
    4. sudo yum install postfix
    5. sudo systemctl enable postfix
    6. sudo systemctl start postfix
    7. sudo firewall-cmd --permanent --add-service=http
    8. sudo systemctl reload firewalld

    这里可以自己yum 一个iptables做处理,一样的效果。
    2. 添加GitLab仓库,并安装到服务器上

    1. curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bash
    2. sudo yum install gitlab-ce

    如果你不习惯使用命令管道的安装方式, 你可以在这里下载 安装脚本 或者 手动下载您使用的系统相应的安装包(RPM/Deb) 然后安装

    1. curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-XXX.rpm
    2. rpm -i gitlab-ce-XXX.rpm

    3. 启动GitLab

    1. sudo gitlab-ctl reconfigure

    下边就可以访问了:
    1
    重置下密码。登录效果如下:
    1

    注意事项以及异常故障排查:
    1,按照该方式,我安装了一个确实没问题,只不过是英文版。没有经过汉化。
    2,默认安装登录需要重置root密码。可以自己单独设置一个复杂密码后登录。
    3,gitlab本身采用80端口,如安装前服务器有启用80,安装完访问会报错。需更改gitlab的默认端口。
    修改vim /etc/gitlab/gitlab.rb:

    1. external_url 'http://localhost:90'

    4,unicorn本身采用8080端口,如安装前服务器有启用8080,安装完访问会报错。需更改unicorn的默认端口。
    修改 /etc/gitlab/gitlab.rb:

    1. unicorn['listen'] = '127.0.0.1'
    2. unicorn['port'] = 3000

    5,每次重新配置,都需要执行sudo gitlab-ctl reconfigure  使之生效。
    6,日志位置:/var/log/gitlab 可以进去查看访问日志以及报错日志等,供访问查看以及异常排查。
    gitlab-ctl tail #查看所有日志
    gitlab-ctl tail nginx/gitlab_access.log #查看nginx访问日志

    二,gitlab中文汉化【如不清楚gitlab版本以及git,请不要操作,否则gitlab瘫痪】   只支持8以前版本,注意。
    1,需要下载汉化包,我们这里直接到去git一个。如果没安装git的请自行yum或apt-get 一个git。
    比如我们现在到/usr/local/src,执行如下命令去git clone包:

    1. git clone https://github.com/larryli/gitlabhq.git

    2,停止当前gitlab

    1. gitlab-ctl stop
    2. cp /usr/local/src/gitlabhq/* /opt/gitlab/embedded/service/gitlab-rails/ -rf

    其中有两个提示我们可以忽略:
    cp: cannot overwrite non-directory `/opt/gitlab/embedded/service/gitlab-rails/log’ with directory `./log’
    cp: cannot overwrite non-directory `/opt/gitlab/embedded/service/gitlab-rails/tmp’ with directory `./tmp’
    好了,汉化完成,重新启动gitlab,汉化完成。

    三,日常管理

    gitlab-ctl start|stop|status|restart
    比如查看状态:

    1. [root@21yunwei gitlab]# gitlab-ctl status
    2. run: gitlab-workhorse: (pid 19922) 665s; run: log: (pid 19159) 725s
    3. run: logrotate: (pid 19179) 723s; run: log: (pid 19178) 723s
    4. run: nginx: (pid 19166) 724s; run: log: (pid 19165) 724s
    5. run: postgresql: (pid 19026) 760s; run: log: (pid 19025) 760s
    6. run: redis: (pid 18943) 766s; run: log: (pid 18942) 766s
    7. run: sidekiq: (pid 19149) 732s; run: log: (pid 19148) 732s
    8. run: unicorn: (pid 20257) 642s; run: log: (pid 19116) 734s
  • 相关阅读:
    day14 多态与抽象
    day13 类的补充
    day12 继承
    第三周总结 类、对象、包
    day11 细节记忆
    Dapper使用
    修改SQL Server 中数据库的Collation
    Web API 输出文件缓存
    Sql从邮件中提取国家代码
    解决Nuget:https://api.nuget.org/v3/index.json 访问不了的问题
  • 原文地址:https://www.cnblogs.com/muyiyang/p/6926146.html
Copyright © 2011-2022 走看看