Print
카테고리: [ Amazon Web Services ]
조회수: 32091

1. 흐름도


2. GitLab 설치

우툰부 리눅스에서 설치하는 것을 기준으로 합니다.

2.1. 리포지토리 설정

$ curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
Detected operating system as Ubuntu/bionic.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/gitlab_gitlab-ce.list...done.
Importing packagecloud gpg key... done.
Running apt-get update... done.

The repository is setup! You can now install packages.

2.2. apt 설치

$ sudo apt-get install gitlab-ce=12.4.0-ce.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  golang-docker-credential-helpers libsecret-1-0 libsecret-common python-asn1crypto python-backports.ssl-match-hostname python-cached-property python-certifi python-cffi-backend python-chardet
  python-cryptography python-docker python-dockerpty python-dockerpycreds python-docopt python-enum34 python-funcsigs python-functools32 python-idna python-ipaddress python-jsonschema python-mock
  python-openssl python-pbr python-pkg-resources python-requests python-six python-texttable python-urllib3 python-websocket python-yaml
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  gitlab-ce
0 upgraded, 1 newly installed, 0 to remove and 52 not upgraded.
Need to get 725 MB of archives.
After this operation, 1883 MB of additional disk space will be used.
Get:1 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu bionic/main amd64 gitlab-ce amd64 12.4.0-ce.0 [725 MB]
Fetched 725 MB in 12s (61.1 MB/s)
Selecting previously unselected package gitlab-ce.
(Reading database ... 86813 files and directories currently installed.)
Preparing to unpack .../gitlab-ce_12.4.0-ce.0_amd64.deb ...
Unpacking gitlab-ce (12.4.0-ce.0) ...
Setting up gitlab-ce (12.4.0-ce.0) ...
It looks like GitLab has not been configured yet; skipping the upgrade script.

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.

     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/

Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
  sudo gitlab-ctl reconfigure

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

그런데 위에 문구를 보면 external_url을 설정하고 나서 다시 reconfigure 하라고 하네요. 따라서 /etc/gitlab/gitlab.rb 파일을 열고 external_url에 URL을 지정하고 나서 sudo gitlab-ctl reconfigure를 실행하시면 됩니다. 

(external_url로 지정한 URL 주소는 client에서 hosts 파일에 넣고 연결하면 됩니다)

한참 작업이 돌아요. 저는 약 2분 30초 정도 걸렸네요. 아래 화면은 끝부분만 표시했구요.

Recipe: gitlab::gitlab-rails
  * execute[clear the gitlab-rails cache] action run
    - execute /opt/gitlab/bin/gitlab-rake cache:clear
Recipe: 
  * service[gitaly] action restart
    - restart service service[gitaly]
Recipe: gitaly::enable
  * runit_service[gitaly] action hup
    - send hup to runit_service[gitaly]
Recipe: 
  * service[gitlab-workhorse] action restart
    - restart service service[gitlab-workhorse]
  * service[node-exporter] action restart
    - restart service service[node-exporter]
  * service[gitlab-exporter] action restart
    - restart service service[gitlab-exporter]
  * service[redis-exporter] action restart
    - restart service service[redis-exporter]
  * service[prometheus] action restart
    - restart service service[prometheus]
Recipe: monitoring::prometheus
  * execute[reload prometheus] action run
    - execute /opt/gitlab/bin/gitlab-ctl hup prometheus
Recipe: 
  * service[alertmanager] action restart
    - restart service service[alertmanager]
  * service[postgres-exporter] action restart
    - restart service service[postgres-exporter]
  * service[grafana] action restart
    - restart service service[grafana]

Running handlers:
Running handlers complete
Chef Client finished, 528/1423 resources updated in 02 minutes 33 seconds

2.3. gitlab 프로세스

