“Gitlab社区版安装和配置”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
第6行: 第6行:
 
os: centos6.X
 
os: centos6.X
  
==第零 docker for gitlab  ==
+
==第零 docker-compose for gitlab  ==
 
<pre>
 
<pre>
  
第88行: 第88行:
 
密码: 5iveL!fe  现在一般要自己配置密码的了  
 
密码: 5iveL!fe  现在一般要自己配置密码的了  
  
 +
</pre>
  
 
+
[https://docs.gitlab.com/ee/install/docker.html  Install GitLab with Docker]
 
 
</pre>
 
  
 
==gitlab搭配ssh默认端口引发的问题  ==
 
==gitlab搭配ssh默认端口引发的问题  ==

2020年11月23日 (一) 03:36的版本

pre

gitlab社区版安装和配置

os: centos6.X

第零 docker-compose for gitlab  



2020 直接 docker-compose 其实可以上 alpine的 

cat docker-compose.yml


web:
  image: 'gitlab/gitlab-ce:11.4.3'
  #image: 'gitlab/gitlab-ce:latest'  
  restart: always
  hostname: 'mygitlab'
  environment:
    GITLAB_OMNIBUS_CONFIG: |
      external_url 'http://gitlab.lliao.net'
      #external_url 'https://mygitlab.com'
      # Add any other gitlab.rb configuration here, each on its own line
  ports:
    - '7080:80'
    - '4433:443'
    - '2222:22'
  volumes:
    - ./gitlab/config:/etc/gitlab
    - ./gitlab/logs:/var/log/gitlab
    - ./gitlab/data:/var/opt/gitlab







#这个手工的 线上一般不用了 以前学习用的

获取 GitLab 镜像
docker search gitlab

docker pull gitlab/gitlab-ce:latest

查看本地镜像
docker images

创建目录

mkdir -p /data/gitlab/{config,data,logs}

创建并运行容器

docker run --detach \
       --hostname git.evan.com \
       --publish 443:443 \
       --publish 80:80 \
       --publish 222:22 \
       --name gitlabce\
       --restart always \
       --volume /data/gitlab/config:/etc/gitlab \
       --volume /data/gitlab/logs:/var/log/gitlab \
       --volume /data/gitlab/data:/var/opt/gitlab \
       gitlab/gitlab-ce:latest


查看运行状态

docker ps
netstat -ntulap | grep docker
访问 GitLab

启动
docker start gitlabce

docker stop gitlabce

http://git.evan.com/

如果没有域名,直接使用 IP 访问即可。
初始账户

用户: root
密码: 5iveL!fe  现在一般要自己配置密码的了 

Install GitLab with Docker

gitlab搭配ssh默认端口引发的问题

明明 docker-compose.yml  用 了222端口但还是有问题 



修改sshd_config中的Port

service sshd restart

#第一步的我没改哦 好像可以不动 
修改/etc/gitlab/gitlab.rb [再次声明,gitlab.yml中的配置会被这个给覆盖]

启用下面这行,并把端口改为自己服务器的sshd端口

gitlab_rails['gitlab_shell_ssh_port'] = 50022

使之生效,大功告其!

gitlab-ctl reconfigure


第一种 Install and configure the necessary dependencies

进入gitlab官方网站,选择对应的操作系统——CentOS 6 (and RedHat/Oracle/Scientific Linux 6),
https://about.gitlab.com/downloads/#centos6

按照官方的提示进行安装:
安装配置必要的依赖
在Centos 6 和 7 中,以下的命令将会打开HTTP和SSH在系统防火墙中的可访问权限。

#sudo lokkit -s http -s ssh





[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key


sudo yum makecache

# 安装依赖包
sudo yum install curl openssh-server openssh-clients postfix cronie
# 启动 postfix 邮件服务
sudo service postfix start
# 检查 postfix
sudo chkconfig postfix on
# 安装 GitLab 社区版
sudo yum install gitlab-ce
# 初始化 GitLab 配置并启动GitLab
打开/etc/gitlab/gitlab.rb,将external_url = ‘http://git.example.com’修改为自己的IP地址:http://xxx.xx.xxx.xx,,然后执行下面的命令,对GitLab进行编译。





sudo gitlab-ctl reconfigure
一直都有更新的。



sudo gitlab-ctl reconfigure
登录GitLab
Username: root
Password: 5iveL!fe





我在ubuntu下的一键安装,如果用汉化版的有问题的。
所以现在只能用英文原版的。


现在会要求改密码了 在第一次 

dkm12345678



git_data_dirs({"default" => "/data/gitlab/git-data"})
/data/gitlab/git-data

gitlab-ctl reconfigure 

 

第二种 Add the GitLab package server and install the package

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce 

 

 


【gitlab小症状】gitlab搭配ssh默认端口引发的血战

docker安装gitlab并使用非标准端口

gitlab性能优化调化 占用内存过大问题


/etc/gitlab/gitlab.rb

#进程数目 
 unicorn['worker_processes'] = 2

#减少数据库缓存 默认为  256M
postgresql['shared_buffers'] = "128MB"


#减少并发数 默认为8
postgresql['max_worker_processes'] = 4



#减少 sidekiq并发数 
sidekiq['concurrency'] = 20


#最后  reload 
gitlab-ctl reconfigure

gitlab占用内存过大问题

GitLab配置优化及汉化


报错

================================================================================
Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb
================================================================================

RuntimeError
------------
GitLab external URL must include a schema and FQDN, e.g. http://gitlab.example.com/

记得前缀有http样

https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/

https://www.linuxchina.net/?p=2750

 

see also

GitLab Docker images

在 CentOS 7 上使用 Docker 部署安装 GitLab

GitLab 中文社区版 Docker 镜像

ouyangzhiping/docker-gitlab.md

GitLab的安装及使用教程