阿里云专有网络GitLab6.3.1启动报错 master failed to start
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了阿里云专有网络GitLab6.3.1启动报错 master failed to start相关的知识,希望对你有一定的参考价值。
帮朋友搭建Gitlab环境,前面所有步骤均正常操作,但是在启动时候,报错: master failed to start, check stderr log for details。
硬件环境:阿里云ECS主机
网络:专有网络
启动时现象:
[[email protected] ~]$ /etc/init.d/gitlab restart Removing stale Unicorn web server pid. This is most likely caused by the web server crashing the last time it ran. Shutting down Unicorn. GitLab is not running. Starting both the GitLab Unicorn and Sidekiq. The GitLab Unicorn web server with pid 31138 is running. The GitLab Sidekiq job dispatcher with pid 31146 is running. GitLab and all its components are up and running. #过几秒钟后,弹出以下提示,并且服务自动停止 [[email protected] ~]$ master failed to start, check stderr log for details
错误日志:# tail -30f /home/git/gitlab/log/unicorn.stderr.log 找到报错信息
# tail -30f /home/git/gitlab/log/unicorn.stderr.log I, [2017-08-29T11:31:52.962540 #31138] INFO -- : Refreshing Gem list I, [2017-08-29T11:32:06.664874 #31138] INFO -- : listening on addr=/home/git/gitlab/tmp/sockets/gitlab.socket fd=16 F, [2017-08-29T11:32:06.665194 #31138] FATAL -- : error adding listener addr=*.*.*.*:9000 Errno::EADDRNOTAVAIL: Cannot assign requested address - bind(2) ...
错误中显示,无法绑定IP及监听端口,于是
# ifconfig eth0 Link encap:Ethernet HWaddr 00:16:3E:30:FB:BB inet addr:172.17.68.96 Bcast:172.17.79.255 Mask:255.255.240.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:638415 errors:0 dropped:0 overruns:0 frame:0 TX packets:345807 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:758309941 (723.1 MiB) TX bytes:44165060 (42.1 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:568244 errors:0 dropped:0 overruns:0 frame:0 TX packets:568244 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:76679508 (73.1 MiB) TX bytes:76679508 (73.1 MiB)
因为是单主机,一般创建的时候都会选择阿里云的经典网络,未成想。。他用的专有网络,只有内网IP:172.17.68.96,原因找到了,接下来修改gitlab相关配置
[[email protected] config]$cd /home/git/gitlab/config [[email protected] config]$vim gitlab.yml host: 172.17.68.96 port: 9000 [[email protected] config]$vim unicorn.rb listen "172.17.68.96:9000", :tcp_nopush => true [[email protected] config]$ vim ../../gitlab-shell/config.yml gitlab_url: "http://eip:9000/"
注:eip为阿里云分配的弹性公网IP,请自行更换成自己的eip
重启gitlab
[[email protected] config]$ /etc/init.d/gitlab restart Removing stale Unicorn web server pid. This is most likely caused by the web server crashing the last time it ran. Shutting down Unicorn. GitLab is not running. Starting both the GitLab Unicorn and Sidekiq. The GitLab Unicorn web server with pid 31283 is running. The GitLab Sidekiq job dispatcher with pid 31291 is running. GitLab and all its components are up and running.
查看日志,也未再有错误提示,显示有ready ,正常!
# tail -30f /home/git/gitlab/log/unicorn.stderr.log I, [2017-08-29T11:49:28.139597 #31283] INFO -- : Refreshing Gem list I, [2017-08-29T11:49:41.865250 #31283] INFO -- : listening on addr=/home/git/gitlab/tmp/sockets/gitlab.socket fd=16 I, [2017-08-29T11:49:41.869768 #31283] INFO -- : listening on addr=172.17.68.96:9000 fd=17 I, [2017-08-29T11:49:41.875595 #31283] INFO -- : master process ready I, [2017-08-29T11:49:41.887061 #31309] INFO -- : worker=1 ready I, [2017-08-29T11:49:41.881496 #31307] INFO -- : worker=0 ready
访问 http://eip:9000/ 成功!
本文出自 “大瑞” 博客,请务必保留此出处http://darui.blog.51cto.com/3168426/1960777
以上是关于阿里云专有网络GitLab6.3.1启动报错 master failed to start的主要内容,如果未能解决你的问题,请参考以下文章