gitlab集群高可用架构拆分部署

目录

前言

负载均衡器准备

外部负载均衡器

内部负载均衡器

(可选)Consul服务

Postgresql拆分

1.准备postgresql集群 

手动安装postgresql插件

2./etc/gitlab/gitlab.rb配置

3.生效配置文件

Redis拆分

1./etc/gitlab/gitlab.rb配置

2.生效配置文件

Gitaly拆分

1.Praefect Postgresql数据库配置

2.配置Praefect

2.1.部署准备&注意事项

2.2./etc/gitlab/gitlab.rb配置

2.3.生效配置文件

2.4.验证Praefect与gitaly的连接配置状态

3.配置gitaly

3.1.部署准备&注意事项

3.2. /etc/gitlab/gitlab.rb配置

3.3.创建git-data目录

3.4.生效配置文件

NFS配置

Sidekiq拆分

1.部署准备&注意事项

2./etc/gitlab/gitlab.rb配置

3.生效配置文件

Gitlab Rails拆分

1.部署准备&注意事项

2./etc/gitlab/gitlab.rb配置

3.生效配置文件

4.启用增量日志

4.1. 要启用增量日志记录

4.2.要禁用增量日志记录

5.配置确认

5.1.确认节点可以连接到 Gitaly

5.2.(可选)从 Gitaly 服务器确认 Gitaly 可以对内部 API 执行回调

总结


前言

整体架构参考:Reference architecture: up to 50,000 users | GitLab

为了简化部署,Postgresql、Redis等,会使用云厂商提供的服务

(引用gitlab官网架构图)

负载均衡器准备

  1. 可以考虑使用云厂商的负载均衡器,提供7层和4层的负载均衡。

  2. 如果只是内网使用,或者测试场景。外部负载均衡器和内部负载均衡器可以考虑使用同一个负载均衡器,以节省资源。

配置外部负载均衡器:Reference architecture: up to 50,000 users | GitLab

配置内部负载均衡器:Reference architecture: up to 50,000 users | GitLab

外部负载均衡器

LB端口后端端口协议说明
8080HTTP
44380/443HTTPS/TCP

1.如果在LB卸载SSL证书,则可以通过HTTPS协议,转发至后端80端口

2.如果需要在后端gitlab的nginx卸载证书,则可以通过TCP协议,转发至后端443端口

内部负载均衡器

(可选)Consul服务

官方文档中对于Consul服务在gitlab中的作用定位是:数据库服务发现。

由于本示例使用的Postrgresql和Redis都是使用云厂商提供的服务,所以跳过Consul的部署。

Consul部署参考:Reference architecture: up to 50,000 users | GitLab

Consul:https://archives.docs.gitlab.com/16.7/ee/administration/reference_architectures/index.html#available-reference-architectures

Postgresql拆分

参考文档:

1.gitlab版本和支持的postgresql版本对应关系:Installation system requirements | GitLab

2.配置外部postgresql:Configure GitLab using an external PostgreSQL service | GitLab

以下步骤默认已有高可用的pgstgresql数据库 

1.准备postgresql集群 

  1. 可以选择云厂商提供的pg集群,根据数据库需求文档,创建合适版本的postgresql高可用集群。
  2. 创建gitlab用户
  3. 创建数据库gitlabhq_production,并配置owner为gitlab用户
  4. 开启插件:pg_trgm、btree_gist、plpgsql

手动安装postgresql插件

#安装插件
gitlabhq_production=# CREATE EXTENSION IF NOT EXISTS pg_trgm
gitlabhq_production=# CREATE EXTENSION IF NOT EXISTS btree_gist
gitlabhq_production=# CREATE EXTENSION IF NOT EXISTS plpgsql

#查看插件
gitlabhq_production=# \dx

2./etc/gitlab/gitlab.rb配置

#关闭内置postgresql
postgresql['enable'] = false

#连接postgresql配置信息
gitlab_rails['db_adapter'] = 'postgresql'
gitlab_rails['db_encoding'] = 'unicode'
gitlab_rails['db_database'] = 'gitlabhq_production'
gitlab_rails['db_username'] = 'gitlab'
gitlab_rails['db_password'] = 'your_password'
gitlab_rails['db_host'] = 'your_pg_host'
gitlab_rails['db_port'] = 5432

3.生效配置文件

#reconfigure生效配置文件
gitlab-ctl reconfigure

#重启postgresql,生效TCP端口
gitlab-ctl restart

Redis拆分

参考文档:

1.redis版本选择:Installation system requirements | GitLab

