TFS--淘宝文件系统Nginx模块安装篇
2015-03-07 13:23
429 查看
1.安装yajl
yajl是一个开源的JSON库
请到这里下载: http://lloyd.github.io/yajl/
yum install cmake -y
tar xvf lloyd-yajl-2.0.1-0-gf4b2b1a.tar.gz
cd lloyd-yajl-f4b2b1a/
./configure
make && make install
2.安装nginx/tengine
a) 安装pcre
wget http://sourceforge.net/projects/pcre/files/pcre/8.30/pcre-8.30.tar.gz/download
tar xvf pcre-8.30.tar.gz
cd pcre-8.30
./configure --prefix=/usr/local/pcre
make
make install
b)安装nginx/tengine
wget http://tengine.taobao.org/download/tengine-1.3.0.tar.gz
下载nginx-tfs模块:https://github.com/alibaba/nginx-tfs
unzip nginx-tfs-master.zip
tar xvf tengine-1.3.0.tar.gz
cd tengine-1.3.0
./configure --prefix=/usr/local/tengine --add-module=/root/nginx-tfs-master/ --with-pcre=/root/pcre-8.30/
make
make install
c)配置nginx
具体配置细节参看这里:https://github.com/alibaba/nginx-tfs/blob/master/ReadMe.markdown
vim /usr/local/tengine/conf/nginx.conf
添加以下内容:
http {
tfs_upstream tfs_ns {
server 10.0.0.62:8108;
type ns;
#rcs_zone name=tfs1 size=128M;
#rcs_interface eth0;
#rcs_heartbeat lock_file=/logs/lk.file interval=10s;
}
tfs_body_buffer_size 2m;
tfs_send_timeout 3s;
tfs_connect_timeout 3s;
tfs_read_timeout 3s;
server {
listen 7500;
server_name 192.168.10.218;
client_max_body_size 4096m;
tfs_keepalive max_cached=50 bucket_count=10;
tfs_log "pipe:/usr/sbin/cronolog -p 30min /usr/local/tengine/logs/cronolog/%Y/%m/%Y-%m-%d-%H-%M-tfs_access.log";
location / {
tfs_pass tfs://tfs_ns;
}
}
}
启动nginx
e) API接口测试
细节参看这里:https://github.com/alibaba/nginx-tfs/blob/master/TFS_RESTful_API.markdown
模拟POST上传一个图片:
curl --data-binary @/root/1000.jpg http://192.168.10.218:7500/v1/tfs?suffix=.jpg\&simple_name=0
返回信息:
{
"TFS_FILE_NAME": "T1iRJTByJT1RXrhCrK"
}
打开浏览器浏览:
yajl是一个开源的JSON库
请到这里下载: http://lloyd.github.io/yajl/
yum install cmake -y
tar xvf lloyd-yajl-2.0.1-0-gf4b2b1a.tar.gz
cd lloyd-yajl-f4b2b1a/
./configure
make && make install
2.安装nginx/tengine
a) 安装pcre
wget http://sourceforge.net/projects/pcre/files/pcre/8.30/pcre-8.30.tar.gz/download
tar xvf pcre-8.30.tar.gz
cd pcre-8.30
./configure --prefix=/usr/local/pcre
make
make install
b)安装nginx/tengine
wget http://tengine.taobao.org/download/tengine-1.3.0.tar.gz
下载nginx-tfs模块:https://github.com/alibaba/nginx-tfs
unzip nginx-tfs-master.zip
tar xvf tengine-1.3.0.tar.gz
cd tengine-1.3.0
./configure --prefix=/usr/local/tengine --add-module=/root/nginx-tfs-master/ --with-pcre=/root/pcre-8.30/
make
make install
c)配置nginx
具体配置细节参看这里:https://github.com/alibaba/nginx-tfs/blob/master/ReadMe.markdown
vim /usr/local/tengine/conf/nginx.conf
添加以下内容:
http {
tfs_upstream tfs_ns {
server 10.0.0.62:8108;
type ns;
#rcs_zone name=tfs1 size=128M;
#rcs_interface eth0;
#rcs_heartbeat lock_file=/logs/lk.file interval=10s;
}
tfs_body_buffer_size 2m;
tfs_send_timeout 3s;
tfs_connect_timeout 3s;
tfs_read_timeout 3s;
server {
listen 7500;
server_name 192.168.10.218;
client_max_body_size 4096m;
tfs_keepalive max_cached=50 bucket_count=10;
tfs_log "pipe:/usr/sbin/cronolog -p 30min /usr/local/tengine/logs/cronolog/%Y/%m/%Y-%m-%d-%H-%M-tfs_access.log";
location / {
tfs_pass tfs://tfs_ns;
}
}
}
启动nginx
e) API接口测试
细节参看这里:https://github.com/alibaba/nginx-tfs/blob/master/TFS_RESTful_API.markdown
模拟POST上传一个图片:
curl --data-binary @/root/1000.jpg http://192.168.10.218:7500/v1/tfs?suffix=.jpg\&simple_name=0
返回信息:
{
"TFS_FILE_NAME": "T1iRJTByJT1RXrhCrK"
}
打开浏览器浏览:
![](http://pic.dzsyxx.com/blog.aizhet.com/UploadFiles/2013/5/201305012112157909.png)
相关文章推荐
- 淘宝TFS文件系统配置
- Nginx+TFS模块安装笔记
- nginx1.10.3一键安装/系统内核优化/配置文件优化/https/日志切割
- 负载均衡器(nginx)在Linux系统中的安装配置文件相关修改
- 淘宝 TFS 文件系统/分布式文件系统
- 淘宝分布式文件存储系统:TFS
- 在CentOS7下安装TFS及Nginx-TFS(分布式文件系统TFS、Nginx-TFS模块、TFS RESTful API)
- 淘宝TFS文件系统配置(集群)
- 揭秘淘宝自主研发的文件系统—TFS(转)
- nginx 的第三方模块ngx_http_accesskey_module 来实现下载文件的防盗链步骤(linux系统下)
- 揭秘淘宝自主研发的文件系统――TFS
- 揭秘淘宝自主研发的文件系统:TFS
- 1.淘宝分布式文件系统tfs 在centos6系统上的安装
- CentOS系统下,如何安装 nginx_lua_module 模块 以及 echo-nginx-module 模块
- 淘宝研发的针对 nginx 的文件合并模块-Nginx_concat_module
- 《淘宝技术这十年》淘宝文件系统-tfs的产生
- linux系统下nginx安装目录和nginx.conf配置文件目录
- 分布式文件系统 - FastDFS 配置 Nginx 模块及上传测试
- fastdfs/nginx文件系统安装配置
- 揭秘淘宝自主研发的文件系统——TFS