TT命令

★★★★★服务端
ttserver
Options feature the following.
-host name : specify the host name or the address of the server. By default, every network address is bound.
-port num : specify the port number. By default, it is 1978.
-thnum num : specify the number of worker threads. By default, it is 8.
-tout num : specify the timeout of each session in seconds. By default, no timeout is specified.
-dmn : work as a daemon process.
-pid path : output the process ID into the file.
-kl : kill the existing process if the process ID file is detected.
-log path : output log messages into the file.
-ld : log debug messages also.
-le : log error messages only.
-ulog path : specify the update log directory.
-ulim num : specify the limit size of each update log file.
-uas : use asynchronous I/O for the update log.
-sid num : specify the server ID.
-mhost name : specify the host name of the replication master server.
-mport num : specify the port number of the replication master server.
-rts path : specify the replication time stamp file.
-rcc : check consistency of replication.
-skel name : specify the name of the skeleton database library.
-mul num : specify the division number of the multiple database mechanism.
-ext path : specify the script language extension file.
-extpc name period : specify the function name and the calling period of a periodic command.
-mask expr : specify the names of forbidden commands.
-unmask expr : specify the names of allowed commands.

-----------------
ttservctl
start
stop
hup
----------------
ttulmgr
时间戳用date +%s察看 详细参考http://xok.la/2008/06/linux_date_transfer.html
date +%s得到时间戳,ps -ef|grep ttserver得到ttserver的sid
比如ttulmgr export -ts 1300000000 -sid 2065 /data/ttserver_cache/ulog/
ttulmgr export [-ts num ] [-sid num ] upath
Export the update log as TSV text data to the standard output.
ttulmgr import upath
Import TSV text data from the standard input to the update log.
Options feature the following.
-ts num : specify the beginning time stamp.
-sid num : specify the self server ID.

★★★★★★★★★客户端
tcrtest
tcrtest write [-port num ] [-cnum num ] [-tout num ] [-nr] [-rnd] host rnum
Store records with keys of 8 bytes. They change as `00000001', `00000002'...
tcrtest read [-port num ] [-cnum num ] [-tout num ] [-mul num ] [-rnd] host
Retrieve all records of the database above.
tcrtest remove [-port num ] [-cnum num ] [-tout num ] [-rnd] host
Remove all records of the database above.
tcrtest rcat [-port num ] [-cnum num ] [-tout num ] [-shl num ] [-dai|-dad] [-ext name] [-xlr|-xlg] host rnum
Store records with partway duplicated keys using concatenate mode.
tcrtest misc [-port num ] [-cnum num ] [-tout num ] host rnum
Perform miscellaneous test of various operations.
tcrtest wicked [-port num ] [-cnum num ] [-tout num ] host rnum
Perform updating operations of list and map selected at random.
tcrtest table [-port num ] [-cnum num ] [-tout num ] [-exp num ] host rnum
Perform miscellaneous test of the table extension.
Options feature the following.
-port num : specify the port number.
-cnum num : specify the number of connections.
-tout num : specify the timeout of each session in seconds.
-nr : use the function `tcrdbputnr' instead of `tcrdbput'.
-rnd : select keys at random.
-mul num : specify the number of records for the mget command.
-shl num : use `tcrdbputshl' and specify the width.
-dai : use `tcrdbaddint' instead of `tcrdbputcat'.
-dad : use `tcrdbadddouble' instead of `tcrdbputcat'.
-ext name : call a script language extension function.
-xlr : perform record locking.
-xlg : perform global locking.
-exp num : specify the lifetime of expiration test.

-----------------
tcrmttest
tcrmttest write [-port num ] [-tnum num ] [-nr] [-rnd] [-ext name] host rnum
Store records with keys of 8 bytes. They change as `00000001', `00000002'...
tcrmttest read [-port num ] [-tnum num ] [-mul num ] host
Retrieve all records of the database above.
tcrmttest remove [-port num ] [-tnum num ] host
Remove all records of the database above.
Options feature the following.
-port num : specify the port number.
-tnum num : specify the number of running threads.
-nr : use the function `tcrdbputnr' instead of `tcrdbput'.
-rnd : select keys at random.
-ext name : call a script language extension function.
-mul num : specify the number of records for the mget command.


-----
tcrmgr
tcrmgr inform [-port num ] [-st] host
Print miscellaneous information to the standard output.
tcrmgr put [-port num ] [-sx] [-sep chr ] [-dk|-dc|-dai|-dad] host key value
Store a record.
tcrmgr out [-port num ] [-sx] [-sep chr ] host key
Remove a record.
tcrmgr get [-port num ] [-sx] [-sep chr ] [-px] [-pz] host key
Print the value of a record.
tcrmgr mget [-port num ] [-sx] [-sep chr ] [-px] host [key ...]
Print keys and values of multiple records.
tcrmgr list [-port num ] [-sep chr ] [-m num ] [-pv] [-px] [-fm str ] host
Print keys of all records, separated by line feeds.
tcrmgr ext [-port num ] [-xlr|-xlg] [-sx] [-sep chr ] [-px] host func [key [value]]
Call a script language extension function.
tcrmgr sync [-port num ] host
Synchronize updated contents with the database file.
tcrmgr optimize [-port num ] host [params]
Optimize the database file.
tcrmgr vanish [-port num ] host
Remove all records.
tcrmgr copy [-port num ] host dpath
Copy the database file.
tcrmgr misc [-port num ] [-mnu] [-sx] [-sep chr ] [-px] host func [arg ...]
Call a versatile function for miscellaneous operations.
tcrmgr importtsv [-port num ] [-nr] [-sc] host [file]
Store records of TSV in each line of a file.
tcrmgr restore [-port num ] [-ts num ] [-rcc] host upath
Restore the database with update log.
tcrmgr setmst [-port num ] [-mport num ] [-ts num ] [-rcc] host [mhost ]
Set the replication master.
tcrmgr repl [-port num ] [-ts num ] [-sid num ] [-ph] host
Replicate the update log.
tcrmgr http [-ah name value] [-ih] url
Fetch the resource of a URL by HTTP.
tcrmgr version
Print the version information of Tokyo Tyrant.

Options feature the following.
-port num : specify the port number.-st : print miscellaneous status data.
-sx : input data is evaluated as a hexadecimal data string.
-sep chr : specify the separator of the input data.
-dk : use the function `tcrdbputkeep' instead of `tcrdbput'.
-dc : use the function `tcrdbputcat' instead of `tcrdbput'.
-dai : use the function `tcrdbaddint' instead of `tcrdbput'.
-dad : use the function `tcrdbadddouble' instead of `tcrdbput'.
-px : output data is converted into a hexadecimal data string.
-pz : do not append line feed at the end of the output.
-m num : specify the maximum number of the output.
-pv : print values of records also.
-fm str : specify the prefix of keys.
-xlr : perform record locking.
-xlg : perform global locking.
-mnu : omit the update log.
-nr : use the function `tcrdbputnr' instead of `tcrdbput'.
-sc : normalize keys as lower cases.
-mport num : specify the port number of the replication master.
-ts num : specify the beginning time stamp.
-rcc : check consistency of replication.
-sid num : specify the self server ID.
-ph : print human-readable data.
-ah name value : add a request header.
-ih : output response headers also.

猜你喜欢

转载自haoningabc.iteye.com/blog/1071540
TT