阿里雲專有網絡GitLab6.3.1啓動報錯 master failed to start

幫朋友搭建Gitlab環境,前面所有步驟均正常操作,但是在啓動時候,報錯: master failed to start, check stderr log for details。


硬件環境:阿里雲ECS主機

網絡:專有網絡


啓動時現象:

[git@iZ2ze2wsg ~]$ /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.

#過幾秒鐘後,彈出以下提示,並且服務自動停止
[git@iZ2ze2wsg ~]$ 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相關配置

[git@iZ2ze2wsg config]$cd /home/git/gitlab/config

[git@iZ2ze2wsg config]$vim gitlab.yml
host: 172.17.68.96
port: 9000

[git@iZ2ze2wsg config]$vim unicorn.rb
listen "172.17.68.96:9000", :tcp_nopush => true

[git@iZ2ze2wsg config]$ vim ../../gitlab-shell/config.yml
gitlab_url: "http://eip:9000/"

注:eip爲阿里雲分配的彈性公網IP,請自行更換成自己的eip


重啓gitlab

[git@iZ2ze2wsg 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/  成功!

wKioL1mk6d_iUBfcAABnd-Ec0N8570.png-wh_50


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章