tfs三大管理工具操作示例

tfs三大管理工具操作示例

大家都知道tfs分布式存储安装方法,特别是v1版本的,v2版本的几乎没人讲,维护的文档更是少之又

少,tfs要是用好了确实是好东西,虽说开源了,但是很少人敢于尝试,主要是坑太多,坑太多是因为

需要了解的知识点太多,没有完善的文档,所以一直推广不起来,只能淘宝和与之相关的公司在用了

不多说了,能开源就不错啦,本篇只讲下tfs三大管理工具:tfstool ssm   admintool。

一,tfstool

[root@tfsdatasvr1 ~]# /usr/local/tfs/bin/tfstool -s 192.168.88.197:8100

[2016-10-25 09:42:18] DEBUG base_packet_factory.cpp:48 [140724280203104] pcode: 20, 

length: 28

[2016-10-25 09:42:18] DEBUG socket.cpp:113 [140724280203104] 打开, fd=4, 

addr=192.168.88.197:8100

[2016-10-25 09:42:18] INFO  transport.cpp:394 [140724280203104] ADDIOC, SOCK: 4, 

192.168.88.197:8100, RON: 1, WON: 1, IOCount:1, IOC:0x195ec90

[2016-10-25 09:42:18] DEBUG channelpool.cpp:57 [140724280203104] 分配的Channel总数:25 

(48)

[2016-10-25 09:42:18] INFO  tfs_session.cpp:812 [140724280203104] get cluster id from 

nameserver success. cluster id: 1

[2016-10-25 09:42:18] INFO  tfs_client_impl.cpp:584 [140724280203104] set cache time: 

1800

[2016-10-25 09:42:18] INFO  tfs_client_impl.cpp:565 [140724280203104] set cache items: 

1000

TFS> help

supported command:

@ file                                   batch run command in file

batch file                               batch run command in file

cd [directory]                           change work directory

cfi tfsname                              check file info

exit                                     exit

get tfsname localfile                    get file from tfs

help                                     show help info

hide tfsname [action]                    hide tfs file

listblock blockid                        list block server list

ls [directory]                           list directory content

lsf blockid [detail] [serverip:port]     list file list in block

put localfile [tfsname [suffix] [force]] put file to tfs

putl localfile [suffix]                  put file to tfs large file

pwd                                      print current directory

quit                                     quit

rename tfsname newsuffix                 rename tfs file to new suffix

rm tfsname                               remove tfs file

stat tfsname                             stat tfs file

statblk blockid [serverip:port]          stat a block

undel tfsname                            undelete tfs file

uput localfile [tfsname [suffix] [force]] unique put file to tfs

urm tfsname                              unique remove tfs file

vcblk serverip:port count                visit count block

TFS> listblock 1010                      #可以查看块数据放在那台服务器那块盘上

[2016-10-25 09:42:47] DEBUG base_packet_factory.cpp:48 [140724280203104] pcode: 2, 

length: 12

list block 1010 success.

------block: 1010, has 2 replicas------

block: 1010, (0)th server: 192.168.88.185:8202 

block: 1010, (1)th server: 192.168.88.184:8246 

TFS> lsf blockid

invalid blockid: 0

TFS> lsf blockid 1010

invalid blockid: 0

TFS> lsf 1010 

[2016-10-25 09:43:27] DEBUG base_packet_factory.cpp:48 [140724280203104] pcode: 2, 

length: 12

[2016-10-25 09:43:27] DEBUG base_packet_factory.cpp:48 [140724280203104] pcode: 14, 

length: 12

[2016-10-25 09:43:27] DEBUG socket.cpp:113 [140724280203104] 打开, fd=5, 

addr=192.168.88.185:8202

[2016-10-25 09:43:27] INFO  transport.cpp:394 [140724280203104] ADDIOC, SOCK: 5, 

192.168.88.185:8202, RON: 1, WON: 1, IOCount:2, IOC:0x197b570

[2016-10-25 09:43:27] DEBUG channelpool.cpp:57 [140724280203104] 分配的Channel总数:50 

(48)

FileList Size = 711

T1byxTByJT1RCvBVdK

T1byxTByhT1RCvBVdK

T1byxTByxT1RCvBVdK