2.配置外部redis:Redis replication and failover providing your own instance | GitLab

3.redis驱逐策略:Redis replication and failover providing your own instance | GitLab

  1. 可以选择云厂商提供的redis,16.x版本的gitlab建议使用6.2及以上的redis版本
  2. 特别不建议使用Redis集群,单可以使用高可用的Redis Standalone
  3. 配置适合的驱逐模式

1./etc/gitlab/gitlab.rb配置

#关闭内置redis服务
redis['enable'] = false

#配置连接外部redis服务胚子和
gitlab_rails['redis_host'] = "your_redis_host"
gitlab_rails['redis_port'] = redis_port
gitlab_rails['redis_password'] = "your_redis_password"

2.生效配置文件

#reconfigure生效配置文件
gitlab-ctl reconfigure

#重启
gitlab-ctl restart / gitlab-ctl restart redis

Gitaly拆分

1.Praefect Postgresql数据库配置

1.Praefect数据库配置:Reference architecture: up to 50,000 users | GitLab

Praefect 是 Gitaly Cluster 的路由和事务管理器,需要自己的数据库服务器来存储有关 Gitaly Cluster 状态的数据。
如果您想要高可用性设置,Praefect 需要第三方 PostgreSQL 数据库。 

  1. 已拥有postgresql(复用gitlabhq_production库使用的postgresql)
  2. 创建praefect用户
  3. 创建数据库praefect_production,并配置owner为praefect用户
#登陆数据库,创建praefect用户
CREATE ROLE praefect WITH LOGIN CREATEDB PASSWORD '<praefect_postgresql_password>';


#切换praefect用户登陆数据库
psql -U praefect -d template1 -h POSTGRESQL_SERVER_ADDRESS

#创建数据库praefect_production
CREATE DATABASE praefect_production WITH ENCODING=UTF8;

#查看数据库创建结果
\l

2.配置Praefect

1.配置Praefect:

Reference architecture: up to 50,000 users | GitLab

Configure Gitaly Cluster | GitLab

2.1.部署准备&注意事项

  1. 从您配置的第一个Linux包节点复制/etc/gitlab/gitlab-securts.json文件,并在此服务器上添加或替换同名文件。如果这是您正在配置的第一个Linux包节点,则可以跳过此步骤。
  2. Praefect必须部署在奇数个3个节点或更高节点中。这是为了确保节点可以将投票作为法定人数的一部分。
  3. Praefect需要连接Postgresql。
  4. Praefect 需要运行一些数据库迁移,就像主 GitLab 应用程序一样。为此,您应该仅选择一个 Praefect 节点来运行迁移,也称为部署节点。必须先配置此节点,然后再配置其他节点。

2.2./etc/gitlab/gitlab.rb配置

Praefect 需要运行一些数据库迁移,就像主 GitLab 应用程序一样。为此,您应该仅选择一个 Praefect 节点来运行迁移,也称为部署节点。必须先配置此节点,然后再配置其他节点,如下所示:

  • 在/etc/gitlab/gitlab.rb文件中,将praefect['auto_migrate']设置值从更改false为true
  • 要确保数据库迁移仅在重新配置期间运行,而不是在升级时自动运行,请运行:
sudo touch /etc/gitlab/skip-auto-reconfigure
  • name: 'default'的值,需要和git_data_dirs配置中的name一致。
  • storage: 'gitaly-1'...,需要和每个gitaly节点的gitaly['configuration'][:storage]中的name一致。
# Avoid running unnecessary services on the Praefect server
gitaly['enable'] = false
postgresql['enable'] = false
redis['enable'] = false
nginx['enable'] = false
puma['enable'] = false
sidekiq['enable'] = false
gitlab_workhorse['enable'] = false
prometheus['enable'] = false
alertmanager['enable'] = false
gitlab_exporter['enable'] = false
gitlab_kas['enable'] = false

# Praefect Configuration
praefect['enable'] = true

# Prevent database migrations from running on upgrade automatically
praefect['auto_migrate'] = false
gitlab_rails['auto_migrate'] = false

# Configure the Consul agent
#consul['enable'] = true
## Enable service discovery for Prometheus
#consul['monitoring_service_discovery'] = true

# START user configuration
# Please set the real values as explained in Required Information section
#

