2025年fastdfs架构(fastdfs gridfs)

fastdfs架构(fastdfs gridfs)进入 etc fdfs 目录 复制 FastDFS 存储器样例配置文件 storage conf sample 并重命名为 storage conf cd etc fdfs cp storage conf sample storage conf vim storage conf 编辑 storage conf 飘黄的需要修改 其它的默认即可 配置文件是否生效

大家好,我是讯享网,很高兴认识大家。



① 进入 /etc/fdfs 目录,复制 FastDFS 存储器样例配置文件 storage.conf.sample,并重命名为 storage.conf

#cd /etc/fdfs
#cp storage.conf.sample storage.conf
#vim storage.conf




PS:tracker_server写自己的本机IP,直接用ifconfig,可以ping通

这里报错大概率是IP没写对

③ 创建Storage基础数据目录,对应base_path目录

④ 防火墙中打开存储器端口(默认的 23000)

上述命令我自己的ubuntu没有该目录,因此迂回一下

一、查看系统是否安装防火墙
#sudo whereis iptables
若是没有安装,能够经过如下命令安装tcp
#sudo apt-get install iptables
二、查看防火墙的配置信息测
#sudo iptables -L

fastdfs不使用nginx_fastdfs不使用nginx
讯享网



三、新建规则文件



#mkdir /etc/iptables #先新建目录



#vi /etc/iptables/rules.v4



添加如下内容(备注:80是指web服务器端口,3306是指MySQL数据库连接端口,22是指SSH远程管理端口)



*filter



:INPUT DROP [0:0]



:FORWARD ACCEPT [0:0]



:OUTPUT ACCEPT [0:0]



:syn-flood - [0:0]



-A INPUT -i lo -j ACCEPT



-A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT



-A INPUT -p tcp -m state –state NEW -m tcp –dport 22 -j ACCEPT



-A INPUT -p tcp -m state –state NEW -m tcp –dport 80 -j ACCEPT



-A INPUT -p tcp -m state –state NEW -m tcp –dport 3306 -j ACCEPT



-A INPUT -p icmp -m limit –limit 100/sec –limit-burst 100 -j ACCEPT



-A INPUT -p icmp -m limit –limit 1/s –limit-burst 10 -j ACCEPT



-A INPUT -p tcp -m tcp –tcp-flags FIN,SYN,RST,ACK SYN -j syn-flood



-A INPUT -j REJECT –reject-with icmp-host-prohibited



-A syn-flood -p tcp -m limit –limit 3/sec –limit-burst 6 -j RETURN



-A syn-flood -j REJECT –reject-with icmp-port-unreachable



COMMIT



四、使防火墙生效



#iptables-restore < /etc/iptables/rules.v4



五、建立文件,使防火墙开机启动



#vi /etc/network/if-pre-up.d/iptables



添加如下内容,

#!/bin/bash



iptables-restore < /etc/iptables/rules.v4



六、添加执行权限



chmod +x /etc/network/if-pre-up.d/iptables



七、查看规则是否生效



iptables -L -n

添加如下端口行加到/etc/iptables/rules.v4中:

-A INPUT -m state –state NEW -m tcp -p tcp –dport 23000 -j ACCEPT

重启防火墙:

#service iptables restart

查看 Storage 是否成功启动,23000 端口正在被监听,则 Storage 启动成功

#netstat -unltp|grep fdfs

fastdfs不使用nginx_python_02

⑥ 设置 Storage 开机启动

#chkconfig fdfs_storaged on

或者:

fastdfs不使用nginx_fastdfs不使用nginx_03

① 修改 Tracker 服务器中的客户端配置文件

#/usr/bin/fdfs_test /etc/fdfs/client.conf upload /usr/local/image/XX.jpg

fastdfs不使用nginx_fastdfs不使用nginx_04

fastdfs不使用nginx_linux_05

fastdfs不使用nginx_linux_06

fastdfs不使用nginx_Storage_07

参考了以下文档,真诚致谢

小讯
上一篇 2025-06-11 21:44
下一篇 2025-06-05 23:30

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/144677.html