T1byxTByZT1RCvBVdK

T1byxTBydT1RCvBVdK

T1byxTByDT1RCvBVdK

......

T1byxTBQh_1RCvBVdK

T1byxTBQx_1RCvBVdK

T1byxTBQZ_1RCvBVdK

T1byxTBQd_1RCvBVdK

T1byxTBQD_1RCvBVdK

T1byxTBQY_1RCvBVdK

Total : 711 files

TFS> stat T1byxTBQY_1RCvBVdK                         #可以查看具体文件状态

[2016-10-25 09:44:09] DEBUG tfs_session.cpp:376 [140724280203104] local cache miss, 

blockid: 1010

[2016-10-25 09:44:09] DEBUG base_packet_factory.cpp:48 [140724280203104] pcode: 2, 

length: 12

[2016-10-25 09:44:09] DEBUG local_key.cpp:58 [140724280203104] block_id: 1010, select ds 

1, 192.168.88.184:8246

[2016-10-25 09:44:09] DEBUG tfs_session.cpp:916 [140724280203104] local cache insert, 

blockid: 1010

[2016-10-25 09:44:09] DEBUG local_key.cpp:58 [140724280203104] block_id: 1010, select ds 

1, 192.168.88.184:8246

[2016-10-25 09:44:09] DEBUG tfs_file.cpp:118 [140724280203104] tfs open success: get 

block info success, blockid: 1010, fileid: 711, mode: 32, ret: 0

[2016-10-25 09:44:09] DEBUG local_key.cpp:58 [140724280203104] block_id: 1010, select ds 

1, 192.168.88.184:8246

[2016-10-25 09:44:09] DEBUG tfs_file.cpp:1451 [140724280203104] req stat file flag: 32

[2016-10-25 09:44:09] DEBUG base_packet_factory.cpp:48 [140724280203104] pcode: 17, 

length: 16

[2016-10-25 09:44:09] DEBUG socket.cpp:113 [140724280203104] 打开, fd=6, 

addr=192.168.88.184:8246

[2016-10-25 09:44:09] INFO  transport.cpp:394 [140724280203104] ADDIOC, SOCK: 6, 

192.168.88.184:8246, RON: 1, WON: 1, IOCount:3, IOC:0x197c420

[2016-10-25 09:44:09] DEBUG channelpool.cpp:57 [140724280203104] 分配的Channel总数:75 

(48)

[2016-10-25 09:44:09] DEBUG tfs_file.cpp:755 [140724280203104] do request success. 

client: 0x197b3c0, index: 0, phase: 6, ret: 0, blockid: 1010, fileid: 711, offset: 0, 

size: 0, crc: 0, inneroffset: 0, filenumber: 1, status: 1, rserver: 192.168.88.184:8246, 

wserver: 192.168.88.185:8202.

[2016-10-25 09:44:09] DEBUG tfs_file.cpp:588 [140724280203104] send packet. request size: 

1, successful request size: 1

[2016-10-25 09:44:09] DEBUG tfs_file.cpp:668 [140724280203104] get success response. 

client id: 0x197b3c0, request size: 1, get response size: 1

[2016-10-25 09:44:09] DEBUG tfs_file.cpp:803 [140724280203104] do response success. 

index: 0, phase: 6, ret: 0, blockid: 1010, fileid: 711, offset: 0, size: 0, crc: 0, 

inneroffset: 0, filenumber: 1, status: 4, rserver: 192.168.88.184:8246, wserver: 

192.168.88.185:8202.

[2016-10-25 09:44:09] DEBUG local_key.cpp:58 [140724280203104] block_id: 1010, select ds 

1, 192.168.88.184:8246

stat T1byxTBQY_1RCvBVdK success.

  FILE_NAME:     T1byxTBQY_1RCvBVdK

  BLOCK_ID:      1010

  FILE_ID:       711

  OFFSET:        74398237

  SIZE:          79661

  OCCUPY SIZE:   79697

  MODIFIED_TIME: 2016-07-08 18:

38:56

  CREATE_TIME:   2016-07-08 18:38:56

  STATUS:        0

  CRC:           1772954053

TFS> 

二,ssm

