标黑的就是关键命令,
先停止gitlab服务,
然后rpm -e卸载,
然后查看剩余gitlab进程,
然后杀死主进程,
然后删除所有相关目录
1 [liuyx@MiWiFi-R3L-srv ~]$ sudo gitlab-ctl stop 2 [sudo] password for liuyx: 3 liuyx 不在 sudoers 文件中。此事将被报告。 4 [liuyx@MiWiFi-R3L-srv ~]$ su root 5 密码: 6 [root@MiWiFi-R3L-srv liuyx]# ls -l /etc/sudoers 7 -r--r-----. 1 root root 3907 6月 23 03:42 /etc/sudoers 8 [root@MiWiFi-R3L-srv liuyx]# vim /etc/sudoers 9 [root@MiWiFi-R3L-srv liuyx]# chmod 777 /etc/sudoers 10 [root@MiWiFi-R3L-srv liuyx]# vim /etc/sudoers 11 [root@MiWiFi-R3L-srv liuyx]# chmod 440 /etc/sudoers 12 [root@MiWiFi-R3L-srv liuyx]# exit 13 exit 14 [liuyx@MiWiFi-R3L-srv ~]$ sudo gitlab-ctl stop 15 [sudo] password for liuyx: 16 ok: down: gitaly: 1s, normally up 17 ok: down: gitlab-monitor: 0s, normally up 18 ok: down: gitlab-workhorse: 1s, normally up 19 ok: down: logrotate: 0s, normally up 20 ok: down: nginx: 1s, normally up 21 ok: down: node-exporter: 0s, normally up 22 ok: down: postgres-exporter: 0s, normally up 23 ok: down: postgresql: 0s, normally up 24 ok: down: prometheus: 1s, normally up, want up 25 ok: down: redis: 0s, normally up 26 ok: down: redis-exporter: 1s, normally up 27 ok: down: sidekiq: 1s, normally up 28 ok: down: unicorn: 0s, normally up 29 30 [liuyx@MiWiFi-R3L-srv ~]$ sudo rpm -e gitlab-ce 31 [sudo] password for liuyx: 32 [liuyx@MiWiFi-R3L-srv ~]$ ps -ef|grep gitlab 33 root 728 1 0 07:50 ? 00:00:00 runsvdir -P /opt/gitlab/service log: ........................................................................................................................................................................................................................................................................................................................................................................................................... 34 root 752 728 0 07:50 ? 00:00:00 runsv gitlab-workhorse 35 root 768 752 0 07:50 ? 00:00:00 svlogd -tt /var/log/gitlab/gitlab-workhorse 36 root 769 755 0 07:50 ? 00:00:00 svlogd -tt /var/log/gitlab/logrotate 37 root 776 728 0 07:50 ? 00:00:00 runsv gitlab-monitor 38 root 779 773 0 07:50 ? 00:00:00 svlogd -tt /var/log/gitlab/node-exporter 39 root 783 753 0 07:50 ? 00:00:00 svlogd -tt /var/log/gitlab/nginx 40 root 853 749 0 07:50 ? 00:00:00 svlogd -tt /var/log/gitlab/unicorn 41 root 854 751 0 07:50 ? 00:00:00 svlogd -tt /var/log/gitlab/gitaly 42 root 855 774 0 07:50 ? 00:00:00 svlogd -tt /var/log/gitlab/redis-exporter 43 root 856 776 0 07:50 ? 00:00:00 svlogd -tt /var/log/gitlab/gitlab-monitor 44 root 870 748 0 07:50 ? 00:00:00 svlogd -tt /var/log/gitlab/postgresql 45 root 871 747 0 07:50 ? 00:00:00 svlogd -tt /var/log/gitlab/redis 46 root 872 750 0 07:50 ? 00:00:00 svlogd -tt /var/log/gitlab/sidekiq 47 root 873 772 0 07:50 ? 00:00:04 svlogd -tt /var/log/gitlab/prometheus 48 root 874 775 0 07:50 ? 00:00:00 svlogd -tt /var/log/gitlab/postgres-exporter 49 liuyx 30424 21574 0 21:30 pts/0 00:00:00 grep --color=auto gitlab 50 [liuyx@MiWiFi-R3L-srv ~]$ sudo kill -9 728 51 [sudo] password for liuyx: 52 [liuyx@MiWiFi-R3L-srv ~]$ ps -ef|grep gitlab 53 liuyx 30725 21574 0 21:33 pts/0 00:00:00 grep --color=auto gitlab 54 55 [root@MiWiFi-R3L-srv liuyx]# find / -name gitlab 56 find: ‘/run/user/1000/gvfs’: 权限不够 57 [root@MiWiFi-R3L-srv liuyx]# rm -rf /run/user/1000/gvfs 58 rm: 无法删除"/run/user/1000/gvfs": 是一个目录 59 [root@MiWiFi-R3L-srv liuyx]# umount -rf /run/user/1000/gvfs 60 [root@MiWiFi-R3L-srv liuyx]# rm -rf /run/user/1000/gvfs 61 [root@MiWiFi-R3L-srv liuyx]# find / -name gitlab|xargs rm -rf
既然博客园不支持代码中大小写,我还是直接把关键命令单独拉出来吧,不然这排版看着太难受了,前边是上文中的行号:
14 [liuyx@MiWiFi-R3L-srv ~]$ sudo gitlab-ctl stop
30 [liuyx@MiWiFi-R3L-srv ~]$ sudo rpm -e gitlab-ce
32 [liuyx@MiWiFi-R3L-srv ~]$ ps -ef|grep gitlab
50 [liuyx@MiWiFi-R3L-srv ~]$ sudo kill -9 728 (注意这个进程号,和上面命令打印结果相结合)
52 [liuyx@MiWiFi-R3L-srv ~]$ ps -ef|grep gitlab
59 [root@MiWiFi-R3L-srv liuyx]# umount -rf /run/user/1000/gvfs
60 [root@MiWiFi-R3L-srv liuyx]# rm -rf /run/user/1000/gvfs
61 [root@MiWiFi-R3L-srv liuyx]# find / -name gitlab|xargs rm -rf