目录
准备安装包
准备环境
Tracker节点配置
Storage节点配置
配置client测试FastDFS服务
对外发布
测试外发
注意:
FastDFS官网下载
fastdfs组合包.7z下载
yum install -y gcc gcc-c++ perl perl-devel openssl openssl-devel pcre pcre-devel zlib zlib-devel libevent libevent-devel
tar -zxvf /root/libfastcommon-1.0.42.tar.gz
cd ./libfastcommon-1.0.42/
./make.sh
./make.sh install
cd ../
tar -zxvf /root/fastdfs-6.04.tar.gz
cd ./fastdfs-6.04/
./make.sh
./make.sh install
cd ./conf/
cp * /etc/fdfs/
cd /etc/fdfs/
cd /etc/fdfs
vim tracker.conf
mkdir /usr/local/fastdfs/tracker -p
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
cd /etc/fdfs
vim storage.conf
一般更改这几个配置就可以了
# 修改storage的工作空间
base_path=/usr/local/fastdfs/storage
# 修改storage的存储空间
store_path0=/usr/local/fastdfs/storage
# 修改tracker的地址和端口号,用于心跳
tracker_server=192.168.213.159:22122
mkdir /usr/local/fastdfs/storage -p
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf
创建工作目录并启动
mkdir /usr/local/fastdfs/client -p
/usr/bin/fdfs_test /etc/fdfs/client.conf upload ./test.jpg
cd /usr/local/fastdfs/
tar -zxvf /root/fastdfs-nginx-module-1.22.tar.gz
cd fastdfs-nginx-module-1.22/src/
cp mod_fastdfs.conf /etc/fdfs/
cd /etc/fdfs/
ls
cd /usr/local/fastdfs/fastdfs-nginx-module-1.22/src
ls /usr/local/include
ls /usr/include
vim config
base_path=/usr/local/fastdfs/tmp
tracker_server=192.168.213.159:22122
group_name=group1
url_have_group_name = true
store_path0=/usr/local/fastdfs/storage
./configure --prefix=/usr/local/nginx --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --http-client-body-temp-path=/var/temp/nginx/client --http-proxy-temp-path=/var/temp/nginx/proxy --http-fastcgi-temp-path=/var/temp/nginx/fastcgi --http-uwsgi-temp-path=/var/temp/nginx/uwsgi --http-scgi-temp-path=/var/temp/nginx/scgi --conf-path=/usr/local/nginx/nginx.conf --add-module=/usr/local/fastdfs/fastdfs-nginx-module-1.22/src
server {
listen 8888;
server_name localhost;
location /group1/M00 {
ngx_fastdfs_module;
}
}
FastDFS要求版本匹配很高,经常出现编译不通过,无法安装,如图
建议匹配好组建版本再进行安装调试,省去不必要的麻烦