centos安装fastdfs单机版
时间: 2023-11-05 20:58:19 浏览: 90
好的,针对你的问题,我可以给你提供一份快速安装单机版FastDFS的步骤:
1.安装必要的依赖包:
yum install wget gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel
2.下载源码并解压:
wget https://github.com/happyfish100/libfastcommon/archive/V1.0.43.tar.gz
wget https://github.com/happyfish100/fastdfs/archive/V5.11.tar.gz
tar -zxvf V1.0.43.tar.gz
tar -zxvf V5.11.tar.gz
3.编译安装libfastcommon:
cd libfastcommon-1.0.43
./make.sh
./make.sh install
4.编译安装fastdfs:
cd ../fastdfs-5.11
./make.sh
./make.sh install
5.修改配置文件:
cd /etc/fdfs/
cp tracker.conf.sample tracker.conf
cp storage.conf.sample storage.conf
cp client.conf.sample client.conf
vim tracker.conf
修改如下配置项:
# tracker server port
port=22122
# bind address of tracker server
bind_addr=
# check active storage server every 30 seconds
check_interval=30
# the base path to store data and log files
base_path=/data/fastdfs/tracker
修改storage.conf配置项:
# storage server port
port=23000
# bind address of storage server
bind_addr=
# the storage server belong to a group
group_name=group1
# a storage server consist of one or more logic volumes
# each logic volume looks like a local file system but
# actually files are stored in storage servers
store_path0=/data/fastdfs/storage
修改client.conf配置项:
# tracker server list, comma separated
tracker_server=127.0.0.1:22122
# enable or disable logging
log_level=info
# http server port
http.tracker_server_port=8080
6.启动FastDFS服务:
启动tracker服务:
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
启动storage服务:
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf
7.测试FastDFS服务:
上传测试文件:
/usr/bin/fdfs_test /etc/fdfs/client.conf upload /etc/passwd
查看上传的文件ID:
/usr/bin/fdfs_test /etc/fdfs/client.conf stat /group1/M00/00/00/wKgCas6ktKyAJfojAAAADna8XmQ460.txt
下载测试文件:
/usr/bin/fdfs_test /etc/fdfs/client.conf download /group1/M00/00/00/wKgCas6ktKyAJfojAAAADna8XmQ460.txt
至此,你已经成功安装了FastDFS单机版。请根据实际情况修改配置文件,将FastDFS部署到你的应用中。 如果你有其他问题,可以再问我哦!
阅读全文