在CentOS中安装GitLab时,可以选择使用 PostgreSQL 作为数据库。自从GitLab 12.1版本开始,后端存储不再支持MySQL,而是仅支持PostgreSQL。以下是安装GitLab并配置PostgreSQL数据库的简要步骤:
sudo yum -y updatesudo yum install -y curl openssl-devel policycoreutils-python openssh-server perl git nodejs rsync cronie postfix
cd ~ && sudo yum install -y wget && sudo wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-17.3.1-ce.0.el7.x86_64.rpm/download.rpm
rpm -i gitlab-ce-17.3.1-ce.0.el7.x86_64.rpm
修改 /etc/gitlab/gitlab.rb
配置文件:
vi /etc/gitlab/gitlab.rb
设置外部URL(如果需要从外部访问GitLab):
external_url 'http://gitlab.example.com'
配置PostgreSQL:
重新配置并重启GitLab:
gitlab-ctl reconfigure
gitlab-ctl restart
请注意,具体的安装步骤和配置可能会因GitLab版本和服务器环境的不同而有所差异。建议参考GitLab的官方文档或相关教程以获取最准确的信息。