Skip to content
This repository was archived by the owner on Jul 11, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ daozong <daozong@taobao.com>
dongpo <dongpo@taobao.com>
duanfei <duanfei@taobao.com>
duolong <duolong@taobao.com>
JiaYanwei <jiaywe@gmail.com>
jihe <jihe@taobao.com>
maoqi <maoqi@taobao.com>
nayan <nayan@taobao.com>
Expand Down
14 changes: 7 additions & 7 deletions DEPLOY.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
在成功[安装TFS][1]之后,在你的安装目录(默认为~/tfs_bin),包含几个子目录bin、conf、include、lib、logs、script等
在成功[安装TFS][1]之后,在你的安装目录(默认为~/tfs_bin),包含几个子目录bin、conf、include、lib、logs、scripts等

* bin:包含tfs所有的可执行程序文件,如nameserver(NS)、dataserver(DS)、tfstool。
* conf:包含tfs的配置文件,如NS的配置文件ns.conf,DS的配置文件ds.conf。
* include:包含TFS客户端库相关的头文件,应用程序使用TFS需要包含这些头文件。
* lib: 包含TFS客户端的静/动态库,应用程序使用TFS需要连接libtfsclient。
* logs:用于存储TFS运行过程中的日志。
* script:包含tfs常用的一些运维脚本,如stfs用于格式化DS, tfs启动/停止NS、DS。
* scripts:包含tfs常用的一些运维脚本,如stfs用于格式化DS, tfs启动/停止NS、DS。

本文介绍如何搭建TFS存储集群,以两台存储节点(4个DS进程)为例,部署拓扑图如下所示:

Expand Down Expand Up @@ -55,7 +55,7 @@
--------------

# cd ~/tfs_bin
# ./script/tfs start_ns 或者 ./bin/nameserver -f conf/ns.conf -d
# ./scripts/tfs start_ns 或者 ./bin/nameserver -f conf/ns.conf -d


如果没有提示错误,则NS就已经在后台开始运行了,可通过ps查看相应进行,或进入logs下,查看nameserver.log,如包含“nameserver running”则说明启动正常
Expand All @@ -80,9 +80,9 @@
在两台机器上,对数据目录进行format

# cd ~/tfs_bin
# ./script/stfs format 1 // 结果会在命令行提示
# ./script/stfs format 2
以上两条命令也可合并为 ./script/stfs format 1-2 或 ./script/stfs format 1,2
# ./scripts/stfs format 1 // 结果会在命令行提示
# ./scripts/stfs format 2
以上两条命令也可合并为 ./scripts/stfs format 1-2 或 ./scripts/stfs format 1,2
如果要清理格式化产生的数据,将上述命令中format换成clear即可


Expand All @@ -91,7 +91,7 @@
在两台机器上,启动DS服务

# cd ~/tfs_bin
# ./script/tfs start_ds 1-2 // 序号的使用与stfs类似,可通过","分隔序号,通过"-"指定范围序列
# ./scripts/tfs start_ds 1-2 // 序号的使用与stfs类似,可通过","分隔序号,通过"-"指定范围序列
或./bin/dataserver -f conf/ds.conf -i 1 -d (-i 指定序号)


Expand Down
16 changes: 9 additions & 7 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
* [下载源码安装][2]
* apt-get install libtool
* yum install libtool.x86_64
* realine 用于命令行编辑的库
* realine, ncurses 用于命令行编辑的库
* [下载源码安装][3]
* apt-get install libreadline-dev
* apt-get install libncurses5-dev
* yum install readline-devel.x86_64
* libz-devel 用于数据压缩/解压缩
* [下载源码安装][4]
Expand All @@ -20,11 +21,12 @@
* uuid-devel 用于生成全局唯一ID
* [下载源码安装][5]
* apt-get install uuid-dev
* yum install e2fsprogs-devel.x86_64
* yum install libuuid-devel.x86_64
* tcmalloc google的内存管理库
* [下载源码安装][6]
* apt-get install libgoogle-perftools-dev
* yum install google-perftools.x86_64
* yum install epel-release.noarch
* yum install gperftools.x86_64

安装tb-common-utils
-------------------
Expand All @@ -38,8 +40,8 @@ TFS使用tb-common-utils软件包,tb-common-utils包含淘宝使用的基础

下载源码

# svn co -r 18 http://code.taobao.org/svn/tb-common-utils/trunk tb-common-utils
注意: 这里不要checkout最新版本,version18以后的修改导致部分接口不能前向兼容。
# svn export -r 18 http://code.taobao.org/svn/tb-common-utils/trunk tb-common-utils
注意: 这里不要导出最新版本,version18以后的修改导致部分接口不能前向兼容。


编译安装
Expand All @@ -57,7 +59,7 @@ TFS开源用户大都只使用TFS的基本功能,所以这个版本我们默

下载源码

# svn co http://code.taobao.org/svn/tfs/branches/dev_for_outer_users tfs
# git clone https://github.com/alibaba/tfs.git


编译安装
Expand Down Expand Up @@ -114,4 +116,4 @@ TFS开源用户大都只使用TFS的基本功能,所以这个版本我们默
[4]: http://zlib.net/
[5]: http://sourceforge.net/projects/e2fsprogs/
[6]: http://code.google.com/p/gperftools/downloads/list
[7]: https://github.com/alibaba/tfs/blob/master/DEPLOY.md
[7]: DEPLOY.md
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ TFS is mainly designed for small files less than 1MB in size. It adopts flat str

Documents
---------
### [Install](https://github.com/alibaba/tfs/blob/master/INSTALL.md)
### [Deploy](https://github.com/alibaba/tfs/blob/master/DEPLOY.md)
### [Install](INSTALL.md)
### [Deploy](DEPLOY.md)

Licence
-------
Expand Down
6 changes: 3 additions & 3 deletions packages/tfs.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ Packager: taobao<opensource@taobao.com>
License: GPL
Vendor: TaoBao
Prefix:%{_prefix}
Source:%{NAME}-%{VERSION}.tar.gz
Source:%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-root

BuildRequires: t-csrd-tbnet-devel >= 1.0.6
BuildRequires: MySQL-devel-community = 5.1.48
BuildRequires: mysql-devel >= 5.1.48
BuildRequires: tair-devel >= 2.3
BuildRequires: boost-devel >= 1.3
BuildRequires: readline-devel
BuildRequires: ncurses-devel
BuildRequires: google-perftools >= 1.3
BuildRequires: gperftools >= 1.3

%define __os_install_post %{nil}
%define debug_package %{nil}
Expand Down
2 changes: 1 addition & 1 deletion src/nameserver/block_collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ namespace tfs
if (ret)
{
//check block version
if (__gnu_cxx::abs(info_.version_ - info.version_) <= VERSION_AGREED_MASK)//version agreed
if (std::abs(info_.version_ - info.version_) <= VERSION_AGREED_MASK)//version agreed
{
if (size >= SYSPARAM_NAMESERVER.max_replication_)
{
Expand Down
4 changes: 2 additions & 2 deletions src/nameserver/client_request_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ namespace tfs
if (TFS_SUCCESS == ret)
stat[0] = out.size();
else
stat[1] = __gnu_cxx::abs(out.size() - blocks.size());
stat[1] = std::abs(ssize_t(out.size() - blocks.size()));
}
else
{
if (TFS_SUCCESS == ret)
stat[2] = out.size();
else
stat[3] = __gnu_cxx::abs(out.size() - block_count);
stat[3] = std::abs((long long)(out.size() - block_count));
}
GFactory::get_stat_mgr().update_entry(GFactory::tfs_ns_stat_, stat);
return ret;
Expand Down