gitlab - 在 CentOS 上启动 gitlab-runner 注册失败
问题描述
我已经在 CentOS 机器上安装了 gitlab-runner,但是在注册步骤它失败并显示“连接被拒绝”:
sudo /usr/local/bin/gitlab-runner register --non-interactive --url "https://%myGitlab%/" --registration-token "%myToken%" --executor "shell" --description "TestServerRunner" --tag-list "TestRunner, CIOnTest"
Runtime platform arch=amd64 os=linux pid=3149 revision=4b9e985a version=14.4.0
Running in system-mode.
ERROR: Registering runner... failed runner=yoqL_Qsh status=couldn't execute POST against https://%myGitlab%/api/v4/runners: Post https://%myGitlab%/api/v4/runners: dial tcp %myGitlabIp%:443: connect: **connection refused**
PANIC: Failed to register the runner. You may be having network problems.
但是,如果我尝试连接到 gitlab.com,它会打印出正常的“错误”——错误的令牌:
sudo /usr/local/bin/gitlab-runner register --non-interactive --url "https://gitlab.com/" --registration-token "%myToken%" --executor "shell" --description "TestServerRunner" --tag-list "TestRunner, CIOnTest"
Runtime platform arch=amd64 os=linux pid=8259 revision=4b9e985a version=14.4.0
Running in system-mode.
ERROR: Registering runner... forbidden (check registration token) runner=yoqL_Qsh
PANIC: Failed to register the runner. You may be having network problems.
可能有什么问题?Ping 到 %MyGitlabIp% 存在。
解决方案
这将是您的运行器机器和您的 gitlab 实例之间的连接与网络相关的错误。虽然 ping 实例可能正常工作,但 ICMP (ping) 流量使用与 HTTPS 流量不同的端口和协议。如果你试图curl https://<my instance domain>
从你的盒子里跑出来,你可能会得到一个错误。您应该检查自托管 gitlab 实例上的防火墙规则。
听起来这是通过在运行自托管 gitlab 实例的机器上打开防火墙规则来解决的。
推荐阅读
- javascript - 获取对象中的多个 url 反应
- python - 将列表拆分为事件分布的块
- zsh - 如何解决 zsh compinit: MacOS 上的不安全目录问题(其他解决方案失败)
- autoit - Chilkat“无法获取 ActiveX 接口”
- javascript - 如何在 laravel 5.2 中重新加载页面后保留 select2 值?
- javascript - 我如何强制 tinyMCE 确实将标签从父标题转换为样式属性
或一些
? - python - 如何从 xml 输出列表中进行内部循环?
- javascript - 如何解析大型 JSONL 数据 Node js
- android - 如何减少 Android Emulator 的启动时间?
- ios - SwiftUI LazyVGrid 动画更改“页面”