【问题标题】:AWS Load Balancer Git Clone error over SSH PortSSH 端口上的 AWS 负载均衡器 Git 克隆错误
【发布时间】: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`

重现步骤

  1. 创建新的 EC2 并安装 Gitlab
  2. 配置 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”=>“开启”

【问题讨论】:

标签: amazon-web-services gitlab amazon-elb


【解决方案1】:

@尤利斯 使用经典的弹性负载均衡器,允许带有安全组的 80、22 入口端口。

【讨论】:

  • 你说得对,好像 ALB 是 7 层,所以 Classic Load Balancer 允许这样做。
猜你喜欢
  • 2017-09-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-12-18
  • 2021-10-14
  • 2017-04-12
  • 2021-12-04
  • 2021-01-03
相关资源
最近更新 更多