praefect['configuration'] = {
   # ...
   listen_addr: '0.0.0.0:2305',
   auth: {
     # ...
     #
     # Praefect External Token
     # This is needed by clients outside the cluster (like GitLab Shell) to communicate with the Praefect cluster
     token: '<praefect_external_token>',
   },
   # Praefect Database Settings
   database: {
     host: 'POSTGRESQL_HOST',
     user: 'praefect',
     port: 5432,
     password: 'PRAEFECT_SQL_PASSWORD',
     dbname: 'praefect_production',
   },
   # Praefect Virtual Storage config
   # Name of storage hash must match storage name in git_data_dirs on GitLab
   # server ('praefect') and in gitaly['configuration'][:storage] on Gitaly nodes ('gitaly-1')
   # name: 'default'的值,需要和git_data_dirs配置中的name一致
   # storage: 'gitaly-1'...,需要和每个gitaly节点的gitaly['configuration'][:storage]中的name一致
   virtual_storage: [
      {
         # ...
         name: 'default',
         node: [
            {
               storage: 'gitaly-1',
               address: 'tcp://10.6.0.91:8075',
               token: '<praefect_internal_token>'
            },
            {
               storage: 'gitaly-2',
               address: 'tcp://10.6.0.92:8075',
               token: '<praefect_internal_token>'
            },
            {
               storage: 'gitaly-3',
               address: 'tcp://10.6.0.93:8075',
               token: '<praefect_internal_token>'
            },
         ],
      },
   ],
   # Set the network address Praefect will listen on for monitoring
   prometheus_listen_addr: '0.0.0.0:9652',
}

# Set the network address the node exporter will listen on for monitoring
#node_exporter['listen_address'] = '0.0.0.0:9100'

## The IPs of the Consul server nodes
## You can also use FQDNs and intermix them with IPs
#consul['configuration'] = {
#   retry_join: %w(10.6.0.11 10.6.0.12 10.6.0.13),
#}
#
# END user configuration

2.3.生效配置文件

#reconfigure生效配置文件
gitlab-ctl reconfigure

#重启
gitlab-ctl restart / gitlab-ctl restart praefect

2.4.验证Praefect与gitaly的连接配置状态

Praefect和Gitlay都配置完成后,可以连接到Praefect节点上执行命令进行验证

sudo /opt/gitlab/embedded/bin/praefect -config /var/opt/gitlab/praefect/config.toml dial-nodes

3.配置gitaly

1.配置gitaly:

Reference architecture: up to 50,000 users | GitLab

Configure Gitaly Cluster | GitLab

3.1.部署准备&注意事项

  1. 从您配置的第一个Linux包节点复制/etc/gitlab/gitlab-securts.json文件,并在此服务器上添加或替换同名文件。如果这是您正在配置的第一个Linux包节点,则可以跳过此步骤。

3.2. /etc/gitlab/gitlab.rb配置

#开启gitaly服务
gitaly['enable'] = true

#
gitaly['configuration'] = {
  #配置gitaly服务监听地址
  listen_addr: '0.0.0.0:8075',
  #与Praefect服务中的PRAEFECT_INTERNAL_TOKEN需要一致
  auth: {
    token: 'PRAEFECT_INTERNAL_TOKEN',
  },
  #配置存储地址,每个gitaly服务应该有不一样的name('gitaly-1')
  storage: [
    {
      name: 'gitaly-1',
      path: '/var/opt/gitlab/git-data/repositories',
    },
  ],
}

storage配置方法二

可以在同一配置中包括所有节点的数据目录,因为Praefect只会根据自身配置文件中提供的地址路由(如:storage: 'gitaly-1')请求。

gitaly['configuration'] = {
   # ...
   storage: [
     {
       name: 'gitaly-1',
       path: '/var/opt/gitlab/git-data/repositories',
     },
     {
       name: 'gitaly-2',
       path: '/var/opt/gitlab/git-data/repositories',
     },
     {
       name: 'gitaly-3',
       path: '/var/opt/gitlab/git-data/repositories',
     },
   ],
}

3.3.创建git-data目录

gitaly-data目录需要git用户拥有权限,否则会报错。

mkdir -p /var/opt/gitlab/git-data/repositories

chown git: /var/opt/gitlab/git-data/repositories

3.4.生效配置文件

#reconfigure生效配置文件
gitlab-ctl reconfigure

#重启
gitlab-ctl restart / gitlab-ctl restart gitaly

NFS配置

后续拆分Sidekiq & GitLab Rails集群需要用到NFS共享一些目录

Using NFS with GitLab | GitLab

gitlab官方不建议使用云服务商提供的NFS服务,会对影响有不可预估的影响。

部署NFS server可参考:https://docs.gitlab.com/ee/administration/nfs.html#nfs-server

