首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Gitlab Runner在单独的服务器上

Gitlab Runner在单独的服务器上
EN

Stack Overflow用户
提问于 2017-06-02 21:15:05
回答 2查看 1.8K关注 0票数 2

我想在单独的服务器上安装GitLab运行程序,但当我尝试连接到GitLab时,我收到以下消息:

代码语言:javascript
复制
Running in system-mode.                            

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
<URL>
Please enter the gitlab-ci token for this runner:
<TOKEN>       
Please enter the gitlab-ci description for this runner:
[<url>]: <description>
Please enter the gitlab-ci tags for this runner (comma separated):

Whether to lock Runner to current project [true/false]:
[false]: 
ERROR: Registering runner... failed                 runner=<runner-token> status=couldn't execute POST against <url>/api/v4/runners: Post <url>/api/v4/runners: dial tcp 172.17.0.2:80: getsockopt: connection refused
ERROR: Checking GitLab compatibility... not-compatible  reason=GitLab Runner >= 9.0 can be used ONLY with GitLab CE/EE >= 9.0 result=-1 runner=<runner-token> statusText=couldn't execute POST against <url>/api/v4/runners/verify: Post <url>/api/v4/runners/verify: dial tcp 172.17.0.2:80: getsockopt: connection refused
PANIC: Failed to register this runner. Perhaps you are having network problems 

如果我从邮递员创建POST请求,我可以创建runner,但当我从gitlab-ci尝试时,我不能。你知道哪里出了问题吗?我们的Gitlab在另一台服务器上,我想将Gitlab和Gitlab-ci分开。我希望Gitlab-CI在单独的服务器上,而不是在Gitlab所在的同一服务器上。你知道怎么做吗?

EN

回答 2

Stack Overflow用户

发布于 2017-06-02 23:26:46

有两种可能的原因导致您的问题:

  1. Version不匹配:可能您的runner与您的GitLab版本不兼容,如消息ERROR: Checking GitLab compatibility... not-compatible reason=GitLab Runner >= 9.0 can be used ONLY with GitLab CE/EE >= 9.0 result=-1中所述。检查您的GitLab实例版本,并确保您的运行器版本与it.Runners版本9.0及更高版本兼容。使用新的v4应用程序接口,至少需要GitLab 9.0。

Gitlab problem:您的GitLab Runner无法访问GitLab服务器,原因是某些网络限制或某些阻塞。发生这种情况时,将显示上述相同的错误消息。尝试从GitLab运行程序服务器卷曲<url>/api/v4/runners/verify,以了解这是否是问题所在。

票数 0
EN

Stack Overflow用户

发布于 2017-06-09 19:36:57

是的,我解决了我的问题。问题是什么:我已经创建了docker-compose.yml文件,它看起来像这样:

代码语言:javascript
复制
web:
  image: 'gitlab/gitlab-runner:latest'
  restart: always
  hostname: domain
  container_name: gitlab-runner
  volumes:
    - '/storage/gitlab-runner/gitlab-runner/config:/etc/gitlab-runner'
    - '/var/run/docker.sock:/var/run/docker.sock

但是,当我尝试连接gitlab和gitlab ci时,我看到了这一行:Please enter the gitlab-ci description for this runner: [<url>]: <description>我收到了[<url>],但我必须收到随机的token和url。然后,我决定删除hostname: domain,并再次启动该过程。那么所有的工作都很好。因此,我的新docker-compose.yml文件如下所示:

代码语言:javascript
复制
web:
  image: 'gitlab/gitlab-runner:latest'
  restart: always
  container_name: gitlab-runner
  volumes:
    - '/storage/gitlab-runner/gitlab-runner/config:/etc/gitlab-runner'
    - '/var/run/docker.sock:/var/run/docker.sock

现在,一切都运行良好。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44329905

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档