In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
What are the problems and solutions encountered in the relocation GitLab environment? I believe many inexperienced people are at a loss about this. Therefore, this paper summarizes the causes and solutions of the problems. Through this article, I hope you can solve this problem.
....
On the new server, there is little space under the / opt path, allowing users to use the / DATA path.
Check whether the contents of the installation package can be redirected
Rpm-qpi gitlab-ce-8.11.5-ce.0.el6.x86_64.rpm | grep Relocations
Name: gitlab-ce Relocations: /
You can see the directory / redirectable.
Try 1: redirect the installation
Sudo rpm-ivh-- relocate / = / DATA/app gitlab-ce-8.11.5-ce.0.el6.x86_64.rpm
But the installation process reported an error
Cp: cannot stat `/ opt/gitlab/etc/gitlab.rb.template': No such file or directory
Sed: can't read / etc/gitlab/gitlab.rb: No such file or directory _ 64) scriptlet failed, exit status 127
Then execute: 'http://xx.xx.xx.xx'( current server IP)
Reconfigure after modification, and execute it under the gitlab/bin directory
Sudo. / gitlab-ctl reconfigure
When accessing Gitlab locally, it is found that it is unreachable and the telnet IP 8080 port is not available.
By chance, the machine wget IP:80 in the same network segment of the server is found to be accessible normally, and it is found that the default port of Gitlab is port 80, while the policy of port 80 between the server and the local is not enabled, only port 8080 is opened, so this problem is probably related to the default port of GitLab.
Since port 80 is not open, try to use port 8080. Modify the port policy and modify / etc/gitlab/gitlab.rb according to the official instructions of Gitlab.
Nginx ['listen_addresses'] = [' *']
Nginx ['listen_port'] = 8080
Reconfigure after modification and execute in the gitlab/bin directory
Sudo. / gitlab-ctl reconfigure
HTTP access, prompt 502
When I read the http://blog.csdn.net/wangxicoding/article/details/43738137 article later, I thought, is it because the unicorn service occupies port 8080 by default, changing the nginx port to 8080 will have an impact? So choose to reconfigure the port for unicorn and modify / etc/gitlab/gitlab.rb
Unicorn ['listen'] =' 127.0.0.1'
Unicorn ['port'] = 8082
Reconfigure after modification and execute in the gitlab/bin directory
Sudo. / gitlab-ctl reconfigure
After the modification, the HTTP access attempt can be accessed normally.
Question 3: Gitlab backup and recovery
There is already some code in the old environment, and the migration environment can choose to re-upload the code, but in doing so, some LOW,Gitlab actually provide us with some means and methods for backup and recovery.
First create a backup
Sudo. / gitlab-rake gitlab:backup:create
Using the above command creates a zip file under the / var/opt/gitlab/backups directory named similar to 1448938055_gitlab_backup, which is the entire part of Gitlab, where the first 1448938055 is the date the backup was created. Modify the default directory of backup files. You can modify the default directory where backup files are stored by modifying / etc/gitlab/gitlab.rb:
Gitlab_rails ['backup_path'] =' / mnt/backups'
Gitlab data recovery
Stop related data connection services
Sudo. / gitlab-ctl stop unicorn
Sudo. / gitlab-ctl stop sidekiq
Restore from a 1448938055 backup
Sudo. / gitlab-rake gitlab:backup:restore BACKUP=1448938055
Start Gitlab
Sudo. / gitlab-ctl start
Done.
Expand knowledge: what is Unicorn?
Reference: https://about.gitlab.com/2015/06/05/how-gitlab-uses-unicorn-and-unicorn-worker-killer/
Gitlab uses Unicorn (pre-forked Ruby web service) to handle web requests (web browsing and Git Http Clients)
Understanding Unicorn and unicorn-worker-killer
Unicorn
GitLab uses Unicorn, a pre-forking Ruby web server, to handle web requests (web browsers and Git HTTP clients). Unicorn is a daemon written in Ruby and C that can load and run a Ruby on Rails application; in our case the Rails application is GitLab Community Edition or GitLab Enterprise Edition.
Unicorn has a multi-process architecture to make better use of available CPU cores (processes can run on different cores) and to have stronger fault tolerance (most failures stay isolated in only one process and cannot take down GitLab entirely). On startup, the Unicorn 'master' process loads a clean Ruby environment with the GitLab application code, and then spawns' workers' which inherit this clean initial environment. The 'master' never handles any requests, that is left to the workers. The operating system network stack queues incoming requests and distributes them among the workers.
In a perfect world, the master would spawn its pool of workers once, and then the workers handle incoming web requests one after another until the end of time. In reality, worker processes can crash or time out: if the master notices that a worker takes too long to handle a request it will terminate the worker process with SIGKILL ('kill-9'). No matter how the worker process ended, the master process will replace it with a new 'clean' process again. Unicorn is designed to be able to replace 'crashed' workers without dropping user requests
I really don't understand why gitlab-ce-8.17.0-ce.0.el7.x86_64.rpm defines so many hard-coded paths instead of supporting variable substitution. Maybe there are other ways to better solve this problem.
Soft links are a small feature, but they are really easy to use and practical, especially in this installation process.
The installation of a Gitlab actually involves a lot of technical knowledge, such as Redis, PG, etc., this gitlab-ce-8.17.0-ce.0.el7.x86_64.rpm installation package is packaged uniformly, otherwise it needs to be installed and configured component by component.
After reading the above, have you mastered the problems encountered in the relocation GitLab environment and what are the solutions? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.