(本问为了方便,没有部署NFS server,直接是有云服务商提供的NFS服务)

这边不得不吐槽一下官网文档,踩坑踩的很痛苦!

  1. 文档写有4个路径需要NFS共享,给出来的表格只列出来3个。而一番google之后,实际上最多有5个路径需要NFS共享。
  2. git-data的路径为什么要共享?也没说清楚。gitaly cluster配置中也没有提到任何需要配置NFS的地方。并且通过Praefect可以配置复制因子来看,gitaly node上存的仓库数据并不一定完全一样的,更像是分布式存储。那为什么需要NFS来共享仓库数据目录?用NFS共享和不用NFS共享的区别是什么?只能自己去探索?

位置描述默认配置
/var/opt/gitlab/gitlab-rails/uploads用户上传的附件gitlab_rails['uploads_directory'] = '/var/opt/gitlab/gitlab-rails/uploads'
/var/opt/gitlab/gitlab-rails/shared诸如构建工件、GitLab 页面、LFS 对象和临时文件等对象。如果您使用 LFS,这也可能占您数据的很大一部分gitlab_rails['shared_path'] = '/var/opt/gitlab/gitlab-rails/shared'
/var/opt/gitlab/gitlab-ci/buildsGitLab CI/CD 构建跟踪gitlab_ci['builds_directory'] = '/var/opt/gitlab/gitlab-ci/builds'
/var/opt/gitlab/.ssh(*可选)SSH authorized_keys文件和用于从其他一些Git服务导入存储库的密钥user['home'] = '/var/opt/gitlab/'
/var/opt/gitlab/git-data(*可选)Git存储库数据。这将占你数据的很大一部分。git_data_dirs({"default" => "/var/opt/gitlab/git-data"})

(可选)/var/opt/gitlab/.ssh

        如果没有使用NFS共享此目录,用户上传的public key会存放再sidekiq其中的一个节点的authorized_keys文件中,但是此文件需要在Gitlab Rails集群的每个节点上都有相同的文件。否则,通过ssh的所有操作都将因没有权限而失败(如git clone ...)。

        那为什么说是可选?官网提到了“Fast lookup of authorized SSH keys”,通过修改OpenSSH的配置文件(/etc/ssh/sshd_config),可以将原本从authorized_keys查找SSH key,改为从数据库中查找。各人觉得这个方法更合适。

具体配置方式:Fast lookup of authorized SSH keys in the database | GitLab

(可选)/var/opt/gitlab/git-data

        为什么这项也是可选?从官网文档中提到可以配置复制因子来看,gitaly cluster上存储的仓库数据,对我来说 gitaly cluster看上去像是可以作为分布式存储。那就不需要NFS来做数据共享。

  1. Praefect不配置复制因子(default_replication_factor未设置),gitlay集群之间节点会互相同步数据,保持数据一致。
  2. 官网文档中提到,对于大性的gitaly cluster(多节点),将存储库复制到每个存储节点是不明智的,通常复制因子3就够了,过高的复制因子会对存储容量造成压力。意思就是说,不将存储库复制到每个存储节点,那么gitaly cluster可以通过增加node节点来横向扩容存储量;反之,每个节点数据都一样,则就意味着只能纵向扩容存储量。
  3. (自己猜想)为什么NFS中,官网提到需要共享git-data目录?在gitaly节点之间用NFS共享数据之后,就省去了在不配置复制因子时,节点之间相互同步数据的动作。也许是这样?

1、2点在官网文档中都可以得到印证,第3点是个人根据官网文档的猜想,目前官网文档中没有明确指出为什么要用NFS共享git-data目录。接下来我会自己测试一下,有结果我会继续更新。

Sidekiq拆分

拆分Sidekiq:

Reference architecture: up to 3,000 users | GitLab

Configure an external Sidekiq instance | GitLab

1.部署准备&注意事项

  1. 从您配置的第一个Linux包节点复制/etc/gitlab/gitlab-securts.json文件,并在此服务器上添加或替换同名文件。如果这是您正在配置的第一个Linux包节点,则可以跳过此步骤。
  2. Sidekqi需要连接Redis、Postgresql、Gitaly。数据对象建议使用对象存储,替代NFS。所以也需要连接对象存储。
  3. 如用NFS共享目录,提前将NFS挂载到对应目录(配置文件中示例为:“/gitlab-nfs/xxx”)

