Fastdfs 部署干货

tracker server and client:192.168.1.42

storage server:192.168.1.46

storage server:192.168.1.53

 

安装:

安装依赖包libfastcommon

安装fastDFS

需要关闭iptables、selinux

yum -y install epel-release

yum -y install git

下载地址:

git clone https://github.com/happyfish100/fastdfs.git

git clone https://github.com/happyfish100/libfastcommon.git

git clone https://github.com/happyfish100/fastdfs-nginx-module.git

 

tracker server配置:

[[email protected] ~]# cd libfastcommon-1.0.36
[[email protected] libfastcommon-1.0.36]# ./make.sh 
[[email protected] libfastcommon-1.0.36]# ./make.sh install
[[email protected] libfastcommon-1.0.36]#

 

 

[[email protected] ~]# cd fastdfs-5.0.10
[[email protected] fastdfs-5.0.10]# ./make.sh 
[[email protected] fastdfs-5.0.10]# ./make.sh install

cd /etc/fdfs/
cp tracker.conf.sample tracker.conf
vim  tracker.conf
修改配置文件
disabled=false        #启用配置文件
port=22122          #设置tracker的端口号
base_path=/data/fastdfs/trackerd   #设置tracker的数据文件和日志目录(需预先创建)
http.server_port=18080     #设置http端口号
 
cp client.conf.sample  client.conf
vim client.conf
base_path=/data/fastdfs/trackerd
tracker_server=192.168.1.42:22122
 
启动:
mkdir -p /data/fastdfs/trackerd
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
设置开机启动
echo '/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart' >> /etc/rc.d/rc.local
 
 
storage server配置:

[[email protected] ~]# cd libfastcommon-1.0.36
[[email protected] libfastcommon-1.0.36]# ./make.sh 
[[email protected] libfastcommon-1.0.36]# ./make.sh install
[[email protected] libfastcommon-1.0.36]#

 

 

[[email protected] ~]# cd fastdfs-5.0.10
[[email protected] fastdfs-5.0.10]# ./make.sh 
[[email protected] fastdfs-5.0.10]# ./make.sh install

cd /etc/fdfs/
cp tracker.conf.sample tracker.conf
vim  tracker.conf
修改配置文件
disabled=false        #启用配置文件
port=23000    
base_path=/data/fastdfs/storage
store_path0=/data/fastdfs/storage
http.server_port=18888     #设置http端口号
tracker_server=192.168.1.42:22122
 
启动:
mkdir -p /data/fastdfs/trackerd
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
echo '/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart' >> /etc/rc.d/rc.local
 
 
storage server测试连接性:
/usr/bin/fdfs_monitor /etc/fdfs/storage.conf
Fastdfs 部署干货

 

 Fastdfs 部署干货

Fastdfs 部署干货

 

 tracker server测试上传下载:
 fdfs_upload_file /etc/fdfs/client.conf pom.xml      -----上传
fdfs_download_file /etc/fdfs/client.conf          -----下载
Fastdfs 部署干货

 

增加nginx upstream:

yum -y install epel-release

yum -y install nginx

位于http{}

Fastdfs 部署干货

 

 very good,晚上吃点好的去,啦啦啦啦!!!