diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 1fec0e4..5e4b034 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -9,6 +9,7 @@ daozong dongpo duanfei duolong +JiaYanwei jihe maoqi nayan diff --git a/DEPLOY.md b/DEPLOY.md index dba5375..f3896dc 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -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进程)为例,部署拓扑图如下所示: @@ -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”则说明启动正常 @@ -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即可 @@ -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 指定序号) diff --git a/INSTALL.md b/INSTALL.md index d569633..d6857ed 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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] @@ -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 ------------------- @@ -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以后的修改导致部分接口不能前向兼容。 编译安装 @@ -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 编译安装 @@ -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 diff --git a/README.md b/README.md index 51327a0..fde5fc5 100644 --- a/README.md +++ b/README.md @@ -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 ------- diff --git a/packages/tfs.spec b/packages/tfs.spec index 41feb63..2d94039 100644 --- a/packages/tfs.spec +++ b/packages/tfs.spec @@ -8,16 +8,16 @@ Packager: taobao 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} diff --git a/src/nameserver/block_collect.cpp b/src/nameserver/block_collect.cpp index 53a66bf..c6e675b 100644 --- a/src/nameserver/block_collect.cpp +++ b/src/nameserver/block_collect.cpp @@ -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_) { diff --git a/src/nameserver/client_request_server.cpp b/src/nameserver/client_request_server.cpp index aad6ee5..92f4c37 100644 --- a/src/nameserver/client_request_server.cpp +++ b/src/nameserver/client_request_server.cpp @@ -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;