CentOS7.X安装FastDFS-5.10
安装准备
yum install \
vim \
git \
gcc \
gcc-c++ \
wget \
make \
libtool \
automake \
autoconf \
-y \安装libfastcommon
cd /root
git clone https://github.com/happyfish100/libfastcommon.git
cd libfastcommon/
./make.sh
./make.sh install安装fastdfs
cd /root
wget https://github.com/happyfish100/fastdfs/archive/V5.10.tar.gz
tar -zxvf V5.10.tar.gz
cd fastdfs-5.10
./make.sh
./make.sh install- 如果只想安装FastDFS php客户端,请直接向下,找到php安装FastDFS扩展
创建目录
mkdir /data/
mkdir /data/fdfs
# 代码服务器执行
mkdir /data/fdfs/client
# 存储服务器执行
mkdir /data/fdfs/storage
# 跟踪服务器执行
mkdir /data/fdfs/tracker配置的建议
- 每一台client配置上所有tracker服务器地址
- 每一台storage配置上所有tracker服务器地址
- 每一个group至少有2个storage服务互为备份机
- group name建议从group0开始命名(兼容FastDHT)
配置client(在client服务器[代码服务器])
cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf
vim /etc/fdfs/client.conf base_path=/data/fdfs/client
tracker_server=192.168.1.101:22122 #tracker服务器1 ip地址
tracker_server=192.168.1.102:22122 #tracker服务器2 ip地址 ESC
:wq配置storage(在storage服务器)
cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
vim /etc/fdfs/storage.conf group_name=group0
base_path=/data/fdfs/storage
#这样配置只有M00
store_path0=/data/fdfs/storage
#这样配置就有M01(一般用于磁盘挂载的情况)
#store_path1=/mnt/fdfs/storage
#设置storage最大连接数
max_connections=1024
#tracker服务器1 ip地址
tracker_server=192.168.1.101:22122
#只有一台tracker不要增加这条↓!!!!!!!!
#tracker_server=192.168.1.102:22122 #tracker服务器2 ip地址 #以下配置安装FastDHT才配置!!!!!!!!
#以下配置安装FastDHT才配置!!!!!!!!
#以下配置安装FastDHT才配置!!!!!!!! check_file_duplicate=1
key_namespace=FastDFS
keep_alive=1
#include /etc/fdht/fdht_servers.conf ESC
:wq配置tracker(在tracker服务器)
cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
vim /etc/fdfs/tracker.conf bind_addr=192.168.1.101
base_path=/data/fdfs/tracker
# 0轮询 1指定组 2最大剩余空间
store_lookup=2
max_connections=1024
# work_threads <= max_connections
work_threads=16 ESC
:wq启动及测试【注意】
# 如果storage.conf做了FastDHT配置,一定要先安装FastDHT启动tracker和storage
# 用来做tracker的服务器执行
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf # 用来做storage的服务器执行
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf启动与停止
# 只能在对应服务器上进行对应操作!!!!!!!!
# 只能在对应服务器上进行对应操作!!!!!!!!
# 只能在对应服务器上进行对应操作!!!!!!!!
# 启动
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf # 关闭
/usr/bin/stop.sh /usr/bin/fdfs_trackerd
/usr/bin/stop.sh /usr/bin/fdfs_storaged # 重启
/usr/bin/restart.sh /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
/usr/bin/restart.sh /usr/bin/fdfs_storaged /etc/fdfs/storage.conf # 查看集群storage分布(在storage服务器执行)
/usr/bin/fdfs_monitor /etc/fdfs/storage.conf # 删除某个group中的一个storage(在storage服务器执行)
/usr/local/bin/fdfs_monitor /etc/fdfs/storage.conf delete [group name] [ip address]开机启动
# 用来做tracker的服务器执行
vim /etc/rc.local /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf ESC
:wq chmod +x /etc/rc.local # 用来做storage的服务器执行
vim /etc/rc.local /usr/bin/fdfs_storaged /etc/fdfs/storage.conf ESC
:wq chmod +x /etc/rc.local可通过日志查看是否启动成功
# 用来做storage的服务器执行
cat /data/fdfs/storage/logs/storaged.log|grep ERROR
cat /data/fdfs/storage/logs/storaged.log|grep WARNING # 用来做tracker的服务器执行
cat /data/fdfs/tracker/logs/trackerd.log|grep ERROR
cat /data/fdfs/tracker/logs/trackerd.log|grep WARNING # 在storage服务器创建软连接
# 配置Nginx才添加!!!!!!!!
# 配置Nginx才添加!!!!!!!!
# 配置Nginx才添加!!!!!!!!
mkdir /www/fastdfs/group0
ln -s /data/fdfs/storage/data/ /www/fastdfs/group0/M00防火墙相关配置
yum install firewalld systemctl enable firewalld
systemctl start firewalld firewall-cmd --zone=public --add-port=11411/tcp --permanent
firewall-cmd --zone=public --add-port=22122/tcp --permanent
firewall-cmd --zone=public --add-port=23000/tcp --permanent firewall-cmd --reload测试功能是否正常
mkdir /test
cd /test
vim test.txt
This is a test file.
ESC
:wq
#上传
/usr/bin/fdfs_test /etc/fdfs/client.conf upload /test/test.txt #下载
/usr/bin/fdfs_download_file /etc/fdfs/client.conf group0/M00/00/00/xxx.txt
#查看下载文件
ll /test
#删除下载文件
rm /xxx.txt #删除
/usr/bin/fdfs_delete_file /etc/fdfs/client.conf group0/M00/00/00/xxx.cfg为php安装fastdfs_client扩展
cd /root/fastdfs-5.10/php_client
phpize
./configure make
make install cat /root/fastdfs-5.10/php_client/fastdfs_client.ini >> /usr/local/php/lib/php.ini
kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`为php安装fastcommon扩展
cd /root/libfastcommon/php-fastcommon
phpize
./configure make
make install vim /usr/local/php/lib/php.ini extension=fastcommon.so ESC
:wq kill -USR2 `cat /usr/local/php-7.1.4/var/run/php-fpm.pid`
CentOS7.X安装FastDFS-5.10的更多相关文章
- Centos7 上安装FastDFS
Centos7 上安装 FastDFS 本文章摘抄于 风止鱼歇 博客地址:https://www.cnblogs.com/yufeng218/p/8111961.html 1.安装gcc(编译时需要 ...
- Linux CentOS7下安装Zookeeper-3.4.10服务(最新)
Linux CentOS7下安装Zookeeper-3.4.10服务(最新) 2017年10月27日 01:25:26 极速-蜗牛 阅读数:1933 版权声明:本文为博主原创文章,未经博主允许不得 ...
- Centos7 上安装 FastDFS
1.安装gcc(编译时需要) FastDFS是C语言开发,安装FastDFS需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没有gcc环境,需要安装gcc yum install -y gcc ...
- centos7.x 安装 fastDFS
环境准备 使用的系统软件 名称 说明 centos 7.x libfatscommon FastDFS分离出的一些公用函数包 FastDFS FastDFS本体 fastdfs-nginx-modul ...
- Centos7编译安装lnmp(nginx1.10 php7.0.2)
我使用的是阿里云的服务器 Centos7 64位的版本 1. 连接服务器 这个是Xshell5的版本 安装好之后我们开始连接服务器 2. 安装nginx 首先安装nginx的依赖 yum instal ...
- CentOS7.0安装Nginx 1.10.0
首先由于nginx的一些模块依赖一些lib库,所以在安装nginx之前,必须先安装这些lib库,这些依赖库主要有g++.gcc.openssl-devel.pcre-devel和zlib-devel ...
- CentOS7.2 安装RabbitMQ3.6.10
CentOS上面使用yum安装比较方便 先记录一些rabbitmq的基本操作命令: $ sudo chkconfig rabbitmq-server on # 添加开机启动RabbitMQ服务 $ s ...
- Centos7下安装MongoDB4.0.10
前言 模式自由 :可以把不同结构的文档存储在同一个数据库里 面向集合的存储:适合存储 JSON风格文件的形式 完整的索引支持:对任何属性可索引 复制和高可用性:支持服务器之间的数据复制,支持主-从模式 ...
- Linux centOS7 下安装mysql5.7.10
1:下载二进制安装包 http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.10-linux-glibc2.5-x86_64.tar.gz 2:解压到 ...
- centos7下安装docker(10容器底层--cgroup和namespace)
cgroup和namespace是实现容器底层的重要技术 cgroup:实现资源限制 namespace:实现资源隔离 1.cgroup:control group Linux操作系统通过cgroup ...
随机推荐
- ajax 的post方法 的content-type设置和express里应用body-parser
ajax的post方法相比get方法,在传参形式上很不一样, get把参数用'?'拼接在端口后,并且用'&'连接;而post则是需要在send参数里设置. 根据ajax实例xhr.setReq ...
- 重磅 | Elasticsearch7.X学习路线图
原文:重磅 | Elasticsearch7.X学习路线图 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.c ...
- javascript(DOM)实例
JavaScript学习笔记 JS补充笔记 实例之跑马灯,函数创建.通过ID获取标签及内部的值,字符串的获取与拼接.定时器的使用 使用定时器实现在console中打印内容 Dom选择器使用与调试记录 ...
- 攻防世界--re-for-50-plz-50
RetDec是真的难安装,太笨了~~~ 1.准备 获取信息 32位文件 2.IDA打开 发现这是MIPS代码.本来准备安装RetDec,哎...还是恶补MIPS指令知识吧:https://www.cn ...
- vue.js(18)--父组件向子组件传值
子组件是不能直接使用父组件中数据的,需要进行属性绑定(v-bind:自定义属性名=“msg”),绑定后需要在子组件中使用props[‘自定义属性名’]数组来定义父组件的自定义名称. props数组中的 ...
- Route的exact属性
exact是Route下的一个属性,react路由会匹配到所有能匹配到的路由组件,exact能够使得路由的匹配更严格一些. exact的值为bool型,为true时表示严格匹配,为false时为正常匹 ...
- 通过css样式给表格tbody加垂直滚动条
tbody加滚动条实现思路: 1,把tbody设置成display:block,然后就对其高度设置一个固定值,overflow设置成auto. 2,把thead的tr设置成display:block. ...
- vue动态生成表单
vue动态生成表单 一.下拉框 <!DOCTYPE html> <html> <head> <meta charset="utf-8" / ...
- 【rabbitmq】解决SimpleAmqpClient创建连接时阻塞的问题
https://blog.csdn.net/panxianzhan/article/details/50755409 https://blog.csdn.net/csm201314/article/d ...
- 函数&&变量
#*- encoding=utf-8 -*import sysprint(sys.getdefaultencoding()) def test(x,y,z): print(x) print(y) pr ...