Skip to content

Latest commit

 

History

History
 
 

05_gitlab_administration

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Administration of Gitlab CE Omnibus

To Do

  • Ajouter un message général pour avertir d’un maintenance
  • Changer le mot de passe du compte administrateur (en CLI)
  • Créer 2 utilisateurs (un admin, un standard)
  • Vérifiez le bon fonctionnement du service Gitlab
  • Consultez les logs de Nginx
  • Redémarrer le composant Nginx
  • Vérifiez le status (EN CLI)
  • Redémarrer tout le GitLab (avec systemd ou gitlab-ctl)
  • Exécutez 2 appels APIs (list groups & create a new group called "My group")
  • Créer un backup de Gitlab (et le restaurer)

Solution

  • Ajouter un message général pour avertir d’un maintenance

Message for maintenance

(Admin > Messages > Broadcast messages)

  • Changer le mot de passe du compte administrateur (en CLI)
$ docker exec -it gitlab gitlab-rake "gitlab:password:reset[root]"
Enter password:
Confirm password:
Password successfully updated for user with username root.
  • Créer 2 utilisateurs (un admin, un standard)

Users

  • Vérifiez le bon fonctionnement du service Gitlab
$ docker exec -it gitlab bash

# Note: this output comes from Gitlab 14. Since 16.0, grafana is gone from the list
# (the bundled Grafana was removed), the rest is unchanged.
root@gitlab:/assets# gitlab-ctl status
run: alertmanager: (pid 1482) 1193s; run: log: (pid 1248) 1237s
run: gitaly: (pid 1493) 1192s; run: log: (pid 534) 1323s
run: gitlab-exporter: (pid 1446) 1195s; run: log: (pid 1101) 1255s
run: gitlab-workhorse: (pid 1430) 1195s; run: log: (pid 924) 1268s
run: grafana: (pid 1586) 1192s; run: log: (pid 1393) 1205s
run: logrotate: (pid 475) 1336s; run: log: (pid 483) 1335s
run: nginx: (pid 939) 1264s; run: log: (pid 953) 1263s
run: postgres-exporter: (pid 1503) 1192s; run: log: (pid 1301) 1231s
run: postgresql: (pid 651) 1318s; run: log: (pid 710) 1315s
run: prometheus: (pid 1455) 1194s; run: log: (pid 1219) 1243s
run: puma: (pid 838) 1282s; run: log: (pid 845) 1281s
run: redis: (pid 491) 1330s; run: log: (pid 499) 1329s
run: redis-exporter: (pid 1448) 1194s; run: log: (pid 1186) 1249s
run: sidekiq: (pid 857) 1276s; run: log: (pid 868) 1274s
run: sshd: (pid 35) 1351s; run: log: (pid 34) 1351s
  • Consultez les logs de Nginx
$ docker inspect gitlab
...
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/srv/gitlab/config",
                "Destination": "/etc/gitlab",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/srv/gitlab/logs",
                "Destination": "/var/log/gitlab",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
...

$ cd /srv/gitlab/logs

$ ls
alertmanager  gitlab-exporter  gitlab-shell      grafana    nginx              postgresql  puma         redis           sidekiq
gitaly        gitlab-rails     gitlab-workhorse  logrotate  postgres-exporter  prometheus  reconfigure  redis-exporter  sshd

$ sudo ls nginx/
access.log  config  current  error.log  gitlab_access.log  gitlab_error.log  lock

Or, in the docker container:

$ docker exec -it gitlab bash
root@gitlab:/# cd /var/log/gitlab/
root@gitlab:/var/log/gitlab# tail -f nginx/*.log
==> nginx/access.log <==

==> nginx/error.log <==

==> nginx/gitlab_access.log <==
127.0.0.1 - - [11/Dec/2021:17:47:58 +0000] "GET /help HTTP/1.1" 200 75380 "" "curl/7.79.1-DEV" -
172.22.0.1 - - [11/Dec/2021:17:48:09 +0000] "POST /-/profile/password HTTP/1.1" 200 20255 "http://localhost/-/profile/password/edit" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36" 4.33
172.22.0.1 - - [11/Dec/2021:17:48:23 +0000] "POST /-/profile/password HTTP/1.1" 302 96 "http://localhost/-/profile/password" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36" -
172.22.0.1 - - [11/Dec/2021:17:48:23 +0000] "GET /users/sign_in HTTP/1.1" 200 9242 "http://localhost/-/profile/password" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36" 3.17
172.22.0.1 - - [11/Dec/2021:17:48:28 +0000] "POST /users/sign_in HTTP/1.1" 302 83 "http://localhost/users/sign_in" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36" -
172.22.0.1 - - [11/Dec/2021:17:48:28 +0000] "GET / HTTP/1.1" 200 19612 "http://localhost/users/sign_in" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36" 4.25
127.0.0.1 - - [11/Dec/2021:17:48:58 +0000] "GET /help HTTP/1.1" 200 75380 "" "curl/7.79.1-DEV" -
127.0.0.1 - - [11/Dec/2021:17:49:58 +0000] "GET /help HTTP/1.1" 200 75380 "" "curl/7.79.1-DEV" -
127.0.0.1 - - [11/Dec/2021:17:50:58 +0000] "GET /help HTTP/1.1" 200 75380 "" "curl/7.79.1-DEV" -
127.0.0.1 - - [11/Dec/2021:17:51:59 +0000] "GET /help HTTP/1.1" 200 75380 "" "curl/7.79.1-DEV" -

==> nginx/gitlab_error.log <==
  • Redémarrez le composant nginx
$ docker exec -it gitlab bash
root@gitlab:/# gitlab-ctl restart nginx
ok: run: nginx: (pid 2269) 0s
root@gitlab:/# gitlab-ctl status nginx
run: nginx: (pid 2269) 11s