【gitlab】安装,忘记root密码

https://blog.youkuaiyun.com/duyusean/article/details/80011540

硬件要求,内存4g,cpu 2核

wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

sudo yum install -y curl policycoreutils-python openssh-server openssh-clients

 sudo systemctl enable sshd

sudo systemctl start sshd 

 sudo firewall-cmd –permanent –add-service=http

 sudo firewall-cmd --permanent --add-service=http

firewall-cmd --list-services

service firewalld  start

service firewalld  stop

sudo yum install postfix

sudo systemctl enable postfix

 sudo systemctl start postfix

systemctl status postfix.service

rpm -i gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm

 vim  /etc/gitlab/gitlab.rb,这里的external_url和 unicorn['port']不能填写同一个端口,不然会报500

gitlab-ctl reconfigure

gitlab-ctl restart

 

gitlab-ctl tail . 查看日志

 sudo gitlab-ctl tail unicorn 查看unicorn日志

netstat -ntpl  查看端口占用情况

 

 

环境:gitlab 忘记了root密码,无法登陆gitlab

解决:

gitlab-ctl start 保证gitlab处于启动状态,&保证redis处于启动状态

 gitlab-rails console production 进入gitlab串口环境下

irb(main):001:0>user = User.where(id: 1).first 定位到gitlab 数据库中Users表中的一个用户,通常就是管理员用户admin@local.host

irb(main):002:0> user.password=12345678   重置管理员密码为12345678

irb(main):003:0> user.password_confirmation=12345678   确认管理员密码为12345678

irb(main):004:0> user.save!    保存更改信息

 

如下提示代表成功:

irb(main):004:0> user.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 7dc9cc44-0296-4a62-8b9a-335d4d5da11b) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值