标签:
CleverCode在自己的虚拟机中准备搭建一下分布式架构。
2.1 安装tracker
安装详解参考:http://blog.csdn.net/clevercode/article/details/52244358。
2.2 配置tracker
a) 首次安装
# vi /etc/fdfs/tracker.conf
base_path=/data0/fastdfs/tracker
# /usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf
# service iptables stop
b)非首次安装
1 停止tracker
# /usr/local/bin/stop.sh /usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf
2 需要清除tracker缓存配置文件,如果不清除,会报错,同步异常等等,最好清除。
# rm /data0/fastdfs/tracker/* -rf
3 关闭防火墙
# service iptables stop
4 配置
# vi /etc/fdfs/tracker.conf
base_path=/data0/fastdfs/tracker
5 启动# /usr/local/bin/fdfs_trackerd /etc/fdfs/tracker.conf
2.3 配置client.conf查看监控,已经有0个storage。
# vi /etc/fdfs/client.conf
base_path=/tmp
tracker_server=192.168.101.135:22122
http.tracker_server_port=80
# # /usr/local/bin/fdfs_monitor /etc/fdfs/client.conf
3.1 安装
安装详解参考:http://blog.csdn.net/clevercode/article/details/52244358。
3.2 配置
a)首次安装
# mkdir -p /data0/fastdfs/storage/storage0
# vi /etc/fdfs/storage.conf
http.server_port=80
group_name=group1
base_path=/data0/fastdfs
store_path0=/data0/fastdfs/storage/storage0
tracker_server=192.168.101.135:22122
# service iptables stop
# /usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf
b)非首次安装
1 关闭storage
# /usr/local/bin/stop.sh /usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf
2 清除storage缓存配置数据,如果不清除,会报错,同步异常等等,最好清除。
# rm /data0/fastdfs/data -rf
# rm /data0/fastdfs/logs -rf
3 关闭防火墙
# service iptables stop
4 配置文件(storage.conf)
# vi /etc/fdfs/storage.conf
http.server_port=80
group_name=group1
base_path=/data0/fastdfs
store_path0=/data0/fastdfs/storage/storage0
tracker_server=192.168.101.135:22122
# /usr/local/bin/fdfs_monitor /etc/fdfs/client.conf
4.1 安装
安装详解参考:http://blog.csdn.net/clevercode/article/details/52244358。
4.2 配置
a)首次安装
# mkdir -p /data0/fastdfs/storage/storage0
# vi /etc/fdfs/storage.conf
http.server_port=80
group_name=group1
base_path=/data0/fastdfs
store_path0=/data0/fastdfs/storage/storage0
tracker_server=192.168.101.135:22122
# service iptables stop
# /usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf
b)非首次安装
1 关闭storage
# /usr/local/bin/stop.sh /usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf
2 清除storage缓存配置数据,如果不清除,会报错,同步异常等等,最好清除。
# rm /data0/fastdfs/data -rf
# rm /data0/fastdfs/logs -rf
3 关闭防火墙
# service iptables stop
4 配置文件(storage.conf)
# vi /etc/fdfs/storage.conf
http.server_port=80
group_name=group1
base_path=/data0/fastdfs
store_path0=/data0/fastdfs/storage/storage0
tracker_server=192.168.101.135:22122
# /usr/local/bin/fdfs_monitor /etc/fdfs/client.conf
5.1 上传测试,可以看到被轮询到132和133两台机器上了。
# /usr/local/bin/fdfs_test /etc/fdfs/client.conf upload install.log
5.2 下载,也轮询到了132与133两台机器上。
# /usr/local/bin/fdfs_test /etc/fdfs/client.conf download group1 00/00/wKhlhVe5toqAQbX_AAE2PTXrYOA819.png
标签:
原文地址:http://blog.csdn.net/clevercode/article/details/52267080