[root@tfsdatasvr1 ~]# /usr/local/tfs/bin/ssm -s 192.168.88.197:8100

show > help

supported command:

block [-n num] [-d block_id] [-s] [-c] [-i] [> filename]   show block info.

  -n the number of one fetch, default 1024, optional.

  -d block id, optional.

  -s print server list, optional.

  -c execute times, default 1, optional.

  -i interval time, default 2, optional.

  > redirect to file, optional.

server [-n num] [-r server_ip] [-b] [-w] [-m] [-c] [-i] [> filename]  show server info.

  -n the number of one fetch, default 1024, optional.

  -r server ip string, when parameter -n is invalid.

  -b print block list, optional.

  -w print writable block list, optional.

  -m print master block list, optional.

  -c execute times, optional.

  -i interval time, optional.

  > redirect to file, optional.

machine [-a] [-p] [-f] [-c] [-i] [> filename]   show machine info.

  -a print all info, optional.

  -p print part of infos, optional.

  -f print stat of certain infos, for monitor, optional.

  -c execute times, optional.

  -i interval

  > redirect to file, optional.

batch      exec cmd in batch

quit(q)      quit

exit      exit

help(h)      show help info

show > block -n 10 -d 1010             #查看block简单状态,admintool可以查看详细状态

  BLOCK_ID   VERSION    FILECOUNT  SIZE       DEL_FILE   DEL_SIZE   SEQ_NO  COPYS

      1010    711        711   74477934          0          0        712        2

show > machine -a                      #查看服务器状态

  SERVER_IP     NUMS UCAP  / TCAP =  UR  BLKCNT  LOAD TOTAL_WRITE  TOTAL_READ  LAST_WRITE 

 LAST_READ  MAX_WRITE   MAX_READ

--------------- ---- ------------------ -------- ---- -----------  ----------  ---------- 

 ---------  --------  ---------

  192.168.88.182    24 13.63T  36.67T  37%  178596  92   1.5M     0     1     0     0     

0    0     0   0     0   0     0

  192.168.88.183    24 13.63T  36.67T  37%  178608  27   1.5M     0     4     0     0     

0    0     0   0     0   0     0

......

show > server -n 10                   #查看磁盘状态

    SERVER_ADDR       UCAP  / TCAP =  UR  BLKCNT LOAD  TOTAL_WRITE  TOTAL_READ   

LAST_WRITE   LAST_READ   STARTUP_TIME

192.168.88.182:8200 581.17G   1.53T 37%   7439     73  62.2K     0      0     0  64.0K    

 0      0     0 2016-10-08 19:23:49

192.168.88.183:8200 581.56G   1.53T 37%   7444     23  62.4K     0      0     0  80.5K    

 0      0     0 2016-10-08 19:24:13

......

show > 

三,admintool

[root@tfsdatasvr1 ~]# /usr/local/tfs/bin/admintool -s 192.168.88.197:8100

[2016-10-25 09:54:40] DEBUG base_packet_factory.cpp:48 [140137745778528] pcode: 20, 

length: 28

[2016-10-25 09:54:40] DEBUG socket.cpp:113 [140137745778528] 打开, fd=4, 

addr=192.168.88.197:8100

[2016-10-25 09:54:40] INFO  transport.cpp:394 [140137745778528] ADDIOC, SOCK: 4, 

192.168.88.197:8100, RON: 1, WON: 1, IOCount:1, IOC:0xd5e5a0

[2016-10-25 09:54:40] DEBUG channelpool.cpp:57 [140137745778528] 分配的Channel总数:25 

(48)

[2016-10-25 09:54:40] INFO  tfs_session.cpp:812 [140137745778528] get cluster id from 

nameserver success. cluster id: 1

[2016-10-25 09:54:40] INFO  tfs_client_impl.cpp:584 [140137745778528] set cache time: 

1800

[2016-10-25 09:54:40] INFO  tfs_client_impl.cpp:565 [140137745778528] set cache items: 

1000

TFS > help

supported command:

aci dsip:port [startrow returnrow]       get dataserver access information, such as write 

or read times

addblk blockid                           add block

batch file                               batch run command in file

clearsystemtable                         clear system table 1--task, 2--write block, 4--

report block server, 8--delete block queue.

