一、安装依赖包:libevent
[root@test-heji-web-165-217 src]# yum -y install libevent
二、安装libfastcommon
[root@test-heji-web-165-217 src]# wget https://github.com/happyfish100/libfastcommon/archive/V1.0.35.tar.gz
[root@test-heji-web-165-217 src]# tar -zxvf V1.0.35.tar.gz
[root@test-heji-web-165-217 src]# cd libfastcommon-1.0.35
[root@test-heji-web-165-217 libfastcommon-1.0.35]# ./make.sh
[root@test-heji-web-165-217 libfastcommon-1.0.35]# ./make.sh install
#设置软连接
[root@test-heji-web-165-217 libfastcommon-1.0.35]# ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so
[root@test-heji-web-165-217 libfastcommon-1.0.35]# ln -s /usr/lib64/libfdfsclient.so /usr/local/lib/libfdfsclient.so
三、安装FastDFS
[root@test-heji-web-165-217 src]# wget https://github.com/happyfish100/fastdfs/archive/V5.10.tar.gz
[root@test-heji-web-165-217 src]# tar -zxvf V5.10.tar.gz
[root@test-heji-web-165-217 src]# cd fastdfs-5.10/
[root@test-heji-web-165-217 fastdfs-5.10]# ./make.sh
[root@test-heji-web-165-217 fastdfs-5.10]# ./make.sh install
安装完成后的目录:
1、服务脚本
[root@test-heji-web-165-217 fastdfs-5.10]# ll /etc/init.d/ |grep fdfs
-rwxr-xr-x 1 root root 918 Oct 24 11:16 fdfs_storaged
-rwxr-xr-x 1 root root 920 Oct 24 11:16 fdfs_trackerd
2、配置文件
[root@test-heji-web-165-217 fastdfs-5.10]# ll /etc/fdfs
-rw-r--r-- 1 root root 1461 Oct 24 11:16 client.conf.sample
-rw-r--r-- 1 root root 7927 Oct 24 11:16 storage.conf.sample
-rw-r--r-- 1 root root 105 Oct 24 11:16 storage_ids.conf.sample
-rw-r--r-- 1 root root 7389 Oct 24 11:16 tracker.conf.sample
3、命令行工具
[root@test-heji-web-165-217 fastdfs-5.10]# ll /usr/bin|grep fdfs
-rwxr-xr-x 1 root root 317456 Oct 24 11:16 fdfs_appender_test
-rwxr-xr-x 1 root root 317232 Oct 24 11:16 fdfs_appender_test1
-rwxr-xr-x 1 root root 304080 Oct 24 11:16 fdfs_append_file
-rwxr-xr-x 1 root root 303808 Oct 24 11:16 fdfs_crc32
-rwxr-xr-x 1 root root 304136 Oct 24 11:16 fdfs_delete_file
-rwxr-xr-x 1 root root 304872 Oct 24 11:16 fdfs_download_file
-rwxr-xr-x 1 root root 304464 Oct 24 11:16 fdfs_file_info
-rwxr-xr-x 1 root root 322384 Oct 24 11:16 fdfs_monitor
-rwxr-xr-x 1 root root 1111360 Oct 24 11:16 fdfs_storaged
-rwxr-xr-x 1 root root 327392 Oct 24 11:16 fdfs_test
-rwxr-xr-x 1 root root 326608 Oct 24 11:16 fdfs_test1
-rwxr-xr-x 1 root root 454000 Oct 24 11:16 fdfs_trackerd
-rwxr-xr-x 1 root root 305064 Oct 24 11:16 fdfs_upload_appender
-rwxr-xr-x 1 root root 306088 Oct 24 11:16 fdfs_upload_file
四、配置跟踪服务器(tracker server)
1、拷贝tracker server并重命名
[root@test-heji-web-165-217 fastdfs-5.10]# cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
2、配置tracker server
#创建tracker server数据目录
[root@test-heji-web-165-217 fastdfs-5.10]# mkdir -p /data/fastdfs/tracker
[root@test-heji-web-165-217 fastdfs-5.10]# vi /etc/fdfs/tracker.conf
修改如下:
base_path=/data/fastdfs/tracker
测试启动tracker server,启动成功会自动在/data/fastdfs/tracker目录新建data和logs目录:
[root@test-heji-web-165-217 fastdfs-5.10]# /etc/init.d/fdfs_trackerd start
Reloading systemd: [ OK ]
Starting fdfs_trackerd (via systemctl): [ OK ]
[root@test-heji-web-165-217 fastdfs-5.10]# ll /data/fastdfs/tracker/
total 8
drwxr-xr-x 2 root root 4096 Oct 24 11:30 data
drwxr-xr-x 2 root root 4096 Oct 24 11:30 logs
查看是否有 tracker 进程:
[root@test-heji-web-165-217 fastdfs-5.10]# ps aux | grep tracker
root 23791 0.0 0.