源码搭建gitlab那些坑

前言:先吐槽下源码搭建gitlab,网上找了一堆教程,和gitlab中文官网gitlab 因为第一次搭建,遇到各种问题 各种坑。

1)例子:在买了阿里云服务器后,安装了gitlab,tm出了问题,想还原纯净系统 怎么办?那就a)先去阿里云停止 b)更换系统盘 但是问题就来了,上次ssh root了,再次ssh root出现问题如下:
[cc lang=c]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
6c:74:2a:d5:ae:2b:76:51:*:*.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:20
RSA host key for 123.88.88.88** has changed and you have requested strict checking.
Host key verification failed.
[/cc]

解:方法一) 在终端电脑的路径下(推荐)
[cc lang=c]
vi ~/.ssh/known_hosts
[/cc]
找到你的IP,1)按esc 2)然后dd 3)esc 4):(shitf+:) 5)wq 就ok!

如果对于vi 不太熟悉,可以看看这个(vi编辑教程)想直接省事可以尝试方法二
方法二) 直接进入这个目录直接删除就好,或者终端命令(不过要主要哦~ 把别的ssh要删除了):
[cc lang=c]
cd ~/.ssh/
rm -rfknown_hosts
[/cc]
再次登陆就ok~

2)例子:git用户已经存在问题~
[cc lang=c]
useradd –comment ‘GitLab’ git
useradd: user ‘git’ already exists
[/cc]
解:如果要删除git用户:
* 连同用户主目录一块删除 git是用户名
[cc lang=c]
sudo userdel -r git
[/cc]
*如果要删除正在登录的用户可以使用-f参数
[cc lang=c]
sudo userdel -f git
[/cc]
注意: useradd 或adduser userdel

3)例子:无法创建目录,文件已存在(public为例)
[cc lang=c]
macRong$: sudo -u git -H mkdir public/uploads
macRong$: mkdir: 无法创建目录”public/uploads”: 文件已存在
[/cc]
解:
[cc lang=c]
mkdir public chmod 777
mkdir uploads
[/cc]

4)例子:镜像问题,切换为国内淘宝镜像

[cc lang=c]
Gem::RemoteFetcher::FetchError: Errno::ECONNRESET: Connection reset by peer – SSL_connect (https://rubygems.org/gems/rack-attack-4.2.0.gem)
Installing rack-protection 1.5.1
Installing treetop 1.4.15
Installing select2-rails 3.5.2
Installing fog-json 1.0.0
Installing jwt 0.1.13
Installing sprockets 2.11.0
Installing haml 4.0.5
Installing coercible 1.0.0
Installing axiom-types 0.0.5
Installing bootstrap-sass 3.0.3.0
Bundler::GemspecError: Could not read gem at /home/git/gitlab/vendor/bundle/ruby/2.1.0/cache/semantic-ui-sass-1.8.0.0.gem. It may be corrupted.
An error occurred while installing hitimes (1.2.2), and Bundler cannot continue.
Make sure that gem install hitimes -v '1.2.2' succeeds before bundling.
[/cc]

解:
[cc lang=c]
cd /home/git/gitlab/
vi Gemfile
[/cc]
把source “https://rubygems.org” 修改为https://ruby.taobao.org
(如果不懂vi 请看vi教程
[cc lang=c]
sudo yum -y install cmake
sudo gem install rugged -v ‘0.21.4’
[/cc]类似这样的,需要手动安装的gem ,手动安装,然后继续执行上面的bundle install

5)继续更新中…

总结:因为第一次安装 搞服务器不太懂,小白教程,记录那些坑。希望对大家有所帮助,如有不准确之处请及时指正 谢谢~

在 “源码搭建gitlab那些坑” 上有2个观点

发表回复

电子邮件地址不会被公开。 必填项已用*标注