In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Official installation tutorial
Gitlab / gitlab-ce
Download from the official website: https://www.gitlab.cc/downloads
Official website installation instructions: https://doc.gitlab.cc/ce/install/requirements.html
Comparison between open source version and enterprise version: https://www.gitlab.cc/features/#enterprise
Resolve situations that cannot be installed officially
Gitlab Community Edition Image usage help
Install Gitlab through Omnibus one-click installation package on Ali Cloud
Edit sourc
Use the TUNA mirror source of Tsinghua University to open the URL and copy the content to the gitlab-ce.repo file and edit the path.
Vim / etc/yum.repos.d/gitlab-ce.repo [gitlab-ce] name=gitlab-cebaseurl= http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6repo_gpgcheck=0gpgcheck=0enabled=1gpgkey=https://packages.gitlab.com/gpg.key updates the local YUM cache sudo yum makecache to establish the yum repository of the new version of nginx wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpmrpm-ivh nginx-release-centos- 6-0.el6.ngx.noarch.rpm install git
If you have already installed git with yum and the version is earlier than 2.7.4, uninstall the old version first.
Yum install vim curl openssh-server openssh-clients gcc-c++ zlib1g-dev zlib-devel curl-devel expat-devel gettext-devel opgcc perl-ExtUtils-MakeMakeryum remove git
Install git using source code compilation
Mkdir / tmp/git & & cd / tmp/gitcurl-O-- progress https://www.kernel.org/pub/software/scm/git/git-2.8.5.tar.gztar zxvf git-2.8.5.tar.gzcd git-2.8.5./configuremake prefix=/usr/local all# installed to / usr/local/binmake prefix=/usr/local install# verify git version number git--version# View git installation path which git# create soft connection ln -s / usr/local/bin/git / usr/bin/git install GitLab Community Edition sudo yum install gitlab-ce # (automatically install the latest version) sudo yum install gitlab-ce-8.8.4-ce.0.el6 # (install the specified version)
Configure and start GitLab# vim / etc/gitlab/gitlab.rb # find external_url 'http://000.00.00.00:8081' # and change it to your address # and then execute the following command to compile GitLab. Sudo gitlab-ctl reconfigure# starts gitlabsudo gitlab-ctl restart
Problems that may be encountered
Solution:
Because the content in the / etc/gitlab/gitlab.rb file is: external_url 'hostname' can modify it to: external_url='hostname'. You only need to add a' ='to the original configuration item.
Log in to GitLabUsername: root Password: 5iveLemofeGitLab
Gitlab Chinese Community Edition address: https://gitlab.com/xhang/gitlab
1. Using marbleqi to make Chinese incremental mending package
Note: using this Chinese patch pack requires reconfiguring the compiled resource file
Sudo gitlab-ctl reconfigure
two。 Manually export the Sinicization patch package
Please first use the official package to install or upgrade to confirm the current version.
Sudo cat / opt/gitlab/embedded/service/gitlab-rails/VERSION9.3.5
Assume that the current version is v9.3.5, and confirm that the Chinese version library contains the Chinese label for that version (at the end of-zh), that is, v9.3.5-zh.
# Clone Chinese version library git clone https://gitlab.com/xhang/gitlab.git# if it has been cloned, update git fetch
# Export the Chinese patch of version 9.3.5
Git diff v9.3.5 v9.3.5-zh >.. / 9.3.5-zh.diff
Then upload the 9.0.0-zh.diff file to the server.
# stop gitlabsudo gitlab-ctl stopsudo patch-d / opt/gitlab/embedded/service/gitlab-rails-p1
< ../9.3.5-zh.diff 确定没有 .rej 文件,重启 GitLab 即可。 sudo gitlab-ctl start 执行重新配置命令 sudo gitlab-ctl reconfigure 如果汉化中出现问题,请重新安装 GitLab(注意备份数据)。 此时访问http://192.168.0.80就是全中文页面了 GitLab配置更改 当gitlab安装完成后,根据自己的环境,要修改配置。 如: gitlab修改nginx端口,绑定IP等 gitlab修改ssh端口 gitlab修改访问url等 gitlab修改数据库类型(这个没必要,因为这里的数据库只存储些用户名,gitlab代码放在/var/opt/gitlab/git-data/下) gitlab修改redis,gunicorn配置等等 所有的配置在/etc/gitlab/gitlab.rb中修改,修改完配置后执行gitlab-ctl reconfigure生效 gitlab所有的工程目录都在/var/opt/gitlab/下 # ls /var/opt/gitlab/backups bootstrapped git-data gitlab-rails gitlab-shell logrotate nginx postgresql redis 修改配置示例: #grep -v '#' gitlab.rb |grep -v ^$external_url 'http://gitlab.sec.com'gitlab_rails['gitlab_shell_ssh_port'] = 2222nginx['listen_addresses']= ['10.18.103.1']修改url是别人通过url拉取代码,IP对客户端透明。修改ssh port及nginx绑定IP等为环境需要解决冲突。GitLab头像无法正常显示 原因:gravatar被墙 解决办法: 编辑 /etc/gitlab/gitlab.rb,将 # gitlab_rails['gravatar_plain_url'] = 'http://gravatar.duoshuo.com/avatar/%{hash}?s=%{size}&d=identicon' 修改为: gitlab_rails['gravatar_plain_url'] = 'http://gravatar.duoshuo.com/avatar/%{hash}?s=%{size}&d=identicon' 然后在命令行执行: sudo gitlab-ctl reconfigure sudo gitlab-rake cache:clear RAILS_ENV=productionnginx配置解决 80 端口被占用upstream gitlab { server 114.55.111.111:8081 ;}server { #侦听的80端口 listen 80; server_name git.diggg.cn; location / { proxy_pass http://gitlab; #在这里设置一个代理,和upstream的名字一样 #以下是一些反向代理的配置可删除 proxy_redirect off; #后端的Web服务器可以通过X-Forwarded-For获取用户真实IP proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; #允许客户端请求的最大单文件字节数 client_body_buffer_size 128k; #缓冲区代理缓冲用户端请求的最大字节数 proxy_connect_timeout 300; #nginx跟后端服务器连接超时时间(代理连接超时) proxy_send_timeout 300; #后端服务器数据回传时间(代理发送超时) proxy_read_timeout 300; #连接成功后,后端服务器响应时间(代理接收超时) proxy_buffer_size 4k; #设置代理服务器(nginx)保存用户头信息的缓冲区大小 proxy_buffers 4 32k; #proxy_buffers缓冲区,网页平均在32k以下的话,这样设置 proxy_busy_buffers_size 64k; #高负荷下缓冲大小(proxy_buffers*2) proxy_temp_file_write_size 64k; #设定缓存文件夹大小,大于这个值,将从upstream服务器传 }}# 检查配置/usr/local/nginx-1.5.1/sbin/nginx -tc conf/nginx.conf# nginx 重新加载配置/usr/local/nginx-1.5.1/sbin/nginx -s reload运维# 启动所有 gitlab 组件:sudo gitlab-ctl start# 停止所有 gitlab 组件:sudo gitlab-ctl stop# 重启所有 gitlab 组件:sudo gitlab-ctl restart# 查看服务状态sudo gitlab-ctl status# 启动服务sudo gitlab-ctl reconfigure# 修改默认的配置文件sudo vim /etc/gitlab/gitlab.rb# 查看版本sudo cat /opt/gitlab/embedded/service/gitlab-rails/VERSION# echo "vm.overcommit_memory=1" >> / etc/sysctl.conf# sysctl-p # echo never > / sys/kernel/mm/transparent_hugepage/enabled# check gitlabgitlab-rake gitlab:check SANITIZE=true-- trace# View Log sudo gitlab-ctl tail backup restore Gitlab create backup
Using the Gitlab one-click installation package to install Gitlab is very simple, and the same backup recovery and migration is also very simple. A complete Gitlab backup can be created with a single command:
If gitlab-rake gitlab:backup:create# uses the source installed gitlab, use the following command sudo-u git-H bundle exec rake gitlab:backup:create RAILS_ENV=production
The above command creates a zip file under the / var/opt/gitlab/backups directory named similar to xxxxxxxx_gitlab_backup.tar, which is the entire part of Gitlab, where the xxxxxx at the beginning is the timestamp of the backup creation.
You can also use the SKIP variable to select the content to be backed up. The options for the SKIP variable are: db, uploads (attachments), repositories, builds (CI build output logs), artifacts (CI build artifacts), lfs (LFS objects). Separate multiple items with commas:
Sudo gitlab-rake gitlab:backup:create SKIP=db,uploads1
After the execution of the backup command, the operation log for exporting database and repo data will appear on the terminal.
Gitlab modifies the default directory of backup files
Modify / etc/gitlab/gitlab.rb to change the default directory where the backup files are stored:
Gitlab_rails ['backup_path'] =' / mnt/backups'
Use the gitlab-ctl reconfigure command to reload the configuration file after modification.
Backup 0 2 * / usr/bin/gitlab-rake gitlab:backup:create0 2 * / opt/gitlab/bin/gitlab-rake gitlab:backup:create restore
First go to the directory where you backed up the gitlab, which is gitlab_rails ['backup_path'] in the configuration file, and defaults to / var/opt/gitlab/backups.
Then stop unicorn and sidekiq to ensure that there is no new connection to the database and no data is written.
# stop related data connection service gitlab-ctl stop unicorn # ok: down: unicorn: 0s, normally up gitlab-ctl stop sidekiq# ok: down: sidekiq: 0s, normally up# restore from xxxxx numbered backup # and then restore data 1406691018 No permissions during Gitlabsudo gitlab-ctl start# recovery for backup file timestamp gitlab-rake gitlab:backup:restore BACKUP=1406691018# start mkdir / var/opt/gitlab/backupschown git / var/opt/gitlab/backupschmod 700 / var/opt/gitlab/backups# recovery successful page reported no permission error sudo chown-R git:git / var/opt/gitlab/git-data/repositoriessudo chmod-R ug+rwX O-rwx / var/opt/gitlab/git-data/repositoriessudo chmod-R ug-s / var/opt/gitlab/git-data/repositoriessudo find / var/opt/gitlab/git-data/repositories-type d-print0 | sudo xargs-0 chmod g+ migration copies backup files to the backup directory of gitlab Follow the gitlab recovery steps above.
Error handling Error executing action `run`on resource 'bash [migrate gitlab-rails database]'
Https://gitlab.com/gitlab-org/gitlab-ce/issues/2052#note_1667899
NameError: uninitialized constant Devise::Async
This article refers to: http://www.cnblogs.com/chinajava/p/5870683.html
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.