一:fastdfs安装
1.需要装备的包
fastdfs5.10
libevent-2.0.18-stable.tar
libfastcommon-master
2.先安装libfastcommon-master
unzip libfastcommon-master.zip
cd libfastcommon-master
./make.sh
./make.sh install
libfastcommon 默认安装到了/usr/lib64/libfastcommon.so/usr/lib64/libfdfsclient.so
3.安装libevent-2.0.18-stable.tar
tar -zxvf libevent-2.0.22-stable.tar.gz
cd cd libevent-2.0.22-stable
//指定存放路径
./configure --prefix=/usr/local/libevent/
make && make install
4.安装fastdfs5.10
tar -zxvf tar zxvf fastdfs5.10.tar.gz
进入解压目录修改make.sh中TARGET_PREFIX=你要安装的目录
vim make.sh
./make.sh
./make.sh install
安装成功后的配置文件在/etc/fdfs
安装至此结束
5.配置文件配置
cd /etc/fdfs
复制3份配置文件
cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf
一:修改tracker.conf
vi /etc/fdfs/tracker.conf
disabled=false
port=22122 //端口按本机可用端口设置
base_path=/disk1/data/fastdfs //文件储存路径,需先创建
添加端口的指令如下:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22122 -j ACCEPT
重启防火墙service iptables restart
二:配置storage.conf
修改的内容如下:
disabled=false
port=23000 //端口按本机可用端口设置
base_path==/disk1/data/fastdfs //文件储存路径,需先创建
store_path0==/disk1/data/fastdfs //同base_path相同
tracker_server=ip:22122 //本机或另一台机器tracker配置的地址
http.server_port=8888
6:启动服务
/usr/local/include/fastdfs/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
//fdfs安装路径中的fdfs_trackerd 配置文件位置
/usr/local/include/fastdfs/bin/fdfs_storaged /etc/fdfs/storage.conf restart
//fdfs安装路径中的fdfs_storaged 配置文件位置
ps -ef|grep fdfs_ //查看是否正常启动
以上fdfs安装配置完毕