标签:fdfs inotify
下载:wget http://sourceforge.net/projects/fastdfs/files/FastDFS%20Server%20Source%20Code/FastDFS%20Server%20with%20PHP%20Extension%20Source%20Code%20V5.03/FastDFS_v5.03.tar.gz
安装:
修改make.sh
TARGET_PREFIX=/usr/local/fdfs/
TARGET_CONF_PATH=/etc/fdfs
#WITH_LINUX_SERVICE=1 #用默认值即可
./make.sh
./make.sh install
配置修改:
client.conf
base_path=/data/fastdfs
tracker_server=192.168.137.129:22122
tracker.conf
bind_addr=192.168.137.129
base_path=/data/fastdfs/
reserved_storage_space = 1% #测试时小点是防没空间了失败
storage.conf
bind_addr=192.168.137.129
base_path=/data/fastdfs/
# store_path#, based 0, if store_path0 not exists, it‘s value is base_path
# the paths must be exist
store_path0=/data/fastdfs
建立存储目录: mkdir -p /data/fastdfs
修改防火墙:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22122 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 23000 -j ACCEPT
重启:
iptables-restore</etc/sysconfig/iptables
启动tracker 和 storage
/usr/local/fdfs/bin/fdfs_trackerd /etc/fdfs/tracker.conf
/usr/local/fdfs/bin/fdfs_storaged /etc/fdfs/storage.conf
测试:
/usr/local/fdfs/bin/fdfs_test /etc/fdfs/client.conf upload /usr/local/nginx/html/index.html
注:没报错说明成功
调试:
若有错误发生,先看提示,然后查看netstat -tunlp|grep fdfs ,tracker 和 storage 是否开启成功
各个tracker 和 storage 查看管理:
/usr/local/fdfs/bin/fdfs_monitor /etc/fdfs/client.conf
注:会列出tracker 和 storage 的状态和当前配置状况
--------------------------------------------------------------
inotify:
下载:
wget http://nchc.dl.sourceforge.net/project/inotify-tools/inotify-tools/3.13/inotify-tools-3.13.tar.gz
安装:
tar -xvzf inotify-tools-3.13.tar.gz
cd inotify-tools-3.13
./configure --prefix=/usr/local/inotify
测试:
./bin/inotifywait -mrq /usr/local/nginx/html/tests/testinotify/
然后在 目标 监控目录里增删文件,在监控窗口会出现各种操作的状况,相应的记录到文件中,可以在需要时只修改同步相应的文件,这个应用一般与rsync 结合起来使用
标签:fdfs inotify
原文地址:http://jxw7733.blog.51cto.com/6389174/1693745