2./etc/gitlab/gitlab.rb配置

       # https://docs.gitlab.com/omnibus/roles/#sidekiq-roles
   roles(["sidekiq_role"])

   ##
   ## To maintain uniformity of links across nodes, the
   ## `external_url` on the Sidekiq server should point to the external URL that users
   ## use to access GitLab. This can be either:
   ##
   ## - The `external_url` set on your application server.
   ## - The URL of a external load balancer, which routes traffic to the GitLab application server.
   ##
   external_url 'https://gitlab.example.com'

   # Configure the gitlab-shell API callback URL. Without this, `git push` will
   # fail. This can be your 'front door' GitLab URL or an internal load
   # balancer.
   gitlab_rails['internal_api_url'] = 'GITLAB_URL'
   #gitlab_shell['secret_token'] = 'SHELL_TOKEN'

   ########################################
   ####              Redis              ###
   ########################################

   ## Must be the same in every sentinel node.
   #redis['master_name'] = 'gitlab-redis' # Required if you have setup redis cluster
   ## The same password for Redis authentication you set up for the master node.
   #redis['master_password'] = '<redis_master_password>'

   ### If redis is running on the main Gitlab instance and you have opened the TCP port as above add the following
   gitlab_rails['redis_host'] = '<redis_host>'
   gitlab_rails['redis_port'] = 6379
   gitlab_rails['redis_password'] = "<redis_password>"

   #######################################
   ###              Gitaly             ###
   #######################################

   ## Replace <gitaly_token> with the one you set up, see
   ## https://docs.gitlab.com/ee/administration/gitaly/configure_gitaly.html#about-the-gitaly-token
   git_data_dirs({
     "default" => {
        "gitaly_address" => "tcp://<praefect_lb_host>:2305",
        "gitaly_token" => "<praefect_external_token>"
     }
   })

   #######################################
   ###            Postgres             ###
   #######################################

   # Replace <database_host> and <database_password>
   gitlab_rails['db_host'] = '<database_host>'
   gitlab_rails['db_port'] = 5432
   gitlab_rails['db_password'] = '<database_password>'
   ## Prevent database migrations from running on upgrade automatically
   gitlab_rails['auto_migrate'] = false

   #######################################
   ###      Sidekiq configuration      ###
   #######################################
   sidekiq['enable'] = true
   sidekiq['listen_address'] = "0.0.0.0"

   ## Set number of Sidekiq queue processes to the same number as available CPUs
   sidekiq['queue_groups'] = ['*'] * 4

   ## Set number of Sidekiq threads per queue process to the recommend number of 20
   sidekiq['max_concurrency'] = 20

   gitlab_rails['uploads_directory'] = '/gitlab-nfs/gitlab-data/uploads'
   gitlab_rails['shared_path'] = '/gitlab-nfs/gitlab-data/shared'
   gitlab_ci['builds_directory'] = '/gitlab-nfs/gitlab-data/builds'

要确保数据库迁移仅在重新配置期间运行,而不是在升级时自动运行,请运行:

sudo touch /etc/gitlab/skip-auto-reconfigure

3.生效配置文件

#reconfigure生效配置文件
gitlab-ctl reconfigure

#重启
gitlab-ctl restart

Gitlab Rails拆分

1.部署准备&注意事项

  1. 从您配置的第一个Linux包节点复制/etc/gitlab/gitlab-securts.json文件,并在此服务器上添加或替换同名文件。如果这是您正在配置的第一个Linux包节点,则可以跳过此步骤。
  2. 从您配置的第一个Linux包节点复制SSH主机密钥(所有密钥的名称格式均为/etc/ssh/ssh_host_*_key*),并在此服务器上添加或替换相同名称的文件。这确保了当用户遇到负载平衡的Rails节点时,不会向用户抛出主机不匹配错误。如果这是您正在配置的第一个Linux包节点,则可以跳过此步骤。
  3. Rails需要连接Redis、Postgresql、Gitaly。数据对象建议使用对象存储,替代NFS。所以也需要连接对象存储。
  4. 如用NFS共享目录,提前将NFS挂载到对应目录(配置文件中示例为:“/gitlab-nfs/xxx”)

2./etc/gitlab/gitlab.rb配置

external_url 'https://gitlab.example.com'

# git_data_dirs get configured for the Praefect virtual storage
# Address is Internal Load Balancer for Praefect
# Token is praefect_external_token
git_data_dirs({
  "default" => {
    "gitaly_address" => "tcp://<praefect_lb_host>:2305", # internal load balancer IP <praefect_service>
    "gitaly_token" => '<praefect_external_token>'
  }
})

## Disable components that will not be on the GitLab application server
roles(['application_role'])
gitaly['enable'] = false
nginx['enable'] = true
sidekiq['enable'] = false

