我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们
文章版本: Enterprise Server 2.15

此版本的 GitHub Enterprise 将停止服务 此版本的 GitHub Enterprise 已停止服务 2019-10-16. 即使针对重大安全问题,也不会发布补丁。 For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

在 Google Cloud Platform 上安装 GitHub Enterprise Server

要在 Google Cloud Platform 上安装 GitHub Enterprise Server,您必须部署到受支持的机器类型上,并使用持久标准磁盘或持久 SSD。

本文内容

基本要求

硬件考量因素

GitHub Enterprise Server requires a persistent data disk separate from the root disk. For more information, see "System overview."

建议根据 您的 GitHub Enterprise Server 实例 中使用的席位数选择不同的硬件配置。 |

席位 vCPU 内存 附加的存储容量 根存储容量
10-500 2 16 GB 100 GB 200 GB
500-3000 4 32 GB 250 GB 200 GB
3000-5000 8 64 GB 500 GB 200 GB
5000-8000 12 72 GB 750 GB 200 GB
8000-10000+ 16 128 GB 1000 GB 200 GB

这些是最低限度的建议。 根据您的使用情况(例如用户活动和选定的集成),可能需要更多资源。 更多信息请参阅“增加 CPU 或内存资源”。

Note: The root disk can be resized by building a new appliance or using an existing appliance. For more information, see "Increasing storage capacity."

Warning: We recommend you use webhooks to fetch repository changes for continuous integration (CI) or similar systems. Regular automatic checks, or polling, will significantly reduce the scalability of your instance. For more information, see "About webhooks"

确定机器类型

在 Google Cloud Platform 上启动 您的 GitHub Enterprise Server 实例 之前,您需要确定最符合您的组织需求的机器类型。

支持的机器类型

以下 Google Compute Engine (GCE) 机器类型支持 GitHub Enterprise Server。 更多信息请参阅 Google Cloud Platform 机器类型文章。 |

| | 标准 | 高内存 | 高 CPU | | | -------------- | ------------- | ------------- | | | n1-standard-4 | n1-highmem-4 | n1-highcpu-4 | | | n1-standard-8 | n1-highmem-8 | n1-highcpu-8 | | | n1-standard-16 | n1-highmem-16 | n1-highcpu-16 | | | n1-standard-32 | n1-highmem-32 | n1-highcpu-32 |

根据您的席位数量,我们建议使用以下机器类型。

席位 建议类型
10 - 500 n1-standard-4
500 - 3000 n1-standard-8
3000 - 5000 n1-highmem-8
5000 - 8000 n1-highmem-16
8000 - 10000+ n1-highmem-32

Note: You can always scale up your CPU or memory by resizing your instance. However, because resizing your CPU or memory requires downtime for your users, we recommend over-provisioning resources to account for scale.

选择 GitHub Enterprise Server 映像

  1. 使用 gcloud compute 命令行工具列出公共 GitHub Enterprise Server 映像:

    $ gcloud compute images list --project github-enterprise-public --no-standard-images
  2. 记下 GitHub Enterprise Server 最新 GCE 映像的映像名称。

配置防火墙

GCE 虚拟机作为具有防火墙的网络的成员创建。 对于与 GitHub Enterprise Server VM 关联的网络,您需要将防火墙配置为允许下表中列出的必需端口。 更多关于 Google Cloud Platform 上防火墙规则的信息,请参阅 Google 指南“防火墙规则概述”。

  1. 使用 gcloud compute 命令行工具创建网络。 更多信息请参阅 Google 文档中的“gcloud compute networks create”。

    $ gcloud compute networks create NETWORK-NAME --subnet-mode auto
  2. 为下表中的各个端口创建防火墙规则。 更多信息请参阅 Google 文档中的“gcloud compute firewall-rules”。

    $ gcloud compute firewall-rules create RULE-NAME \
    --network NETWORK-NAME \
    --allow tcp:22,tcp:25,tcp:80,tcp:122,udp:161,tcp:443,udp:1194,tcp:8080,tcp:8443,tcp:9418,icmp

    此表列出了必需端口以及各端口的用途。

    端口 服务 描述
    22 SSH Git over SSH 访问。 支持克隆、获取和推送操作到公共/私有仓库。
    25 SMTP 支持加密 (STARTTLS) 的 SMTP。
    80 HTTP Web 应用程序访问。 当 SSL 启用时,所有请求都会重定向到 HTTPS 端口。
    122 SSH 实例 shell 访问。 默认 SSH 端口 (22) 专用于应用程序 git+ssh 网络流量。
    161/UDP SNMP 为网络监视协议操作所需。
    443 HTTPS Web 应用程序和 Git over HTTPS 访问。
    1194/UDP VPN 采用高可用性配置的安全复制网络隧道。
    8080 HTTP 基于纯文本 Web 的 管理控制台。 除非手动禁用 SSL,否则不需要。
    8443 HTTPS 基于安全 Web 的 管理控制台。 进行基本安装和配置时需要。
    9418 Git 简单的 Git 协议端口。 仅克隆和获取操作到公共仓库。 未加密的网络通信。

分配静态 IP 并将其分配给 VM

如果此设备为生产设备,强烈建议保留静态外部 IP 地址并将其分配给 GitHub Enterprise Server VM。 否则,重新启动后将不会保留 VM 的公共 IP 地址。 更多信息请参阅 Google 指南“保留静态外部 IP 地址”。

在生产高可用性配置中,主设备和副本设备均应获得单独的静态 IP 地址。

创建 GitHub Enterprise Server 实例

要创建 GitHub Enterprise Server 实例,您需要使用 GitHub Enterprise Server 映像创建 GCE 实例并连接额外的存储卷来存储实例数据。 更多信息请参阅“硬件考量因素”。

  1. 使用 gcloud compute 命令行工具创建数据磁盘,用作存储实例数据的连接存储卷,并根据席位数量配置大小。 更多信息请参阅 Google 文档中的“gcloud compute disks create”。

    $ gcloud compute disks create DATA-DISK-NAME --size DATA-DISK-SIZE --type DATA-DISK-TYPE --zone ZONE
  2. 然后,使用所选 GitHub Enterprise Server 映像的名称创建实例,并连接数据磁盘。 更多信息请参阅 Google 文档中的“gcloud compute ”。

    $ gcloud compute instances create INSTANCE-NAME \
    --machine-type n1-standard-8 \
    --image GITHUB-ENTERPRISE-IMAGE-NAME \
    --disk name=DATA-DISK-NAME \
    --metadata serial-port-enable=1 \
    --zone ZONE \
    --network NETWORK-NAME \
    --image-project github-enterprise-public

配置实例

  1. Copy the virtual machine's public DNS name, and paste it into a web browser.

  2. At the prompt, upload your license file and set a management console password. For more information, see "Managing your GitHub Enterprise Server license."

  3. In the 管理控制台, configure and save your desired settings. For more information, see "Configuring the GitHub Enterprise Server appliance."

  4. The instance will restart automatically.

  5. Click Visit your instance.

延伸阅读

问问别人

找不到要找的内容?

联系我们