使用MobaXterm登录ECS
一、下载gitlab安装包:
[root@izabc ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.4.2-ce.0.el7.x86_64.rpm
二、安装
[root@izabc ~]#rpm -i gitlab-ce-12.4.2-ce.0.el7.x86_64.rpm
三、修改gitlab配置
[root@izabc ~]#vim /etc/gitlab/gitlab.rb
1,修改external_url="公IP:8084"
2,开放以下二项并设置端口为8090(此端口不要与其它端口冲突,先用netstat -ano | grep 8090查看一下是否有别的进程在使用)
unicorn['listen'] = 'localhost'
unicorn['port'] = 8090
四、修改nginx配置
[root@izabc ~]#vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
修改80为8084

四、重置并启动GitLab
[root@izabc ~]#gitlab-ctl reconfigure
五、访问gitlab页面

六、在访问gitlab页面时报502的问题
百度出来的大部分结果是说要设置swap分区,其实不一定。我是在看了一篇文章说设置unicorn['port'] = 9090,就设置为9090了,而没有查询此端口有没有被使用。在准备划分swap分区前,使用netstat -ano | grep 9090查了一下,出来好几个进程都在使用,于是换成了一个没有进程在用的端口号8090,再刷新gitlab访问页面就成功了。
------
最后,准备把gitlab卸载掉了,因为4G内存占用93%以上,停掉gitlab之后,下降到38%。改用github。
网友评论