实战fastdfs安装以及php扩展安装

1.tracker1:192.168.0.1

2.tracker2:192.168.0.2

strorage

192.168.0.1 192.168.0.2

1.安装libevent网络库

wget https://github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz
# ./configure –prefix=/usr
# make
# make install
# ls -al /usr/lib | grep libevent

2.安装tracker

wget http://fastdfs.googlecode.com/files/FastDFS_v3.06.tar.gz

tar xvzf FastDFS_v3.06.tar.gz

cd FastDFS

./make.sh

./make.sh install

3.安装strorage

vi /etc/fdfs/storage.conf

   放置data和log的目录
    base_path=/home/storage1/fastdfs
   
    # store_path#, based 0, if store_path0 not exists, it's value is base_path
    # the paths must be exist
    # 放置文件的目录
    store_path0=/home/storage1/fastdfs
    
    # tracker_server can ocur more than once, and tracker_server format is
    # "host:port", host can be hostname or ip address
    # tracker server的ip和端口,此处可以写多个tracker server,每行一个
    tracker_server=192.168.0.1:22122
    tracker_server=192.168.0.2:22122


vim /etc/fdfs/client.conf
    # the base path to store log files
    base_path=/tmp
    
    # tracker_server can ocur more than once, and tracker_server format is
    #  "host:port", host can be hostname or ip address
    tracker_server=192.168.68.113:22122
    tracker_server=192.168.68.116:22122

在nginx的server配置段中增加M00的location声明
[root@storage1]# vi /usr/local/nginx/conf/nginx.conf
    location /group1/M00 {
            root /home/storage1/fastdfs/data;
            ngx_fastdfs_module;
    }

ln -s /home/storage1/fastdfs/data  /home/storage1/fastdfs/data/M00

4.安装php扩展

cd FastDFS/php_client

/usr/local/webserver/php/bin/phpize

./configure --with-php-config=/usr/local/webserver/php/bin/php-config

make && make install

把这个源码目录中的fastdfs_client.ini改成自己想要的配置

放到php.ini后面即可,重新加载配置/usr/local/webserver/php/sbin/php-fpm reload


启动Trackerd

/usr/local/bin/fdfs_trackerd  /etc/fdfs/tracker.conf

启动 Storaged

/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值