Gitlab rapid deployment and routine maintenance (a)

A, GitLab Profile
web service GitLab is a warehouse management system for open source projects using Git as a code management tool, and on this basis to build up

Two, GitLab system architecture
home directory of the user is usually git / home / git (~ git represents the home directory path), GitLab mainly / home / git user installed in the user's home directory git. And it is the location of the repository gitlabhq server software resides in your home directory (although the location of the repository is configurable). Bare repository is located in / home / git / repositories. GitLab is a ruby on rails application, so you can work on the application of the principle of rails to learn the details of the inner workings of the research ruby. To provide a repository via SSH, a gitlab-shell, called the additional application, which is installed in / home / git / gitlab-shell

GitLab application is a collection of all of the following components:

1.  Repository: code base may be a hard or NFS file system
2.  the Nginx: Web inlet
3.  Database: contains the following information:
    - data (metadata, Issue, merge request merge request, etc.) in the Repository
    - a Web log user (authority)
4.  Redis: cache, distributes tasks
5.  sidekiq: background tasks, mainly responsible for sending e-mail. Task requires from Redis
6.  Unicorn: Gitlab own Web server, including Gitlab main process responsible for handling fast / general tasks, work with Redis. Work includes:
    - to check the permissions by checking a user session stored in Redis is
    - as Sidekiq production tasks
    - taken from the warehouse (warehouse), or something in there to move things
7.  gitlab-shell: for interactive SSH instead of HTTP. gitlab-shell by Redis and Sidekiq communicate, directly or indirectly, Unicorn access by TCP
8.  gitaly: background service, responsible for access to the disk to git efficient processing operations, and cache time-consuming operation. All operations are processed by git Gitaly
. 9. gitlab-workhorse: reverse proxy server can process requests independent Rails (CSS on the disk, JS files, etc.), the process Git Push / Pull request, a connection process Rails (modified response sent by or to a Rails Rails the request, Rails long-term management of WebSocket connections, etc.).
10. The  mail_room: processing a request message. When replying to a message sent GitLab, GitLab calls this service

Sidekiq. Unicorn and GitLab-shell is GitLab in three program processing tasks.

Three, Gitlab installation, configuration, startup management
1, Gitlab install the necessary dependencies, the system will also be open in the firewall HTTP and SSH access
installation command: yum install -y curl policycoreutils-python
active command: systemctl enable sshd
enabled command: systemctl start sshd
firewall command: firewall-cmd --permanent - the Add-Service = HTTP systemctl reload firewalld &&    // If the system is shut down the firewall option, ignore this step.

2, install Postfix to send an e-mail notification
installation command: yum install postfix
activate command: systemctl enable postfix
enable command: systemctl start postfix

3, download GitLab package (Community Edition), Address: https://packages.gitlab.com/gitlab/gitlab-ce

4. Check Gitlab relevant directory, the command: find / -name gitlab

Gitlab directory structure
/ opt / gitlab / # home directory
/ etc / gitlab / # placement configuration file
/ var / opt / gitlab / # various components
/ var / log / gitlab / # placement log file
/ var / opt / gitlab / git- address data / repositories # database  
address / var / opt / gitlab / postgresql / data #gitlab group and projects
/etc/gitlab/gitlab.rb #gitlab profile

5, the initialization command Gitlab (save the configuration or reload configuration): gitlab-ctl reconfigure

6, Gitlab start and stop services management
to start the service: gitlab-ctl start
stop service: gitlab-ctl stop
to restart the service: gitlab-ctl restart
View Status: gitlab-ctl status

7, Gitlab the supervisor mode to start the service
service startup command: systemctl start gitlab-runsvdir.service
service stop command: systemctl stop gitlab-runsvdir.service
service restart command: systemctl restart gitlab-runsvdir.service
service boot command: systemctl enable gitlab- runsvdir.service
cancel boot command: systemctl disable gitlab-runsvdir.service
service View command: systemctl list-unit-files

8, Gitlab service log to see: / usr / bin / gitlab-ctl tail          // can view a log of all plug-ins case gitlab

 

 

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/easonscx/p/11969403.html