`

FastDFS初次安装体验

 
阅读更多

1,系统环境:CentOS7

 

2,安装文件准备: 

> cd /home/fastdfs
> wget "https://codeload.github.com/happyfish100/libfastcommon/zip/master"
> 7za x master
> rm -rf master
> wget "https://codeload.github.com/happyfish100/fastdfs/zip/master"
> 7za x master
> rm -rf master
> ll
total 8
drwx------ 10 root root 4096 Aug 16 22:57 fastdfs-master
drwx------  4 root root 4096 Aug 16 22:57 libfastcommon-master

 

3,开始安装 :

> cd libfastcommon-master
> ./make.sh
> ./make.sh install
> cd ../fastdfs-master/
> ./make.sh
> ./make.sh install 

 安装成功后,会出现以下目录或文件:

/etc/fdfs、/usr/include/fastcommon/、/usr/include/fastdfs/、/usr/bin/fdfs_*、/etc/init.d/fdfs_*

 

4,配置tracker:配置中的path需要自己创建

> cd /etc/fdfs/
> cp tracker.conf.sample tracker.conf
> vim tracker.conf
修改 base_path=/home/fastdfs/tracker

 

5,配置storage:配置中的path需要自己创建

> cp storage.conf.sample storage.conf
> vim storage.conf
修改:
base_path=/home/fastdfs/storage
store_path0=/home/fastdfs/storage_path0
tracker_server=内网IP:22122   // 注意此处不能使用127.0.0.1

 

 6,配置client:配置中的path需要自己创建

> cp client.conf.sample client.conf
> vim client.conf
修改:
base_path=/home/fastdfs/client
tracker_server=内网IP:22122   // 注意此处不能使用127.0.0.1

 

7,启动服务

> /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
> /usr/bin/fdfs_storaged /etc/fdfs/storage.conf

 

8,检查服务是否启动成功

> netstat -apn | grep fdfs
tcp    0   0 0.0.0.0:22122   0.0.0.0:*               LISTEN      7041/fdfs_trackerd  
tcp    0   0 0.0.0.0:23000   0.0.0.0:*               LISTEN      7119/fdfs_storaged  

 如果没有上面两个监听线程说明配置出现错误,错误日志在上面配置文件的path下log目录中

 

9,上传文件

> /usr/bin/fdfs_test /etc/fdfs/client.conf upload 文件路径

 

10,关闭进程

> killall fdfs_trackerd
> killall fdfs_storaged

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics