Updated Home (markdown)
parent
cde50037f9
commit
646e906dff
82
Home.md
82
Home.md
|
|
@ -1,2 +1,80 @@
|
|||
Welcome to the fastdfs wiki!
|
||||
测试有权限
|
||||
[TOC]
|
||||
# 环境准备
|
||||
## 目录准备
|
||||
|说明|位置|
|
||||
|-|-|
|
||||
|安装包|/usr/local/src|
|
||||
|tracker跟踪服务器数据|/fastdfs/tracker|
|
||||
|storage存储服务器数据|/fastdfs/storage|
|
||||
```shell
|
||||
mkdir -p /fastdfs/tracker #创建跟踪服务器数据目录
|
||||
mkdir -p /fastdfs/storage #创建存储服务器数据目录
|
||||
cd /usr/local/src #切换到安装目录准备安装包
|
||||
# 准备编译环境
|
||||
yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel -y
|
||||
```
|
||||
## 安装libfatscommon
|
||||
```shell
|
||||
git clone https://github.com/happyfish100/libfastcommon.git --depth 1
|
||||
cd libfastcommon/
|
||||
./make.sh
|
||||
./make.sh install
|
||||
```
|
||||
## 安装FastDFS
|
||||
```shell
|
||||
git clone https://github.com/happyfish100/fastdfs.git --depth 1
|
||||
cd fastdfs/
|
||||
./make.sh
|
||||
./make.sh install
|
||||
#配置文件准备
|
||||
cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
|
||||
cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
|
||||
cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf #客户端文件,测试用
|
||||
```
|
||||
## 安装fastdfs-nginx-module
|
||||
```shell
|
||||
git clone https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1
|
||||
```
|
||||
## 安装nginx
|
||||
```shell
|
||||
wget http://nginx.org/download/nginx-1.12.2.tar.gz
|
||||
tar -zxvf nginx-1.12.2.tar.gz
|
||||
cd nginx-1.12.2/
|
||||
#添加fastdfs-nginx-module模块
|
||||
./configure --prefix=/opt/nginx/ --add-module=/usr/local/src/fastdfs-nginx-module/src/
|
||||
make
|
||||
make install
|
||||
```
|
||||
# 单机部署
|
||||
## tracker配置
|
||||
```shell
|
||||
vim /etc/fdfs/tracker.conf
|
||||
#需要修改的内容如下
|
||||
port=22122 # tracker服务器端口(默认22122,一般不修改)
|
||||
base_path=/fastdfs/tracker # 存储日志和数据的根目录
|
||||
#保存后启动
|
||||
/etc/init.d/fdfs_trackerd start #启动tracker服务
|
||||
chkconfig fdfs_trackerd on #自启动tracker服务
|
||||
```
|
||||
## storage配置
|
||||
```shell
|
||||
vim /etc/fdfs/storage.conf
|
||||
#需要修改的内容如下
|
||||
port=23000 # storage服务端口(默认23000,一般不修改)
|
||||
base_path=/fastdfs/storage # 数据和日志文件存储根目录
|
||||
store_path0=/fastdfs/storage # 第一个存储目录
|
||||
tracker_server=192.168.0.xxx:22122 # tracker服务器IP和端口
|
||||
http.server_port=8888 # http访问文件的端口(默认888,一般不修改)
|
||||
#保存后启动
|
||||
/etc/init.d/fdfs_storaged start #启动storage服务
|
||||
chkconfig fdfs_storaged on #自启动storage服务
|
||||
```
|
||||
## client测试
|
||||
```shell
|
||||
vim /etc/fdfs/client.conf
|
||||
#需要修改的内容如下
|
||||
base_path=/fastdfs/tracker
|
||||
tracker_server=192.168.1.xxx:22122 #tracker IP地址
|
||||
#保存后测试
|
||||
fdfs_upload_file /etc/fdfs/client.conf /usr/local/src/nginx-1.12.2.tar.gz #返回ID表示成功
|
||||
```
|
||||
Loading…
Reference in New Issue