GitLab升级到5.1注意事项

1. GitLab-Shell仍然需要正确配置才能访问GitLab,否则你在远端用git协议pull的时候会看到错误信息:

git pull
/usr/local/lib/ruby/1.9.1/net/http.rb:762:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)
 from /usr/local/lib/ruby/1.9.1/net/http.rb:762:in `open'
 from /usr/local/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
 from /usr/local/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
 from /usr/local/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
 from /usr/local/lib/ruby/1.9.1/net/http.rb:762:in `connect'
 from /usr/local/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
 from /usr/local/lib/ruby/1.9.1/net/http.rb:744:in `start'
 from /home/git/gitlab-shell/lib/gitlab_net.rb:56:in `get'
 from /home/git/gitlab-shell/lib/gitlab_net.rb:17:in `allowed?'
 from /home/git/gitlab-shell/lib/gitlab_shell.rb:51:in `validate_access'
 from /home/git/gitlab-shell/lib/gitlab_shell.rb:21:in `exec'
 from /home/git/gitlab-shell/bin/gitlab-shell:16:in `<main>'

或者这种错误:

git pull
/usr/local/lib/ruby/1.9.1/net/http.rb:799:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
 from /usr/local/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
 from /usr/local/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
 from /usr/local/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
 from /usr/local/lib/ruby/1.9.1/net/http.rb:799:in `connect'
 from /usr/local/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
 from /usr/local/lib/ruby/1.9.1/net/http.rb:744:in `start'
 from /home/git/gitlab-shell/lib/gitlab_net.rb:56:in `get'
 from /home/git/gitlab-shell/lib/gitlab_net.rb:17:in `allowed?'
 from /home/git/gitlab-shell/lib/gitlab_shell.rb:51:in `validate_access'
 from /home/git/gitlab-shell/lib/gitlab_shell.rb:21:in `exec'
 from /home/git/gitlab-shell/bin/gitlab-shell:16:in `<main>'

通过查看/home/git/gitlab-shell/lib/gitlab_net.rb文件的代码可以看到这段:

http.use_ssl = (url.scheme == 'https')

if config.http_settings['self_signed_cert'] && http.use_ssl?
      http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    end

两个条件:

1.self_signed_cert设置为true

2.url要用https

回到config.yml文件中,这样配置:

# Url to gitlab instance. Used for api calls. Should be ends with slash.                                                                                                                                           
gitlab_url: "https://localhost/"

http_settings:
#  user: someone                                                                                                                                                                                                   
#  password: somepass                                                                                                                                                                                               
  self_signed_cert: true

第一个问题搞定。

2. 重启时老看到这个错误:

* Listening on unix:///home/git/gitlab/tmp/sockets/gitlab.socket
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/puma-2.0.0.b7/lib/puma/binder.rb:234:in `initialize': Address already in use - /home/git/gitlab/tmp/sockets/gitlab.socket (Errno::EADDRINUSE)
 from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/puma-2.0.0.b7/lib/puma/binder.rb:234:in `new'
 from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/puma-2.0.0.b7/lib/puma/binder.rb:234:in `add_unix_listener'
 from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/puma-2.0.0.b7/lib/puma/binder.rb:96:in `block in parse'
 from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/puma-2.0.0.b7/lib/puma/binder.rb:64:in `each'
 from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/puma-2.0.0.b7/lib/puma/binder.rb:64:in `parse'
 from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/puma-2.0.0.b7/lib/puma/cli.rb:414:in `run_single'
 from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/puma-2.0.0.b7/lib/puma/cli.rb:402:in `run'
 from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/puma-2.0.0.b7/bin/puma:10:in `<top (required)>'
 from /home/git/gitlab/vendor/bundle/ruby/1.9.1/bin/puma:23:in `load'
 from /home/git/gitlab/vendor/bundle/ruby/1.9.1/bin/puma:23:in `<main>'

处理方法:

1.先用ps-def | grep gitlab 命令找到还运行的进程id,然后kill -9 干掉

2.删除下面的文件

/home/git/gitlab/tmp/sockets/gitlab.socket

现在启动,应该可以了。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/db20af7e56565183c3fe081c81a603c7.html