docker一键安装
分步安装
下载
将3个文件上传到/usr/local目录下
安装
解压前准备
yum -y install unzip zip gcc-c++
分别解压
cd /usr/local
unzip libfastcommon-master.zip
tar -zxvf fastdfs-5.11.tar.gz
unzip fastdfs-nginx-module-master.zip
安装
cd /usr/local/libfastcommon-master
./make.sh && ./make.sh install
# 设置类库软连接
ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so
ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so
ln -s /usr/lib64/libfdfsclient.so /usr/local/lib/libfdfsclient.so
ln -s /usr/lib64/libfdfsclient.so /usr/lib/libfdfsclient.so
cd /usr/local/fastdfs-5.11
./make.sh && ./make.sh install
配置
cd /etc/fdfs
cp client.conf.sample client.conf
cp storage.conf.sample storage.conf
cp tracker.conf.sample tracker.conf
mkdir -p /opt/fastdfs_tracker
vi /etc/fdfs/tracker.conf
修改以下内容:
disabled=false # 取消禁用
port=22122 # 端口设置
base_path=/opt/fastdfs_tracker # 设置存储目录
http.server_port=6666 # 设置http端口,默认是8080
为trackerd启动脚本创建软引用:
ln -s /usr/bin/fdfs_trackerd /usr/local/bin
ln -s /usr/bin/stop.sh /usr/local/bin
ln -s /usr/bin/restart.sh /usr/local/bin
通过命令操作Tracker服务器:
service fdfs_trackerd start # 启动
service fdfs_trackerd stop # 停止
service fdfs_trackerd status # 服务状态
创建Storage服务器的文件目录:
mkdir /opt/fastdfs_storage
mkdir /opt/fastdfs_storage_data
vi /etc/fdfs/storage.conf
修改以下内容:
disabled=false # 取消禁用
group_name=group1 # 文件组名称设置
port=23000 # 端口设置
base_path=/opt/fastdfs_storage # 设置数据文件、日志目录
store_path_count=1 # 存储路径个数,需要与store_path个数匹配
store_path0=/opt/fastdfs_storage_data # 设置存储路径
tracker_server=192.168.3.207:22122 # tracker服务器地址**(需要修改为自己的IP)**,集群时写法192.168.3.207:22122,192.168.3.208:22122,不允许使用127.0.0.1
http.server_port=6667 # 设置http端口
ln -s /usr/bin/fdfs_storaged /usr/local/bin # 创建软连接
service fdfs_storaged start # 启动
service fdfs_storaged stop # 停止
service fdfs_storaged status # 服务状态
验证
netstat -unltp | grep fdfs
开机启动
/usr/local/fastdfs-5.11是安装目录!
fdfs_tracker设置开机启动
cp /usr/local/fastdfs-5.11/init.d/fdfs_trackerd /etc/init.d/
chkconfig --add fdfs_trackerd
chkconfig fdfs_trackerd on
fdfs_storafed设置开机启动
cp /usr/local/fastdfs-5.11/init.d/fdfs_storaged /etc/init.d/
chkconfig --add fdfs_storaged
chkconfig fdfs_storaged on