CentOs7 安装gitlab

访问下面的gitlab官网,并选择CentOs7的安装步骤:
https://about.gitlab.com/install/
按顺序执行,下面的命令:
在这里插入图片描述
在这里插入图片描述
其中"http://gitlab.example.com",这个地址为,安装完gitlab以后,访问gitlab的地址,要改成你自己的。地址中包含的端口号,要在centOs防火墙里,把端口号开放出来,开放命令如下:

关闭防火墙:systemctl stop firewalld
查看所有打开的端口: firewall-cmd --zone=public --list-ports
开放端口号80:firewall-cmd --zone=public --add-port=80/tcp --permanent
重载:firewall-cmd --reload

如遇到访问gitlab遇到502,可能是因为,端口号被占用(因为我本地用docker安装了一个gitlab,有冲突)。或者可能是内存原因。

本地项目上传gitlab,先在网页上create project(项目名和本地项目相同)

下面是本地项目上传命令:

生成gitlab key
ssh-keygen -t rsa -C “root”

登录gitlab add key


git config --global user.email “xxxxxxx@xx.com”

git config --global user.name “root”

git init

git remote add origin ssh://git@http://192.168.1.115:9999/root/zookeeper_dubbo_springboot.git

git add .

git commit -m ‘first commit’

git push -u origin master

–如果还报错
git remote rm origin //删除
git remote add origin ssh://git@http://192.168.1.115:9999/root/zookeeper_dubbo_springboot.git //添加新的地址

git push -u origin master

----优化gitlab
----创建分区:https://www.cnblogs.com/yoyoketang/p/10281892.html
dd if=/dev/zero of=/mnt/swap bs=512 count=8388616
mkswap /mnt/swap
vim /etc/sysctl.conf

vm.swappiness = 0
net.ipv4.neigh.default.gc_stale_time=120

vm.swappiness = 60
net.ipv4.neigh.default.gc_stale_time=120

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值