FastDFS 卸载

因FastDFS未提供一键卸载功能,下面的内容将描述如何实现 FastDFS 服务的卸载操作。

1) 停止服务

[root@fastdfs ~]# systemctl stop fastdfs-tracker.service
[root@fastdfs ~]# systemctl stop fastdfs-storage.service

[root@fastdfs ~]# rm -rf /lib/systemd/system/fastdfs-tracker.service
[root@fastdfs ~]# rm -rf /lib/systemd/system/fastdfs-storage.service

2) 通过storage.conf找到base_path和store_path然后删除

[root@fastdfs ~]# cat /etc/fdfs/storage.conf | grep base_path

base_path=/www/fastdfs
# if store_path0 not exists, it's value is base_path (NOT recommended)
#       the base_path should be independent (different) of the store paths
[root@fastdfs ~]# cat /etc/fdfs/storage.conf | grep store_path

store_path_count = 1
# store_path#, based on 0, to configure the store paths to store file
# if store_path0 not exists, it's value is base_path (NOT recommended)
store_path0=/www/fastdfs/data
#store_path1=/home/yuqing/fastdfs2
# store_path (disk), value can be 1 to 256, default value is 256
check_store_path_mark = true

删除上面标红的路径,

注意, 如果有未备份的文件,请先备份再删除

[root@fastdfs ~]# rm -rf /www/fastdfs_storage
[root@fastdfs ~]# rm -rf /www/fastdfs_storage_data

3) 通过 tracker.conf 找到 base_path 然后删除

[root@fastdfs ~]# cat /etc/fdfs/tracker.conf |grep base_path

base_path=/www/fastdfs
[root@fastdfs ~]# rm –rf /www/fastdfs

4) 删除配置文件目录

[root@fastdfs ~]# ll /etc/fdfs/

-rw-r--r-- 1 root root  1839 Dec 16 20:04 client.conf
-rw-r--r-- 1 root root  1834 Dec 16 18:24 client.conf.sample
-rw-r--r-- 1 root root   955 Dec 16 18:26 http.conf
-rw-r--r-- 1 root root 31172 Dec 16 18:26 mime.types
-rw-r--r-- 1 root root  3741 Mar 17 20:43 mod_fastdfs.conf
-rw-r--r-- 1 root root 10076 Dec 16 20:02 storage.conf
-rw-r--r-- 1 root root 10085 Dec 16 18:24 storage.conf.sample
-rw-r--r-- 1 root root   527 Dec 16 18:26 storage_ids.conf
-rw-r--r-- 1 root root   527 Dec 16 18:24 storage_ids.conf.sample
-rw-r--r-- 1 root root  8038 Mar 18 13:16 tracker.conf
-rw-r--r-- 1 root root  8038 Dec 16 18:24 tracker.conf.sample

[root@fastdfs ~]# rm -rf /etc/fdfs/

5) 删除链接文件

[root@fastdfs ~]# rm –rf /usr/local/lib/libfastcommon.so
[root@fastdfs ~]# rm –rf /usr/local/lib/libfdfsclient.so
[root@fastdfs ~]# rm –rf /usr/lib/libfdfsclient.so

6) 删除/usr/bin目录下FastDFS的可执行文件

首先通过ls命令查看文件,然后删除

[root@fastdfs ~]# ll /usr/bin/fdfs_*

