【Git】 GitLab配置优化及汉化

GitLab配置

  1、修改GitLab绑定的域名

    a、修改/etc/gitlab/gitlab.rb配置文件,修改成自己的域名

1 external_url ‘http://gitlab.example.com‘

    b、使配置生效

      停止服务命令:gitlab-ctl stop

      配置生效命令:gitlab-ctl reconfigure

    c、启动服务

      命令:gitlab-ctl start

  2、修改GitLab仓库存储位置,GitLab仓库默认位子:/var/opt/gitlab/git-data

    a、创建/data/soft/gitlab/gitlab-data目录,作为仓库存储目录

      命令:mkdir /data/soft/gitlab/gitlab-data

    b、修改gitlab配置文件,找到git_data_dir

      命令:vim /etc/gitlab/gitlab.rb

      增加内容:

1 git_data_dirs({
2   "default" => {
3     "path" => "/data/soft/gitlab/gitlab-data"
4   }
5 })

    c、是配置生效

      停止服务命令:gitlab-ctl stop

      配置生效命令:gitlab-ctl reconfigure

    d、启动服务

      命令:gitlab-ctl start

  3、修改nginx端口,nginx默认端口是80,有可能被占用,修改成其他端口

    a、修改/etc/gitlab/gitlab.rb配置文件

1 nginx[‘listen_port‘] = 28000

    b、修改/var/opt/gitlab/nginx/conf/gitlab-http.conf文件

1 listen *:28000;

    c、使配置生效

      停止服务命令:gitlab-ctl stop

      配置生效命令:gitlab-ctl reconfigure

    d、启动服务

      命令:gitlab-ctl start

  4、修改unicorn端口,unicorn默认端口是8080,有可能被占用,修改成其他端口

    a、修改/etc/gitlab/gitlab.rb配置文件

1 unicorn[‘port‘] = 28001

    b、修改/var/opt/gitlab/gitlab-rails/etc/unicorn.rb文件

1 listen "127.0.0.1:28001", :tcp_nopush => true

    c、使配置生效

      停止服务命令:gitlab-ctl stop

      配置生效命令:gitlab-ctl reconfigure

    d、启动服务

      命令:gitlab-ctl start

  5、修改prometheus端口,prometheus监控默认使用端口是9090,有可能被占用,修改成其他端口

    a、修改/etc/gitlab/gitlab.rb配置文件

prometheus[‘listen_address‘] = ‘localhost:28002‘

    b、使配置生效,参考3点

  6、优化GitLab性能,修改gitlab配置文件/etc/gitlab/gitlab.rb

    官方推荐最低物理配置是 2核4G(本例使用的是1核2G运行比较慢)

    a、减少进程数与超时时间

1 # 超时时间
2 unicorn[‘worker_timeout‘] = 60
3
4 # 不能低于2,否则卡死 worker=CPU核数+1
5 unicorn[‘worker_processes‘] = 2

    b、GitLab默认使用了PostgreSQL,优化PostgreSQL

# 减少数据库缓存大小 默认256,可适当改小
postgresql[‘shared_buffers‘] = "256MB"

# 减少数据库并发数
postgresql[‘max_worker_processes‘] = 8

# 减少sidekiq并发数
sidekiq[‘concurrency‘] = 10 

    c、减少unicorn内存使用

# 减少内存
unicorn[‘worker_memory_limit_min‘] = "200 * 1 << 20"
unicorn[‘worker_memory_limit_max‘] = "300 * 1 << 20" 

原文地址:https://www.cnblogs.com/h--d/p/10153647.html

时间: 2024-08-03 21:17:14

【Git】 GitLab配置优化及汉化的相关文章

gitlab的安装以及汉化

gitlab的安装 首先在网上下载好任意版本gitlab的rpm包 推荐下面的地址: https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.8.5-ce.1.el7.x86_64.rpm 1 [[email protected] ~]# rz -E 2 3 rz waiting to receive. 4 5 [[email protected] ~]# ls 6 7 anaconda-ks.cfg gitlab-c

gitlab的搭建与汉化

gitlab的搭建:内存最好2G以上 yum -y install curl unzip policycoreutils git wget         安装相关依赖包 所有gitlab rpm包的地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/ 下载安装包:wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-10.0.0-ce.0.el6

gitlab搭建部署及汉化

1.在清华大学源下载gitlab的rpm包(选择gitlab-ce社区版下载,以12.4.8版本为例): https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/ 2.使用SecureCRT上传rpm包. 在连接的宿主机中安装lrzsz,安装命令yum install  lrzsz 输入rz密令,选择下载好的rpm包. 3.安装gitlab. (1)下载gitlab所依赖的包. yum install -y curl postfix policycor

【JMeter4.0】之 “jdk、JMeter” 安装与配置以及JMeter汉化和更改界面背景

一.首先,需要安装.配置jdk 1.到官网下载1.8jdk:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 2.安装jdk后,配置环境变量: ①在系统变量[Path]中设置值为, 填写Java安装的路径定位到BIN目录:F:\ruanjian\Java\jdk1.8.0_171\bin; 变量名:[path] 变量值:[F:\ruanjian\Java\jdk1.8.0_171

CodeBlocks17.12配置GNU GCC + 汉化

Codeblocks17.12以及Gcc和汉化包链接: 链接:https://pan.baidu.com/s/1F23fjvi8xRpQ9xR14ILpEA 提取码:90d6 一.TDM-GCC 的安装: 二.GCC配置 打开codeblock,点击Settings->Complier(设置->编译器)进入: 1.Toolchain Executables (可执行工具链),    然后点击 Auto-detect (点击自动检测) 2.按照图中标识操作, 点击  ... (三个点),添加对应

CentOS源码安装GitLab汉化版

示例环境: 软件 版本 CentOS 6.5 x86_64 Git 2.6.2 Ruby 2.2.3 Node.js 4.2.1 Redis 3.0.5 MariaDB 10.0.21 GitLab 8.0.5汉化版 GitLab Shell 2.6.6 Nginx 1.8.0 Go 1.5.1 Gitlab-git-http-server 0.2.14 一.修改Yum源为阿里云提高下载速度 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.

安装gitlab并汉化

简介: GitLab是一个利用Ruby on Rails开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目. 它拥有与GitHub类似的功能,能够浏览源代码,管理缺陷和注释.可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库. 团队成员可以利用内置的简单聊天程序(Wall)进行交流.它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找. 引言:刚从阿里买的4g的服务器,尝试装gitlab 1. 请在代理环

CentOS源码安装GitLab汉化版第2版

软件版本: CentOS 7.2 Git 2.12.0 Ruby 2.3.3 Node.js 6.10.1 Redis 3.2.8 MariaDB 10.1.20 GitLab 8.8.5汉化版 GitLab Shell 2.7.2 Nginx 1.10.3 Go 1.8 GitLab-Workhorse 0.7.1 一.安装依赖 yum -y install libicu-devel patch gcc-c++ readline-devel zlib-devel libffi-devel op

gitlab汉化及关联LDAP

?  环境说明 公司新增AI部门,要为前端项目搭建gitlab平台,但是公司的jira和confluence等公共服务都是用LDAP来同一认证进行登录的,由于gitlab社区版本安装后是英文版,使用不是很方便,在汉化上,百度了好多办法最后终于解决了 ?  服务器环境 系统版本 cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) 关闭防火墙 systemctl status firewalld ● firewalld.servi