## PostgreSQL connection details
# Disable PostgreSQL on the application node
postgresql['enable'] = false
gitlab_rails['db_host'] = '10.6.0.20' # internal load balancer IP
gitlab_rails['db_port'] = 6432
gitlab_rails['db_password'] = '<postgresql_user_password>'

# Prevent database migrations from running on upgrade automatically
gitlab_rails['auto_migrate'] = false

## Redis connection details
gitlab_rails['redis_host'] = 'redis_host'
gitlab_rails['redis_port'] = 6379
gitlab_rails['redis_password'] = "redis_password"

# Set the network addresses that the exporters used for monitoring will listen on
#node_exporter['listen_address'] = '0.0.0.0:9100'
#gitlab_workhorse['prometheus_listen_addr'] = '0.0.0.0:9229'
#sidekiq['listen_address'] = "0.0.0.0"
puma['listen'] = '0.0.0.0'


## Uncomment and edit the following options if you have set up NFS
##
## Prevent GitLab from starting if NFS data mounts are not available
##
#high_availability['mountpoint'] = '/var/opt/gitlab/git-data'
##
## Ensure UIDs and GIDs match between servers for permissions via NFS
##
#user['uid'] = 9000
#user['gid'] = 9000
#web_server['uid'] = 9001
#web_server['gid'] = 9001
#registry['uid'] = 9002
#registry['gid'] = 9002

gitlab_rails['uploads_directory'] = '/gitlab-nfs/gitlab-data/uploads'
gitlab_rails['shared_path'] = '/gitlab-nfs/gitlab-data/shared'
gitlab_ci['builds_directory'] = '/gitlab-nfs/gitlab-data/builds'

要确保数据库迁移仅在重新配置期间运行,而不是在升级时自动运行,请运行:

touch /etc/gitlab/skip-auto-reconfigure

3.生效配置文件

#reconfigure生效配置文件
gitlab-ctl reconfigure

#重启
gitlab-ctl restart

4.启用增量日志

GitLab Runner 以块的形式返回作业日志,Linux 包默认将这些日志临时缓存在磁盘上 /var/opt/gitlab/gitlab-ci/builds,即使在使用统一对象存储时也是如此。作业完成后,后台作业将归档作业日志。默认情况下,日志将移至工件目录,或者如果配置,则移至对象存储。

使用默认配置时,虽然支持通过 NFS 共享此目录(作业日志),但建议通过启用增量日志记录(未部署 NFS 节点时需要)来避免使用 NFS。增量日志记录使用Redis而不是磁盘空间来临时缓存作业日志。

启用增量日志:Job logs | GitLab

4.1. 要启用增量日志记录

#打开Rails控制台
gitlab-rails console

#启用功能标志
#正在运行的作业的日志继续写入磁盘,但新作业使用增量日志记录。
Feature.enable(:ci_enable_live_trace)

4.2.要禁用增量日志记录

#打开Rails控制台
gitlab-rails console

#禁用功能标志
#正在运行的作业继续使用增量日志记录,但新作业会写入磁盘。
Feature.disable(:ci_enable_live_trace)

5.配置确认

5.1.确认节点可以连接到 Gitaly

确认节点可以连接到Gitaly

sudo gitlab-rake gitlab:gitaly:check

在gitlay节点tail查看请求日志

gitlab-ctl tail gitaly

5.2.(可选)从 Gitaly 服务器确认 Gitaly 可以对内部 API 执行回调

  • 对于 GitLab 15.3 及更高版本,运行sudo /opt/gitlab/embedded/bin/gitaly check /var/opt/gitlab/gitaly/config.toml.
  • 对于 GitLab 15.2 及更早版本,运行sudo /opt/gitlab/embedded/bin/gitaly-hooks check /var/opt/gitlab/gitaly/config.toml.

总结

  • Sidekiq和Gitlab Rails需要用到Redis和Postgresql,Praefect需要使用到Postgresql。
  • Sidekiq和Gitlab Rails需要配置Praefect的连接信息,Praefect需要配置gitaly的连接信息。(访问存储库)
  • 负载均衡器80/443端口后面代理Gitlab Rails(入口)
  • 负载均衡器内部使用的话,可以考虑将外部/内部负载均衡器放在同一个LB上,没有必要一定要分开。
  • 拆分没有特别强依赖的先后顺序,如果此前是all in one的部署方式(直接yum安装,所有组件默认在同一个node),各个组件也可以通过修改配置文件一步一步单独拆出来。
  • 需要Redis6.2以上时,一定要确认Redis是否可以执行Hello 3
  • 对于需要通过NFS/对象存储共享的目录,一定要好好共享,不然踩坑。
  • 吐槽:对于官网文档,使用NFS还是使用对象存储的选择部分,描述太笼统。只知道使用对象存储能带来更好的性能,但是对于使用NFS和使用对象存储的路径的对应关系描述不清,各个路径如果不共享具体影响也没有描述。不过组件确实很多,文档确实巨长,不能事无巨细的描述清楚也可以理解。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/604564.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

