1. FastDFS 安装
FastDFS用C开发,Win下不支持,得用LIUNX了。笔者用的是Ubuntu18,默认大家比较熟悉用linux,资源有限,就安装一个tracker,版本FastDFS_v5.05
1.1 linux 下安装 libevent
github 地址 (这个是最新的)
git clone …..[某个版本]
然后照着它的README安装就行了
采用cmake方式
mkdir build && cd build
cmake ..
make
make verify # (optional)
多简单,之前笔者像个呆瓜一样用libevent-2.0.21-stable,如下然后还要处理这个麻瓜问题
放弃吧!用git clone
1.2 安装 libfastcommon
libfastcommon 是 FastDFS 官方提供的,libfastcommon 包含了 FastDFS 运行所需 要的一些基础库。
1、 下载
github地址
git clone ......
2、 编译安装
sudo cp -r libfastcommon /usr/local/
cd /usr/local
cd libfastcommon
./make.sh
./make.sh install
3、 拷贝文件
libfastcommon 安装好后会自动将库文件拷贝至/usr/lib64 下,由于 FastDFS 程 序引用 usr/lib 目录所以需要将/usr/lib64 下的库文件拷贝至/usr/lib 下。 要拷贝的文件如下:
1.3 tracker 安装
1、 下载
git clone ........
2、 编译
sudo cp -r FastDFS /usr/local/
cd /usr/local/FastDFS
./make.sh # 编译
./make.sh install #安装
3、 安装成功将安装目录下的 conf 下的文件拷贝到/etc/fdfs/下。
2. fastDFS配置
2.1 配置 tracker.conf
拷贝一份新的 tracker 配置文件:
cp tracker.conf.sample tracker.conf
修改 tracker.conf
vim tracker.conf
base_path=/home/yuqing/FastDFS 改为: base_path=/home/FastDFS
配置 http 端口: http.server_port=80
2.2 启动
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
start stop restart多试几次
查看端口,三选一,成功启动!
ps -ef | grep fastdfs | grep -v grep
netstat -anp | grep 22122
lsof -i:22122