curl https://packages.gitlab.com/install/repositories/gitlab/gitlabce/script.rpm.sh > gitlab-ee_install.shsh gitlab-ee_install.shexport EXTERNAL_URL=https://gitlab.example.comyum install -y curl policycoreutils-python openssh-server cronierpm -ivh gitlab-ce-13.10.2-ce.0.el7.x86_64.rpm
GitLab 版本 | 最⼩⽀持的 PostgreSQL 版本 |
13.0 | 11 |
14.0 | 12 |
psql -U <数据库管理员> -p <端口> -d postgres -h <访问地址>
pg_tencentdb_superuser
。create user gitlab login password 'gitlab_****_password#123';grant gitlab to <当前管理员帐号>; grant pg_tencentdb_superuser to gitlab;
create database gitlab owner=gitlab ENCODING = 'UTF8';
pg_trgm、btree_gist、plpgsql
插件,⽆需提前创建,在初始化 GitLab 时候将⾃动创建。但是需要保证能创建成功。# cat /etc/gitlab/gitlab.rb |grep -v ^# | grep -v ^$external_url 'http://gitlab.example.com'
## postgresql connect## 此参数设置为 false 指禁用内置的 postgresql,而使用外部 postgresql 数据源postgresql['enable'] = falsegitlab_rails['db_adapter'] = "postgresql"gitlab_rails['db_encoding'] = "utf8"## 数据库名gitlab_rails['db_database'] = "gitlab"gitlab_rails['db_pool'] = 100 ## 数据库用户gitlab_rails['db_username'] = "gitlab"## 密码,请根据自身配置修改gitlab_rails['db_password'] = "gitlab_Test_password#123" ## 访问地址gitlab_rails['db_host'] = "gz-tdcpg-ep-6kvx6p19.sql.tencentcdb.com" ## 访问端口gitlab_rails['db_port'] = "25870"
ActiveRecord::ConnectionNotEstablished: could not translate host name "gz-tdcpgep-6kvx6p19.sql.tencentcdb.com " to address: Name or service not known
ping
命令找到此域名的 IP 地址或者找到能解析此域名的 DNS 服务器,不建议将访问地址的域名直接修改为 IP 地址,因为使⽤域名的场景常伴有数据库后端是做了负载均衡或者⾼可⽤,可直接在服务器中配置 DNS 服务器或者 host。若数据库服务有变化,则可直接修改 host 或者 DNS 服务,避免对 GitLab 服务进⾏修改。gitlab Reconfigured!
时,说明已经初始化完成。gitlab-ctl reconfigure
gitlab-ctl startok
http://{可访问的服务器 IP 地址}/users/sign_in
登录界面如下:
Password stored to /etc/gitlab/initial_root_password. This file will becleaned up in first reconfigure run after 24 hours.
本页内容是否解决了您的问题?