BACnet转MQTT网关智联楼宇json格式自定义

智能建筑的BACnet协议作为楼宇自动化领域的通用语言&#xff0c;正逐步迈向更广阔的物联网世界。随着云计算和大数据技术的飞速发展&#xff0c;如何将BACnet设备无缝融入云端生态系统&#xff0c;成为众多楼宇管理者关注的焦点。本文将以一个实际案例&#xff0c;揭示BACnet网…

60、郑州大学附属肿瘤医院 :用于预测胃癌患者术后生存的深度学习模型的开发和验证[同学,我们的人生应当是旷野]

馒头老师要说的话&#xff1a; 我近期看了一下北京的脑机公司&#xff0c;大概是我之前对这一行业太过于乐观&#xff0c;北京的BCI公司和研究所&#xff0c;比上海、深圳、杭州甚至是重庆都要少&#xff0c;门槛也要高很多。也有我自己的原因&#xff0c;有时站的太高&#x…

92、动态规划-最小路径和

思路&#xff1a; 还是一样&#xff0c;先使用递归来接&#xff0c;无非是向右和向下&#xff0c;然后得到两种方式进行比较&#xff0c;代码如下&#xff1a; public int minPathSum(int[][] grid) {return calculate(grid, 0, 0);}private int calculate(int[][] grid, int …

ubuntu_Docker安装配置

什么是docker? Docker 是一个开源的应用容器引擎&#xff0c;让开发者可以打包他们的应用以及依赖包到一个可移植的镜像中&#xff0c;然后发布到任何流行的 Linux或Windows操作系统的机器上&#xff0c;也可以实现虚拟化。容器是完全使用沙箱机制&#xff0c;相互之间不会有…

为什么要梯度累积

文章目录 梯度累积什么是梯度累积如何理解理解梯度累积梯度累积的工作原理 梯度累积的数学原理梯度累积过程如何实现梯度累积 梯度累积的可视化 梯度累积 什么是梯度累积 随着深度学习模型变得越来越复杂&#xff0c;模型的训练通常需要更多的计算资源&#xff0c;特别是在训…

深度学习笔记_10YOLOv8系列自定义数据集实验

1、mydaya.yaml 配置方法 # 这里分别指向你训练、验证、测试的文件地址&#xff0c;只需要指向图片的文件夹即可。但是要注意图片和labels名称要对应 # 训练集、测试集、验证机文件路径&#xff0c;可以是分类好的TXT文件&#xff0c;也可以直接是图片文件夹路径 train: # t…

Litedram仿真验证(四):AXI接口完成板级DDR3读写测试(FPGA-Artix7)

目录 日常唠嗑一、仿真中遗留的问题二、板级测试三、工程获取及交流 日常唠嗑 接上一篇Litedram仿真验证&#xff08;三&#xff09;&#xff1a;AXI接口完成仿真&#xff08;FPGA/Modelsim&#xff09;之后&#xff0c;本篇对仿真后的工程进行板级验证。 本次板级验证用到的开…

学成在线 - 第3章任务补偿机制实现 + 分块文件清理

7.9 额外实现 7.9.1 任务补偿机制 问题&#xff1a;如果有线程抢占了某个视频的处理任务&#xff0c;如果线程处理过程中挂掉了&#xff0c;该视频的状态将会一直是处理中&#xff0c;其它线程将无法处理&#xff0c;这个问题需要用补偿机制。 单独启动一个任务找到待处理任…

Layer1 公链竞争破局者:Sui 生态的全面创新之路

随着 Sui 生态逐渐在全球范围内树立起声望&#xff0c;并通过与 Revolut 等前沿金融科技平台合作&#xff0c;推广区块链教育与应用&#xff0c;Sui 生态的未来发展方向已成为业界瞩目的焦点。如今&#xff0c;Sui 的总锁定价值已攀升至 5.93 亿美元&#xff0c;充分展示了其在…

分布式架构的演技进过程