$ ps -ef | grep gitlab
root     27960     1  0 06:35 ?        00:00:00 runsvdir -P /opt/gitlab/service log: ...........................................................................................................................................................................................................................................................................................................................................................................................................
gitlab-+ 27989 27987  0 06:35 ?        00:00:01 /opt/gitlab/embedded/bin/redis-server 127.0.0.1:0
root     28004 27987  0 06:35 ?        00:00:00 svlogd -tt /var/log/gitlab/redis
root     28132 28005  0 06:35 ?        00:00:00 svlogd /var/log/gitlab/gitaly
gitlab-+ 28169 28167  0 06:35 ?        00:00:00 /opt/gitlab/embedded/bin/postgres -D /var/opt/gitlab/postgresql/data
gitlab-+ 28178 28169  0 06:35 ?        00:00:00 postgres: checkpointer process
gitlab-+ 28179 28169  0 06:35 ?        00:00:00 postgres: writer process
gitlab-+ 28180 28169  0 06:35 ?        00:00:00 postgres: wal writer process
gitlab-+ 28181 28169  0 06:35 ?        00:00:00 postgres: autovacuum launcher process
gitlab-+ 28182 28169  0 06:35 ?        00:00:00 postgres: stats collector process
gitlab-+ 28183 28169  0 06:35 ?        00:00:00 postgres: bgworker: logical replication launcher
root     28226 28167  0 06:36 ?        00:00:00 svlogd -tt /var/log/gitlab/postgresql
git      28366 28364  0 06:36 ?        00:00:00 /bin/bash /opt/gitlab/embedded/bin/gitlab-unicorn-wrapper
git      28385     1  6 06:36 ?        00:00:27 unicorn master -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru
root     28390 28364  0 06:36 ?        00:00:00 svlogd -tt /var/log/gitlab/unicorn
git      28396 28394  7 06:36 ?        00:00:30 sidekiq 5.2.7 gitlab-rails [0 of 25 busy]
root     28407 28394  0 06:36 ?        00:00:00 svlogd /var/log/gitlab/sidekiq
root     28412 27960  0 06:36 ?        00:00:00 runsv gitlab-workhorse
root     28425 28412  0 06:36 ?        00:00:00 svlogd /var/log/gitlab/gitlab-workhorse
root     28445 28443  0 06:36 ?        00:00:00 nginx: master process /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx
gitlab-+ 28446 28445  0 06:36 ?        00:00:00 nginx: worker process
gitlab-+ 28447 28445  0 06:36 ?        00:00:00 nginx: worker process
gitlab-+ 28448 28445  0 06:36 ?        00:00:00 nginx: cache manager process
root     28463 28443  0 06:36 ?        00:00:00 svlogd -tt /var/log/gitlab/nginx
root     28470 28468  0 06:36 ?        00:00:00 /bin/sh /opt/gitlab/embedded/bin/gitlab-logrotate-wrapper
root     28497 28468  0 06:37 ?        00:00:00 svlogd -tt /var/log/gitlab/logrotate
git      28511 28385  0 06:37 ?        00:00:00 unicorn worker[0] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru
git      28512 28385  0 06:37 ?        00:00:00 unicorn worker[1] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru
git      28513 28385  0 06:37 ?        00:00:00 unicorn worker[2] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru
git      28514 28385  0 06:37 ?        00:00:00 unicorn worker[3] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru
root     28551 28516  0 06:37 ?        00:00:00 svlogd -tt /var/log/gitlab/node-exporter
root     28585 27960  0 06:37 ?        00:00:00 runsv gitlab-exporter
root     28603 28585  0 06:37 ?        00:00:00 svlogd -tt /var/log/gitlab/gitlab-exporter
root     28631 28613  0 06:37 ?        00:00:00 svlogd -tt /var/log/gitlab/redis-exporter
root     28655 28638  0 06:37 ?        00:00:00 svlogd -tt /var/log/gitlab/prometheus
root     28682 28659  0 06:37 ?        00:00:00 svlogd -tt /var/log/gitlab/alertmanager
root     28716 28686  0 06:37 ?        00:00:00 svlogd -tt /var/log/gitlab/postgres-exporter
gitlab-+ 28751 28169  0 06:37 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle
root     28804 28779  0 06:37 ?        00:00:00 svlogd -tt /var/log/gitlab/grafana
git      28823 28005  0 06:38 ?        00:00:00 /opt/gitlab/embedded/bin/gitaly-wrapper /opt/gitlab/embedded/bin/gitaly /var/opt/gitlab/gitaly/config.toml
git      28830 28823  0 06:38 ?        00:00:00 /opt/gitlab/embedded/bin/gitaly /var/opt/gitlab/gitaly/config.toml
git      28855 28412  0 06:38 ?        00:00:00 /opt/gitlab/embedded/bin/gitlab-workhorse -listenNetwork unix -listenUmask 0 -listenAddr /var/opt/gitlab/gitlab-workhorse/socket -authBackend http://localhost:8080 -authSocket /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket -documentRoot /opt/gitlab/embedded/service/gitlab-rails/public -pprofListenAddr  -prometheusListenAddr localhost:9229 -secretPath /opt/gitlab/embedded/service/gitlab-rails/.gitlab_workhorse_secret -logFormat json -config config.toml
git      28863 28830  0 06:38 ?        00:00:02 ruby /opt/gitlab/embedded/service/gitaly-ruby/bin/gitaly-ruby 28830 /tmp/gitaly-ruby985840836/socket.0
git      28864 28830  0 06:38 ?        00:00:02 ruby /opt/gitlab/embedded/service/gitaly-ruby/bin/gitaly-ruby 28830 /tmp/gitaly-ruby985840836/socket.1
gitlab-+ 28871 28516  0 06:38 ?        00:00:00 /opt/gitlab/embedded/bin/node_exporter --web.listen-address=localhost:9100 --collector.mountstats --collector.runit --collector.runit.servicedir=/opt/gitlab/sv --collector.textfile.directory=/var/opt/gitlab/node-exporter/textfile_collector
git      28877 28585  0 06:38 ?        00:00:01 puma 3.12.0 (tcp://localhost:9168) [gitlab-exporter]
gitlab-+ 28881 28613  0 06:38 ?        00:00:00 /opt/gitlab/embedded/bin/redis_exporter --web.listen-address=localhost:9121 --redis.addr=unix:///var/opt/gitlab/redis/redis.socket
gitlab-+ 28893 28638  0 06:38 ?        00:00:01 /opt/gitlab/embedded/bin/prometheus --web.listen-address=localhost:9090 --storage.tsdb.path=/var/opt/gitlab/prometheus/data --config.file=/var/opt/gitlab/prometheus/prometheus.yml
gitlab-+ 28912 28659  0 06:38 ?        00:00:00 /opt/gitlab/embedded/bin/alertmanager --web.listen-address=localhost:9093 --storage.path=/var/opt/gitlab/alertmanager/data --config.file=/var/opt/gitlab/alertmanager/alertmanager.yml
gitlab-+ 28923 28686  0 06:38 ?        00:00:00 /opt/gitlab/embedded/bin/postgres_exporter --web.listen-address=localhost:9187 --extend.query-path=/var/opt/gitlab/postgres-exporter/queries.yaml
gitlab-+ 28928 28169  0 06:38 ?        00:00:00 postgres: gitlab-psql postgres [local] idle
gitlab-+ 29007 28779  0 06:38 ?        00:00:00 /opt/gitlab/embedded/bin/grafana-server -config /var/opt/gitlab/grafana/grafana.ini
gitlab-+ 29040 28169  0 06:38 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle
gitlab-+ 29041 28169  0 06:38 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle
gitlab-+ 29042 28169  0 06:38 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle
gitlab-+ 29056 28169  0 06:38 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle
gitlab-+ 29142 28169  0 06:39 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle
gitlab-+ 29256 28169  0 06:40 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle
gitlab-+ 29268 28169  0 06:40 ?        00:00:00 postgres: gitlab gitlabhq_production [local] idle