compactblk blockid                       compact block

dumpplan [nsip:port]                     dump plan server

exit                                     exit

getbpr                                   get balance percent ratio, float value, ex: 

1.000000 or 0.000005

help                                     show help info

listblk blockid                          list block server list

loadblk blockid dsip:port                build relationship between block and dataserver.

param name [set value [extravalue]]      set/get param value

quit                                     quit

removeblk blockid [serverip:port|flag]   remove block. flag: 1--remove block from both ds 

and ns, 2--just relieve relation from ns, default is 1.

replblk blockid type [[action] [src] [dest]] replicate block. type: 1--action, 2--src, 3

--dest, 4--action src, 5--action dest, 6--src dest, 7--action src dest

rotatelog                                rotate log file. it will move nameserver.log to 

nameserver.log.currenttime, and create new nameserver.log

setacl dsip:port type [v1 [v2]]          set dataserver access control. it can reject the 

request of certain ip or network segmenttype: 1--ACL_FLAG, 2--ACL_IPMASK, 3--ACL_IPLIST, 

4--ACL_CLEAR, 5--ACL_RELOAD

setbpr value1 value2                     set balance percent ratio. value1: integer part, 

0 or 1, value2 should be 0 if value1 is 1. value2: float part.

TFS > listblk 1010                #查看blcok在那些服务器那些磁盘上

[2016-10-25 09:54:57] DEBUG base_packet_factory.cpp:48 [140137745778528] pcode: 2, 

length: 12

list block 1010 success.

------block: 1010, has 2 replicas------

block: 1010, (0)th server: 192.168.88.185:8202 

block: 1010, (1)th server: 192.168.88.184:8246 

TFS > 

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏三杯水

Codis3.2集群HA高可用方案

Sentinel需要使用原生的Redis-server,版本要等于或高于Codis3.2里面的3.2.8版本, 这里是在Redis3.2.9的下配置测试的,另外...

952
来自专栏Kubernetes

kube-scheduler最佳配置

version: kubernetes 1.6.2 ##kube-scheduler Configuration 下面是我梳理的kube-scheduler的完...

3168
来自专栏A周立SpringCloud

Spring Cloud各组件配置属性总结

我们知道,Spring Cloud是个工具集,整合了各种组件。有的组件Spring Cloud是拿来主义,有的组件Spring Cloud又进行了一些增强(例如...

3605
来自专栏大大的微笑

ActiveMQ几个重要的配置文件

version:5.10,在5.8以后增加了levelDB的方式进行集群配置 ①.wrapper.conf: # -----------------------...

1.1K9
来自专栏dalaoyang

SpringBoot返回json和xml

有些情况接口需要返回的是xml数据,在springboot中并不需要每次都转换一下数据格式,只需做一些微调整即可。 新建一个springboot项目,加入依赖j...

3598
来自专栏后台及大数据开发

springBoot系列教程05:fastjson的集成、配置及使用

springBoot自带的json用着不太习惯,已习惯了fastJSON,下面介绍下fastjson的配置

1161
来自专栏乐沙弥的世界

MySQL PXC 5.7 invalid user‘@MYSQLD_USER@’

最近的PXC 5.7启动的时候收到一个无效用户的提示,invalid user ‘@MYSQLD_USER@’,这个问题还真是头一次碰到,而且这个MYSQLD_...

1273
来自专栏生信技能树

(15)基因组各种版本对应关系-生信菜鸟团博客2周年精选文章集

这是我的成名作: 首先是NCBI对应UCSC,对应ENSEMBL数据库: GRCh36 (hg18): ENSEMBL release_52. GRCh37 (...

4788
来自专栏玩转JavaEE

Spring Data Redis使用

上文我们介绍了Redis,在开发环境中,我们还有另外一个解决方案,那就是Spring Data Redis。本文我们就来看看这个东西。

2081
来自专栏乐沙弥的世界

PXC 5.7 WSREP_SST: [ERROR] xtrabackup_checkpoints missing

前阵子在配置好了PXC5.7之后,在启动其中的一个节点,碰到了 [ERROR] xtrabackup_checkpoints missing. xtraback...

1792

扫码关注云+社区

领取腾讯云代金券