最近看了一篇文章,觉得讲的挺不错,就借机给大家分享一下。 早期应用:早期的应用比较简单,访问人数有限,大部分的开发单机就能完成。 分离模型:在业务发展后,用户数量逐步上升,服务器的性能出现瓶颈;就需要将应用和数据分开存储,避免相互抢占资源。 缓存模式:随着系…

历代著名画家作品赏析-东晋顾恺之

中国历史朝代顺序为&#xff1a;夏朝、商朝、西周、东周、秦朝、西楚、西汉、新朝、玄汉、东汉、三国、曹魏、蜀汉、孙吴、西晋、东晋、十六国、南朝、刘宋、南齐、南梁、南陈、北朝、北魏、东魏、北齐、西魏、北周、隋&#xff0c;唐宋元明清&#xff0c;近代。 一、东晋著名…

现身说法暑期三下乡社会实践团一个好的投稿方法胜似千军万马

作为一名在校大学生,去年夏天我有幸参与了学院组织的暑期大学生三下乡社会实践活动,这段经历不仅让我深入基层,体验了不一样的生活,更是在新闻投稿的实践中,经历了一次从传统到智能的跨越。回忆起那段时光,从最初的邮箱投稿困境,到后来智慧软文发布系统的高效运用,每一步都刻印…

顺序栈的操作

归纳编程学习的感悟&#xff0c; 记录奋斗路上的点滴&#xff0c; 希望能帮到一样刻苦的你&#xff01; 如有不足欢迎指正&#xff01; 共同学习交流&#xff01; &#x1f30e;欢迎各位→点赞 &#x1f44d; 收藏⭐ 留言​&#x1f4dd;既然选择了远方&#xff0c;当不负青春…

什么是DDoS攻击?DDoS攻击的原理是什么?

一、DDoS攻击概念 DDoS攻击又叫“分布式拒绝服务”(Distributed DenialofService)攻击&#xff0c;它是一种通过控制大量计算机、物联网终端或网络僵尸&#xff08;Zombie&#xff09;来向目标网站发送大量请求&#xff0c;从而耗尽其服务器资源&#xff0c;导致正常用户无法访…

WEB基础--JDBC操作数据库

使用JDBC操作数据库 使用JDBC查询数据 五部曲&#xff1a;建立驱动&#xff0c;建立连接&#xff0c;获取SQL语句&#xff0c;执行SQL语句&#xff0c;释放资源 建立驱动 //1.加载驱动Class.forName("com.mysql.cj.jdbc.Driver"); 建立连接 //2.连接数据库 Stri…

【3dmax笔记】026:挤出和壳修改器的使用

文章目录 一、修改器二、挤出三、壳 一、修改器 3ds Max中的修改器是一种强大的工具&#xff0c;用于创建和修改复杂的几何形状。这些修改器可以改变对象的形状、大小、方向和位置&#xff0c;以生成所需的效果。以下是一些常见的3ds Max修改器及其功能&#xff1a; 挤出修改…

Google Earth Engine谷歌地球引擎计算遥感影像在每个8天间隔内的多年平均值

本文介绍在谷歌地球引擎&#xff08;Google Earth Engine&#xff0c;GEE&#xff09;中&#xff0c;求取多年时间中&#xff0c;遥感影像在每1个8天时间间隔内的多年平均值的方法。 本文是谷歌地球引擎&#xff08;Google Earth Engine&#xff0c;GEE&#xff09;系列教学文章…

神经网络案例实战

&#x1f50e;我们通过一个案例详细使用PyTorch实战 &#xff0c;案例背景&#xff1a;你创办了一家手机公司&#xff0c;不知道如何估算手机产品的价格。为了解决这个问题&#xff0c;收集了多家公司的手机销售数据&#xff1a;这些数据维度可以包括RAM、存储容量、屏幕尺寸、…

JavaScript数字分隔符

● 如果现在我们用一个很大的数字&#xff0c;例如2300000000&#xff0c;这样真的不便于我们进行阅读&#xff0c;我们希望用千位分隔符来隔开它&#xff0c;例如230,000,000; ● 下面我们使用_当作分隔符来尝试一下 const diameter 287_266_000_000; console.log(diameter)…

论文分享[cvpr2018]Non-local Neural Networks非局部神经网络

论文 https://arxiv.org/abs/1711.07971 代码https://github.com/facebookresearch/video-nonlocal-net 非局部神经网络 motivation:受计算机视觉中经典的非局部均值方法[4]的启发&#xff0c;非局部操作将位置的响应计算为所有位置的特征的加权和。 非局部均值方法 NLM&#…
最新文章