-rwxr-xr-x 1 root root  362232 Mar 17 20:36 /usr/bin/fdfs_appender_test
-rwxr-xr-x 1 root root  362008 Mar 17 20:36 /usr/bin/fdfs_appender_test1
-rwxr-xr-x 1 root root  348888 Mar 17 20:36 /usr/bin/fdfs_append_file
-rwxr-xr-x 1 root root  348504 Mar 17 20:36 /usr/bin/fdfs_crc32
-rwxr-xr-x 1 root root  348920 Mar 17 20:36 /usr/bin/fdfs_delete_file
-rwxr-xr-x 1 root root  349656 Mar 17 20:36 /usr/bin/fdfs_download_file
-rwxr-xr-x 1 root root  349608 Mar 17 20:36 /usr/bin/fdfs_file_info
-rwxr-xr-x 1 root root  364928 Mar 17 20:36 /usr/bin/fdfs_monitor
-rwxr-xr-x 1 root root  349144 Mar 17 20:36 /usr/bin/fdfs_regenerate_filename
-rwxr-xr-x 1 root root 1280112 Mar 17 20:36 /usr/bin/fdfs_storaged
-rwxr-xr-x 1 root root  372096 Mar 17 20:36 /usr/bin/fdfs_test
-rwxr-xr-x 1 root root  367216 Mar 17 20:36 /usr/bin/fdfs_test1
-rwxr-xr-x 1 root root  512320 Mar 17 20:36 /usr/bin/fdfs_trackerd
-rwxr-xr-x 1 root root  349848 Mar 17 20:36 /usr/bin/fdfs_upload_appender
-rwxr-xr-x 1 root root  350864 Mar 17 20:36 /usr/bin/fdfs_upload_file

看到全是FastDFS的文件,删除:

[root@fastdfs ~]# rm -rf  /usr/bin/fdfs_*

7) 删除 /usr/include/ 目录下 FastDFS 相关的shell脚本

首先查看文件:

[root@fastdfs ~]# ll /usr/include/fastdfs/*

-rw-r--r-- 1 root root  3810 Mar 17 20:36 /usr/include/fastdfs/client_func.h
-rw-r--r-- 1 root root   805 Mar 17 20:36 /usr/include/fastdfs/client_global.h
-rw-r--r-- 1 root root   542 Mar 17 20:36 /usr/include/fastdfs/fdfs_client.h
-rw-r--r-- 1 root root   957 Mar 17 20:36 /usr/include/fastdfs/fdfs_define.h
-rw-r--r-- 1 root root  1027 Mar 17 20:36 /usr/include/fastdfs/fdfs_global.h
-rw-r--r-- 1 root root  3203 Mar 17 20:36 /usr/include/fastdfs/fdfs_http_shared.h
-rw-r--r-- 1 root root  1982 Mar 17 20:36 /usr/include/fastdfs/fdfs_server_id_func.h
-rw-r--r-- 1 root root  5635 Mar 17 20:36 /usr/include/fastdfs/fdfs_shared_func.h
-rw-r--r-- 1 root root  1001 Mar 17 20:36 /usr/include/fastdfs/mime_file_parser.h
-rw-r--r-- 1 root root 20670 Mar 17 20:36 /usr/include/fastdfs/storage_client1.h
-rw-r--r-- 1 root root 22425 Mar 17 20:36 /usr/include/fastdfs/storage_client.h
-rw-r--r-- 1 root root 11559 Mar 17 20:36 /usr/include/fastdfs/tracker_client.h
-rw-r--r-- 1 root root 13924 Mar 17 20:36 /usr/include/fastdfs/tracker_proto.h
-rw-r--r-- 1 root root 14861 Mar 17 20:36 /usr/include/fastdfs/tracker_types.h
-rw-r--r-- 1 root root  7404 Mar 17 20:36 /usr/include/fastdfs/trunk_shared.h

删除:

[root@fastdfs ~]# rm -rf /usr/include/fastdfs/

8) 删除/usr/lib64目录下的库文件

查看:

[root@fastdfs ~]# ll /usr/lib64/libfdfsclient*

-rwxr-xr-x 1 root root 356672 Mar 17 20:36 /usr/lib64/libfdfsclient.so

删除:

[root@fastdfs ~]# rm -rf /usr/lib64/libfdfsclient*

9) 删除/usr/lib/目录下的库

查看:

[root@fastdfs ~]# ll /usr/lib/libfdfsclient*

-rwxr-xr-x. 1 root root 255538 Jul 27 03:01 libfdfsclient.so

删除:

[root@fastdfs ~]# rm -rf /usr/lib/libfdfsclient*
作者:Jeebiz  创建时间:2022-12-09 09:40
最后编辑:Jeebiz  更新时间:2024-08-02 11:04