当前位置: 首页> 汽车> 时评 > 在系统已经存在postgres时,安装gitlab

在系统已经存在postgres时,安装gitlab

时间:2025/7/11 19:05:28来源:https://blog.csdn.net/fanre/article/details/139993308 浏览次数: 1次

https://about.gitlab.com/install/#ubuntu

1、下载 

https://packages.gitlab.com/app/gitlab/gitlab-ce/search?q=&filter=debs&dist=

2、安装

sudo EXTERNAL_URL="http://xx.xx.xx.xx:xxxx" dpkg -i gitlab-ce_17.0.2-ce.0_amd64.deb

3、postgres数据库配置

Gitlab-5.配置外部PostgreSQL_gitlab 禁用postgresql-CSDN博客

https://www.cnblogs.com/linkenpark/p/8359216.html

sudo -s -u postgres#登录postgres
psql
create user gitlab with password 'gitlab';#创建用户
create database gitlabhq_production OWNER gitlab;#创建数据库
GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production TO gitlab;#赋予权限
sudo -u postgres psql -c 'SHOW unix_socket_directories;'#查看socket地址

 4、gitlab配置

vim /etc/gitlab/gitlab.rb
EXTERNAL_URL="http://xx.xx.xx.xx:xxx"
postgresql['enable'] = false#关闭gitlab自带postgresql
gitlab_rails[db_username’] = “gitlab”#设置postgresql用户名
gitlab_rails[db_password’] = “gitlab”#设置postgresql密码
postgresql['dir']" ="/var/run/postresql"#修改postgresql的socket地址
puma[‘port’] = 3333#修改puma端口
githlab_workhorse['auth_backend'] = "http://localhost:3333"
sudo gitlab-ctl reconfigure#重新配置
sudo gitlab-ctl restart #重启
sudo gitlab-rails dbconsole#查看数据连接情况#以防万一,可以将某些权限打开
cd /var/opt/gitlab
sudo chmod 777 -R *
cd /opt/gitlab
sudo chmod 777 -R *

 5、如果忘了密码,重置root密码

重置gitlab root初始密码_gitlab修改初始密码-CSDN博客

sudo gitlab-rails console -e production
user = User.find_by(username: 'root')
user.password = 'xxxx'
user.password_confirmation = 'xxxx'
user.save!

关键字:在系统已经存在postgres时,安装gitlab

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: