【发布时间】:2019-03-21 08:08:31
【问题描述】:
总结
我们创建了一个 EC2 实例并安装了 Gitlab,之后我们创建了一个 Application Load Balancer,我们通过 HTTPS 为它配置了一个子域,一切正常,我们创建了一个新的存储库,添加我们的 ssh-keys,如果我们克隆HTTPS 一切正常,但通过 SSH 我们无法针对此错误克隆它:
`ssh: connect to host gitlab.our.subdomain port 22: Connection refused`
重现步骤
- 创建新的 EC2 并安装 Gitlab
- 配置 Gitlab:
- external_url 'https://gitlab.our.subdomain/'
- nginx['redirect_http_to_https'] = true
- nginx['redirect_http_to_https_port'] = 80
- nginx['listen_port'] = 80
- nginx['listen_https'] = 假
- "X-Forwarded-Proto" => "https",
- “X-Forwarded-Ssl”=>“开启” 3.- 设置 EC2 和 ALB 的权限
当前的错误行为是什么?
```
git clone git@gitlab.our.subdomain:ucrea/ucrea_portal.git
Cloning into 'ucrea_portal'...
ssh: connect to host gitlab.realhost.cloud port 22: Connection refused
```
预期的正确行为是什么?
通过 SSH 克隆项目
相关日志
```
git clone git@gitlab.realhost.cloud:ucrea/ucrea_portal.git
Cloning into 'ucrea_portal'...
ssh: connect to host gitlab.our.dubdomain port 22: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
```
软件包版本详情
分销商 ID:Ubuntu 说明:Ubuntu 18.04.1 LTS 发布时间:18.04 代号:仿生
```
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-============================================================-===================================-===================================-==============================================================================================================================
ii gitlab-ce 11.3.4-ce.0 amd64 GitLab Community Edition (including NGINX, Postgres, Redis)
un gitlab-ee <none> <none> (no description available)
```
环境详情
- 操作系统:Ubuntu 18.04.1 LTS
- 安装目标,删除不正确的值:
- EC2
- 虚拟机:AWS
- 其他:应用负载均衡器
- 安装类型,删除不正确的值:
- 全新安装
- 从版本 11.3.4-ce.0 升级
- 其他:11.3.4-ce.0
配置详情
- external_url 'https://gitlab.our.subdomain/'
- nginx['redirect_http_to_https'] = true
- nginx['redirect_http_to_https_port'] = 80
- nginx['listen_port'] = 80
- nginx['listen_https'] = 假
- "X-Forwarded-Proto" => "https",
- “X-Forwarded-Ssl”=>“开启”
【问题讨论】:
-
安全组设置是什么?你在 ELB 上打开了 ssh 端口 22 吗?
-
可以尝试使用备用 ssh 而不是端口 22 about.gitlab.com/2016/02/18/…
标签: amazon-web-services gitlab amazon-elb