我在Raspberry Pi2上安装了Gitlab,它运行了几个月。但是,由于关闭了RPi的功能,它不再起作用了。网页返回502错误。
502哎呀,GitLab花了太多时间回应。
所以我尝试重新配置(sudo gitlab-ctl reconfigure
)但是,它失败并显示错误消息:
FATAL: Errono::EAFNOSUPPORT: Address family not supported by protocol - socket(2)
我不知道如何解决这个问题。
答案 0 :(得分:22)
我没有添加评论,因为我的答案需要一些好的格式。
这意味着,您的端口8080已被使用。我建议停止GitLab,并将独角兽端口从 8080 更改为 8081 (或一些未使用的端口)。
启动/重启GitLab后等待2分钟,你应该没问题。如果没有,请再次检查gitlab-ctl tail
是否有任何错误。
# gitlab-ctl stop
# vi /etc/gitlab/gitlab.rb (change only these lines, uncomment if required)
unicorn['port'] = 8081
gitlab_git_http_server['auth_backend'] = "http://localhost:8081"
# gitlab-ctl reconfigure (to apply the changes)
# gitlab-ctl restart
# lsof -i:8081 (check whether unicorn has started properly)
您需要是root用户或sudo用户(具有root权限)才能运行这些命令。
答案 1 :(得分:16)
我多次看到这样的问题。
如果GitLab工作正常,请不要碰任何东西。等一下似乎GitLab没有正确启动:(
我的意思是在启动系统后你必须等待1-2分钟才能使用GitLab。 GitLab需要一些时间来启动。
答案 2 :(得分:4)
在检查 gitlab-ctl tail (重启循环)后,结果发现没有足够的RAM(2GB),并且在我的新Ubuntu设置中没有交换文件。
如上所述in requirements GitLab需要至少2GB RAM + 2GB交换内存......
所以要创建交换文件,请按照以下步骤操作:
gitlab-ctl stop
mkdir /swap && touch /swap/swapfile.img
dd if=/dev/zero of=/swap/swapfile.img bs=1024 count=2M
#如果您希望4G更改2M到4M chmod 0600 /swap/swapfile.img
mkswap /swap/swapfile.img
nano /etc/fstab
并添加“/swap/swapfile.img swap swap sw 0 0”swapon /swap/swapfile.img
验证是否有效:cat /proc/swaps
Filename Type Size Used Priority
/swap/swapfile.img file 2097148 0 -1
gitlab-ctl start
有关创建交换的更多信息:here
答案 3 :(得分:3)
您可以按照以下步骤解决此类问题。
然后做" gitlab-ctl重新配置"和gitlab-ctl重启
答案 4 :(得分:1)
您应该更改独角兽设置
如果您需要调整Unicorn超时或工作人员数量,可以在/etc/gitlab/gitlab.rb
中使用以下设置。
更改以下内容:
unicorn['worker_processes'] = 3
unicorn['worker_timeout'] = 120 # or any suitable timeout for your server
如果有注释,不要忘记删除行首的#号。
运行sudo gitlab-ctl reconfigure
,以使更改生效。
答案 5 :(得分:0)
在您的情况下,由于未满足安装Gitlab的最低要求,在您的情况下Raspberry Pi2(在我的情况下,在t2.micro AWS EC2实例中)也会发生此错误。
缺少内存(t2.micro是1GiB,但Gitlab需要4GiB)进行进一步处理。因此,正确地提供所有要求(我占用了一个t2.medium实例,它是4GiB而不是t2.micro)。 如果系统已准确启用,那将是合适的。
答案 6 :(得分:0)
需要设置 nginx [' listen_port'] 和 unicorn [' port'] 。 例如:
nginx['listen_port'] = 8081
unicorn['port'] = 8082 #the ports should be different
然后:
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
答案 7 :(得分:0)
您已经更改了一些配置文件,这很可能,请在终端中使用以下行:
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
现在等待几分钟,然后重试。
答案 8 :(得分:0)
您只应更改external_url http://xxx.xxx.xxx.xx:9090
。请勿更改# unicorn['port'] = 8080
。
答案 9 :(得分:0)
我的站点发生端口冲突。 Jenkins已经在我的网站上运行,该网站也使用8080端口。
更改Gitlab或Jenkins端口。
答案 10 :(得分:0)
正在监听8080端口,因此Unicorn无法启动。 以下命令指示什么? 可以在
中覆盖Redis,PostgreSQL和Puma的端口/etc/gitlab/gitlab.rb
如下:
redis['port'] = 1234
postgresql['port'] = 2345
puma['port'] = 3456
有关NGINX端口的更改,请参阅settings / nginx.md。
请参见https://docs.gitlab.com/omnibus/common_installation_problems/#tcp-ports-for-gitlab-services-are-already-taken (已经使用了用于GitLab服务的TCP端口)