fastdfs 部署使用

一、手工在Centos7 上面部署fastdfs

使用FastDfs centos7下的FastDFS5_09的安装与使用 x kevin提供教程
用FastDFS一步步搭建文件管理系统 x

Redis Install Step:
1.download install pkg
wget http://download.redis.io/releases/redis-4.0.2.tar.gz

2.unzip
tar xzf redis-4.0.2.tar.gz

3.install gcc/gcc-c++/zlib-devel/openssl-devel/psmisc
yum install gcc
yum -y install gcc-c++
yum install zlib-devel openssl-devel

4.compile redis source code and install it
make
make MALLOC=libc
make & install

5.edit redis.conf(e.g:setting password/modify default port)
vim redis.conf

6.startup service
redis-server redis.conf

7.use client tools connect to redis server
redis-cli #connection
auth password #use password authorization

8.shutdown redis service
redis-cli shutdown
=========================================================================
Firewall setting:
1.view firewall state
firewall -cmd --state

2.stop firewall service
systemctl stop firewalld
=========================================================================
FastDFS Install Step:
1.download libfastcommon & fastDFS
wget https://github.com/happyfish100/libfastcommon/archive/V1.0.36.tar.gz
wget https://github.com/happyfish100/fastdfs/archive/V5.11.tar.gz

2.unzip libfastcommon & fastDFS
tar xf V1.0.36.tar.gz
tar xf V5.11.tar.gz

3.compile && install libfastcommon
./make.sh
./make.sh install

4.compile && install FastDFS
./make.sh
./make.sh install

5.create fdfs data dir
mkdir -p /data/fdfs_tracker            #create fdfs_stracker service base path
mkdir -p /data/fdfs_storage            #create fdfs_storage service main dir
mkdir -p /data/fdfs_storage/base       #create fdfs_storage service base path
mkdir -p /data/fdfs_storage/storage0   #create first storage node
mkdir -p /data/fdfs_storage/storage1   #create second storage node

6.copy redis config file(default path:/etc/fdfs/)
cp storage.conf.sample storage.conf
cp tracker.conf.sample tracker.conf

7.setting confs (replace path,modify port,set)
vim /etc/fdfs/tracker.conf
vim /etc/fdfs/storage.conf

8.startup or stop service
/etc/init.d/fdfs_trackerd start|stop
/etc/init.d/fdfs_storaged start|stop

9.view state
ps -ef|grep fdfs
netstat -nltp

10.test upload file
#创建client目录
mkdir -p /data/client

#配置client文件
cd /etc/fdfs
cp client.conf.sample client.conf
vi client.conf
************************************************
#存放日志目录                                        *            
base_path=/data/client                    *
#跟踪服务器                                          *
tracker_server=192.168.1.222:22122        *
tracker_server=192.168.1.233:22122        *
************************************************

#create test file and upload it to server
echo "12345678" >> /data/1.txt
fdfs_upload_file /etc/fdfs/client.conf /data/1.txt

#view cluser running status
fdfs_monitor /etc/fdfs/client.conf
========================================================================
1.add user for nginx
useradd -s /sbin/nologin -M nginx

2.compile & install pcre
./configure --prefix=/data/pcre
make && make install

3.compile & install nginx module
./configure --prefix=/data/nginx --with-pcre=/usr/local/pcre-8.41 --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_stub_status_module --add-module=/data/fastdfs-nginx-module-master/src

make && make install

4.setting nginx module conf
cd /data/fastdfs-nginx-module-master/src
cp mod_fastdfs.conf /etc/fdfs
cd /usr/local/fastdfs/conf
cp anti-steal.jpg http.conf mine.types /etc/fdfs/
vi /data/nginx/conf/nginx.conf
vim /etc/fdfs/mod_fastdfs.conf

5.startup nginx
/data/nginx/sbin/nginx


二、Docker部署FastDFS(附示例代码)

Docker部署FastDFS(附示例代码)

docker 安装 FastDFS

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Dazer007

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值