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

发布于:2024-06-27 ⋅ 阅读:(196) ⋅ 点赞:(0)

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!


网站公告

今日签到

点亮在社区的每一天
去签到