极狐GitLab 正式推出面向 GitLab 老旧版本(12.x、13.x、14.x、15.x 等)免费用户的专业升级服务,点击查看详情

返回列表 发布新帖

Ubuntu22.04新安装Gitlab-jh异常

774 4
发表于 2024-4-9 10:58:39 | 显示全部楼层 阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
本帖最后由 elvischenml 于 2024-4-9 11:13 编辑

Ubuntu22.0.4新安装Gitlab-jh(非升级)
透过设置环境变量代理上网, 安装Gitlab-jh
之前安装过新安装Gitlab-EE, 未能成功运行, 卸载, 改安装Gitlab-jh版,

需协助排查: 安装过程中报错及502
或遗漏什么操作没做导致目前状况

安装操作命令如下:
  1. sudo curl -fL https://get.gitlab.cn | sudo /bin/bash
复制代码

/etc/gitlab/gitlab.rb仅修改external_url
其他未作变更

首次sudo gitlab-ctl reconfigure 过程中报错参考附件 config_error.log
重新运行 sudo gitlab-ctl reconfigure 无报错, 重启服务
  1. sudo gitlab-ctl reconfigure
复制代码

卡在 HTTP 502
sudo gitlab-ctl tail观察日志后提示, TAIL报错参考tail.log
  1. root@gitlab:~# sudo gitlab-ctl tail
复制代码

netstat -ntlp观察端口号, 发现并没有puma监听端口, 默认8080?
  1. root@gitlab:~# netstat -ntlp
  2. Active Internet connections (only servers)
  3. Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
  4. tcp        0      0 127.0.0.1:9187          0.0.0.0:*               LISTEN      58872/postgres_expo
  5. tcp        0      0 127.0.0.1:9168          0.0.0.0:*               LISTEN      58721/ruby
  6. tcp        0      0 127.0.0.1:9121          0.0.0.0:*               LISTEN      58981/redis_exporte
  7. tcp        0      0 127.0.0.1:9100          0.0.0.0:*               LISTEN      58866/node_exporter
  8. tcp        0      0 127.0.0.1:9090          0.0.0.0:*               LISTEN      58906/prometheus
  9. tcp        0      0 127.0.0.1:9093          0.0.0.0:*               LISTEN      58640/alertmanager
  10. tcp        0      0 127.0.0.1:9229          0.0.0.0:*               LISTEN      58774/gitlab-workho
  11. tcp        0      0 127.0.0.1:9236          0.0.0.0:*               LISTEN      58668/gitaly
  12. tcp        0      0 127.0.0.1:8153          0.0.0.0:*               LISTEN      58990/gitlab-kas
  13. tcp        0      0 127.0.0.1:8154          0.0.0.0:*               LISTEN      58990/gitlab-kas
  14. tcp        0      0 127.0.0.1:8155          0.0.0.0:*               LISTEN      58990/gitlab-kas
  15. tcp        0      0 127.0.0.1:8150          0.0.0.0:*               LISTEN      58990/gitlab-kas
  16. tcp        0      0 127.0.0.1:8151          0.0.0.0:*               LISTEN      58990/gitlab-kas
  17. tcp        0      0 127.0.0.1:8082          0.0.0.0:*               LISTEN      59029/sidekiq_expor
  18. tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      2899/sshd: root@pts
  19. tcp        0      0 127.0.0.1:6011          0.0.0.0:*               LISTEN      27770/sshd: root@pt
  20. tcp        0      0 127.0.0.1:6012          0.0.0.0:*               LISTEN      58352/sshd: root@pt
  21. tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      1106/systemd-resolv
  22. tcp        0      0 0.0.0.0:8060            0.0.0.0:*               LISTEN      58805/nginx: master
  23. tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      58805/nginx: master
  24. tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      1971/master
  25. tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2010/sshd: /usr/sbi
  26. tcp6       0      0 ::1:6012                :::*                    LISTEN      58352/sshd: root@pt
  27. tcp6       0      0 ::1:6011                :::*                    LISTEN      27770/sshd: root@pt
  28. tcp6       0      0 ::1:6010                :::*                    LISTEN      2899/sshd: root@pts
  29. tcp6       0      0 :::9094                 :::*                    LISTEN      58640/alertmanager
  30. tcp6       0      0 :::25                   :::*                    LISTEN      1971/master
  31. tcp6       0      0 :::22                   :::*                    LISTEN      2010/sshd: /usr/sbi
复制代码






log.zip

8.98 KB, 下载次数: 0

回复

使用道具 举报

评论4

小马哥Lv.8 发表于 2024-4-9 11:25:06 | 显示全部楼层
官方文档 https://gitlab.cn/install/,这里面先要安装一些依赖,依赖安装成功了?

  1. sudo apt-get update
  2. sudo apt-get install -y curl openssh-server ca-certificates tzdata perl
复制代码
开心交流,交流开心。
回复

使用道具 举报

elvischenml楼主Lv.1 发表于 2024-4-9 11:46:15 | 显示全部楼层
小马哥 发表于 2024-4-9 11:25
官方文档 https://gitlab.cn/install/,这里面先要安装一些依赖,依赖安装成功了?

