Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Gitlab installation and simple configuration

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

1. Official website installation document: https://about.gitlab.com/downloads/#centos7

Sudo yum install curl policycoreutils openssh-server openssh-clientssudo systemctl enable sshdsudo systemctl start sshdsudo yum install postfixsudo systemctl enable postfixsudo systemctl start postfixsudo firewall-cmd-permanent-add-service=httpsudo systemctl reload firewalld

2. Configure the mirror source of the official website

Curl-sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bashsudo yum install gitlab-ce

Due to the special domestic network, the use of the official website mirror source is slow, and the domestic mirror source is provided this time.

Mirror source of Tsinghua University: https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/

RHEL/CentOS user

New / etc/yum.repos.d/gitlab-ce.repo, the content is

[gitlab-ce] name=Gitlab CE Repositorybaseurl= https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/gpgcheck=0enabled=1

Re-execution

Sudo yum makecachesudo yum install gitlab-ce

After installation, the directory structure is as follows

[root@docker gitlab] # tree / opt/gitlab/-L 1/opt/gitlab/ ├── bin ├── dependency_licenses.json ├── embedded etc ├── init ├── LICENSE LICENSES ├── service ├── sv ├── var ├── version-manifest.json └── version-manifest.txt8 directories, 4 files [root@docker gitlab] # tree / etc/gitlab/-L 1/etc/gitlab/ ├── gitlab.rb ├── gitlab.rb └── gitlab.rb

The following services are mainly integrated

# tree / opt/gitlab/sv/-L 1/opt/gitlab/sv/ ├── gitaly ├── gitlab-monitor ├── gitlab-workhorse ├── logrotate ├── nginx ├── node-exporter ├── ├── postgresql ├── prometheus ├── redis ├── redis-exporter ├── sidekiq └── unicorn

3. Configure gitlab address

# cat / etc/gitlab/gitlab.rb | grep ^ external_urlexternal_url 'http://192.168.99.101'

The default url address is http://{hostname}

4. Reload the configuration and start it

Gitlab-ctl reconfigure

Make sure that the ports 80, 8060, 8080, 9090, 9100, 9121, 9168, 9187 are not occupied during startup, otherwise the startup fails.

5. Check the startup status

# gitlab-ctl statusrun: gitaly: (pid 5435) 2522s; run: log: (pid 4150) 3071srun: gitlab-monitor: (pid 5441) 2522s; run: log: (pid 4585) 3023srun: gitlab-workhorse: (pid 5445) 2522s; run: log: (pid 4203) 3065srun: logrotate: (pid 5456) 2521s; run: log: (pid 4305) 3053srun: nginx: (pid 5737) 2439s; run: log: (pid 4264) 3059srun: node-exporter: (pid 5471) 2520s Run: log: (pid 4415) 3041srun: postgres-exporter: (pid 5478) 2520s; run: log: (pid 4514) 3029srun: postgresql: (pid 5487) 2519s; run: log: (pid 3858) 3170srun: prometheus: (pid 5490) 2519s; run: log: (pid 4372) 3047srun: redis: (pid 5497) 2518s; run: (pid 3744) 3181srun: redis-exporter: (pid 5502) 2518s; run: log: (pid 4449) 3035srun: sidekiq: (pid 5804) 2371s Run: log: (pid 4104) 3077srun: unicorn: (pid 5540) 2515s; run: log: (pid 4049) 3083s

6. Gitlab start, stop, restart and other operations

[root@docker gitlab] # gitlab-ctl stopok: down: gitaly: 0s, normally upok: down: gitlab-monitor: 0s, normally upok: down: gitlab-workhorse: 1s, normally upok: down: logrotate: 0s, normally upok: down: nginx: 1s, normally upok: down: node-exporter: 0s, normally upok: down: postgres-exporter: 0s, normally upok: down: postgresql: 0s, normally upok: down: prometheus: 0s, normally upok: down: redis: 1s, normally upok: down: redis-exporter: 0s, normally upok: down: sidekiq: 0s Normally upok: down: unicorn: 0s Normally up [root@docker gitlab] # gitlab-ctl startok: run: gitaly: (pid 14482) 0sok: run: gitlab-monitor: (pid 14488) 1sok: run: gitlab-workhorse: (pid 14491) 0sok: run: logrotate: (pid 14500) 0sok: run: nginx: (pid 14506) 1sok: run: node-exporter: (pid 14514) 0sok: run: postgres-exporter: (pid 14520) 1sok: run: postgresql: (pid 14526) 0sok: run: run: (prometheus 14534) prometheus : run: redis: (pid 14544) 0sok: run: redis-exporter: (pid 14548) 0sok: run: sidekiq: (pid 14559) 1sok: run: unicorn: (pid 14562) 0s [root@docker gitlab] # gitlab-ctl statusrun: gitaly: (pid 14482) 12s Run: log: (pid 4150) 3982srun: gitlab-monitor: (pid 14488) 12s; run: log: (pid 4585) 3934srun: gitlab-workhorse: (pid 14491) 11s; run: log: (pid 4203) 3976srun: logrotate: (pid 14500) 11s; run: log: (pid 4305) 3964srun: nginx: (pid 14506) 11s; run: (pid 4264) 3970srun: node-exporter: (pid 14514) 10s; run: log: (pid 4415) 3952srun: postgres-exporter: (pid 14520) 10s Run: log: (pid 4514) 3940srun: postgresql: (pid 14526) 9s; run: log: (pid 3858) 4081srun: prometheus: (pid 14534) 9s; run: log: (pid 4372) 3958srun: redis: (pid 14544) 8s; run: log: (pid 3744) 4092srun: redis-exporter: (pid 14548) 8s; run: log: (pid 4449) 3946srun: sidekiq: (pid 14559) 8s; run: log: (pid 4104) 3988srun: unicorn: (pid 14562) 7s Run: log: (pid 4049) 3994s [root@docker gitlab] # gitlab-ctl restartok: run: gitaly: (pid 14624) 0sok: run: gitlab-monitor: (pid 14630) 0sok: run: gitlab-workhorse: (pid 14633) 1sok: run: logrotate: (pid 14645) 0sok: run: nginx: (pid 14651) 1sok: run: node-exporter: (pid 14659) 0sok: run: postgres-exporter: (pid 14665) 1sok: run: postgresql: (pid 14674) pid: 0sok: Prometheus: (pid 14684) 0sok: run: redis: (pid 14695) 1sok: run: redis-exporter: (pid 14699) 0sok: run: sidekiq: (pid 14705) 1sok: run: unicorn: (pid 14710) 0s [root@docker gitlab] #

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report