1. Start a ttserver for testing.
Note that all paths used are absolute paths.
Ttserver-host 192.168.0.100-port 20000-thnum 4-DMN-ulim 1024 M-ulog $ (PWD)/ulog/-log $ (PWD)/temp/test. log-pid $ (PWD)/temp/test. PID-Sid 9 $ (PWD)/temp/test_data.tch # bnum = 1000 # rcnum = 0 # xmsiz = 0 m
2. View server statistics
Tcrmgr inform-port 20000-ST 192.168.0.100
3. Write Data
Tcrmgr put-port 20000 192.168.0.100 test1 value1
4. Read data
Tcrmgr get-port 20000 192.168.0.100 test1
5. delete data
Tcrmgr out-port 20000 192.168.0.100 test1
6. View All keys
Tcrmgr list-port 20000 192.168.0.100
7. Back up data
Note: The path is the absolute path on the server. Otherwise, "./tcrmgr: Error: 9999: Miscellaneous error" is displayed"
Tcrmgr copy-port 20000 192.168.0.100 $ (PWD)/temp/test2.tch
8. log export (printed on the screen, in hexadecimal string format)
Note: The commands are different.
Note: The Directory is the absolute path of ulog on the server.
Ttulmgr export $ (PWD)/ulog/
9. Synchronize the memory data to the disk (do not understand what is special, it may be that when ttserver uses the-UAS parameter to asynchronously write logs)
Tcrmgr sync-port 20000 192.168.0.100
10. Data Import
Note: files in TSV format are separated by tab, for example, Test2 \ tvalue2 \ n.
Note: The path is a local path, so it does not need to be an absolute path.
Tcrmgr importtsv-port 20000 192.168.0.100 temp/2.tsv
11. Restore data through ulog logs
Note: The path is the absolute path on the server.
Tcrmgr restore-port 20000 192.168.0.100 $ (PWD)/old_ulog/
12. Print the Update log (pending, always displaying the log)
It may be used to view operations on ttserver in real time, which is equivalent to tail-f.
Tcrmgr repl-port 20000-pH 192.168.0.100
13. next experiment: Start a ttserver with the replication function. The ttserver started earlier is the master.
Ttserver-host 192.168.0.100-port 20001-mhost 192.168.0.100-mport 20000-RCC-RTS $ (PWD)/temp_1/test_1.rts-thnum 4-DMN-ulim 1024 M-ulog $ (PWD) /temp_1/-log $ (PWD)/temp_1/test_1.log-pid $ (PWD)/temp_1/test_1.pid-SID 10 $ (PWD) /temp_1/test_1.tch # bnum = 1000 # rcnum = 0 # xmsiz = 0 m
14. Start another common ttserver, which is not related to other servers.
Ttserver-host 192.168.0.100-port 20002-thnum 4-DMN-ulim 1024 M-ulog $ (PWD)/ulog_2/-log $ (PWD) /temp_2/test_2.log-pid $ (PWD)/temp_2/test_2.pid-Sid 11 $ (PWD)/temp_2/test_data_2.tch # bnum = 1000 # rcnum = 0 # xmsiz = 0 m
15. Modify the master of a ttserver
Tcrmgr setmst-port 20001-mport 20002 192.168.0.100 192.168.0.100
Note: Only the ttserver started in replication mode can replicate data from the new database after the master is modified.
Note: Each ttserver can have only one master. After modification, data cannot be copied from the previous master.