...

root@gitlab:~# sudo apt-get install -y curl openssh-server ca-certificates tzdata perl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ca-certificates is already the newest version (20230311ubuntu0.22.04.1).
curl is already the newest version (7.81.0-1ubuntu1.16).
openssh-server is already the newest version (1:8.9p1-3ubuntu0.6).
perl is already the newest version (5.34.0-3ubuntu1.3).
tzdata is already the newest version (2024a-0ubuntu0.22.04).
0 upgraded, 0 newly installed, 0 to remove and 54 not upgraded.
root@gitlab:~# sudo apt-get install -y postfix
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
postfix is already the newest version (3.6.4-1ubuntu1.3).
0 upgraded, 0 newly installed, 0 to remove and 54 not upgraded.


这部分安装过了, 都没有问题
回复

使用道具 举报

elvischenml楼主Lv.1 发表于 2024-4-10 12:00:04 | 显示全部楼层
主要原因是安装时过程报错, 导致安装不成功, 重新执行 sudo gitlab-ctl reconfigure, 虽然不报错, 但依旧不完整

过程中报错如下, 报错后退出
--> Help page documentation base url is blocked: execution expired
--> Diagramsnet url is blocked: execution expired
--> Public runner releases url is blocked: execution expired

sysctl: cannot open "/etc/sysctl.d/90-omnibus-gitlab-net.core.somaxconn.conf": No such file or directory


执行完整删除流程, 并在解决上述问题后, 成功安装, 无异常, 记录过程供遇到相同问题的人参考。
jh版需将ee改成jh。


  1. # 完整删除流程
  2. ## To remove all users and groups created by the Linux package before removing the package
  3. ## If you have problems removing accounts or groups, run userdel or groupdel manually to delete them. You might also want to manually remove the leftover user home directories from /home/.
  4. sudo gitlab-ctl stop && sudo gitlab-ctl remove-accounts
  5. ## remove all data
  6. sudo gitlab-ctl cleanse && sudo rm -r /opt/gitlab
  7. ## purge选项会尝试删除软件包及其配置文件 gitlab-ee
  8. sudo apt purge gitlab-ee
  9. ## 手动删除残留目录
  10. sudo rm -rf /opt/gitlab
  11. sudo rm -rf /var/opt/gitlab
  12. sudo rm -rf /etc/gitlab
  13. sudo rm -rf /var/log/gitlab
  14. ## 清除未再使用的依赖和残留的包文件
  15. sudo apt-get autoremove
  16. sudo apt-get autoclean
复制代码


重新安装
  1. # Install and configure the necessary dependencies
  2. sudo apt-get update
  3. sudo apt-get install -y curl openssh-server ca-certificates tzdata perl
  4. # Install Postfix (or Sendmail) to send notification emails
  5. sudo apt-get install -y postfix
  6. # Add the GitLab package repository
  7. curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
  8. # install the package
  9. # a password will be randomly generated and stored for 24 hours in /etc/gitlab/initial_root_password
  10. sudo apt install gitlab-ee
  11. ## added these in /etc/hosts, since no internet dns resolving is possible inside the company network:
  12. 172.65.251.78 gitlab.com
  13. 35.185.44.232 docs.gitlab.com
  14. 104.18.4.247 embed.diagrams.net
  15. # 修改配置文件
  16. sudo nano /etc/gitlab/gitlab.rb
  17. # 修改gitlab地址
  18. external_url 'http://gitlab.xxxx.com'
  19. ## 重新配置
  20. sudo gitlab-ctl reconfigure
  21. ## reconfigure开始运行后创建缺失的conf文件:避免安装过程报错退出
  22. touch /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.sem.conf
  23. touch /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmall.conf
  24. touch /opt/gitlab/embedded/etc/90-omnibus-gitlab-net.core.somaxconn.conf
  25. # 查看密码
  26. nano /etc/gitlab/initial_root_password
  27. # 登入
  28. # Byebye
复制代码


回复

使用道具 举报

小马哥Lv.8 发表于 2024-4-10 16:58:34 | 显示全部楼层
elvischenml 发表于 2024-4-10 12:00
主要原因是安装时过程报错, 导致安装不成功, 重新执行 sudo gitlab-ctl reconfigure, 虽然不报错, 但依旧不 ...

你这个安装的gitlab-ce啊,你看你的 package 是 packages.gitlab.com,极狐的安装 https://gitlab.cn/install/。这个里面我们简化了安装命令:curl -fsSL https://get.gitlab.cn | /bin/bash。

gitlab-ce 的资源往往在 gitlab.com 的域名上,极狐的在 gitlab.cn上。极狐gitlab 是 gitlab 在中国的发行版,有一些功能是 gitlab-ce 没有的。
开心交流,交流开心。
回复

使用道具 举报

意见建议

Email:forum@gitlab.cn
  • 关注公众号
  • 添加专业顾问
Copyright © 2001-2024 极狐GitLab论坛 版权所有 All Rights Reserved. 鄂ICP备2021008419号-1|鄂公网安备42018502006137号
关灯 快速发帖
扫一扫添加专业顾问
返回顶部
快速回复 返回顶部 返回列表