工具使用

Shell工具采用子命令模式,进入子命令模式执行help后会显示帮助文档。(注:根据版本不同命令会有区别,以下为1.11.3版本)。对于每个子命令,也可以通过-h选项获取该子命令的帮助信息。

  1. Usage:
  2. help
  3. version
  4. cluster_info
  5. app <app_name> [-d|--detailed] [-o|--output file_name]
  6. app_disk <app_name> [-d|--detailed] [-o|--output file_name]
  7. ls [-a|-all] [-d|--detailed] [-j|--json_pretty]
  8. [-o|--output file_name][-s|--status all|available|creating|dropping|dropped]
  9. nodes [-d|--detailed] [-j|--json_pretty] [-r|--resolve_ip]
  10. [-u|--resource_usage][-o|--output file_name]
  11. [-s|--status all|alive|unalive]
  12. create <app_name> [-p|--partition_count num] [-r|--replica_count num]
  13. [-e|--envs k1=v1,k2=v2...]
  14. drop <app_name> [-r|--reserve_seconds num]
  15. recall <app_id> [new_app_name]
  16. set_meta_level <stopped|blind|freezed|steady|lively>
  17. get_meta_level
  18. balance <-g|--gpid appid.pidx> <-p|--type move_pri|copy_pri|copy_sec>
  19. <-f|--from from_address> <-t|--to to_address>
  20. propose [-f|--force] <-g|--gpid appid.pidx>
  21. <-p|--type ASSIGN_PRIMARY|ADD_SECONDARY|DOWNGRADE_TO_INACTIVE...>
  22. <-t|--target node_to_exec_command> <-n|--node node_to_be_affected>
  23. use [app_name]
  24. cc [cluster_name]
  25. escape_all [true|false]
  26. timeout [time_in_ms]
  27. hash <hash_key> <sort_key>
  28. set <hash_key> <sort_key> <value> [ttl_in_seconds]
  29. multi_set <hash_key> <sort_key> <value> [sort_key value...]
  30. get <hash_key> <sort_key>
  31. multi_get <hash_key> [sort_key...]
  32. multi_get_range <hash_key> <start_sort_key> <stop_sort_key>
  33. [-a|--start_inclusive true|false] [-b|--stop_inclusive true|false]
  34. [-s|--sort_key_filter_type anywhere|prefix|postfix]
  35. [-y|--sort_key_filter_pattern str] [-n|--max_count num]
  36. [-i|--no_value] [-r|--reverse]
  37. multi_get_sortkeys <hash_key>
  38. del <hash_key> <sort_key>
  39. multi_del <hash_key> <sort_key> [sort_key...]
  40. multi_del_range <hash_key> <start_sort_key> <stop_sort_key>
  41. [-a|--start_inclusive true|false] [-b|--stop_inclusive true|false]
  42. [-s|--sort_key_filter_type anywhere|prefix|postfix]
  43. [-y|--sort_key_filter_pattern str] [-o|--output file_name]
  44. [-i|--silent]
  45. incr <hash_key> <sort_key> [increment]
  46. check_and_set <hash_key> [-c|--check_sort_key str]
  47. [-t|--check_type not_exist|not_exist_or_empty|exist|not_empty]
  48. [match_anywhere|match_prefix|match_postfix]
  49. [bytes_less|bytes_less_or_equal|bytes_equal|bytes_greater_or_equal|bytes_greater]
  50. [int_less|int_less_or_equal|int_equal|int_greater_or_equal|int_greater]
  51. [-o|--check_operand str] [-s|--set_sort_key str] [-v|--set_value str]
  52. [-l|--set_value_ttl_seconds num] [-r|--return_check_value]
  53. check_and_mutate <hash_key> [-c|--check_sort_key str]
  54. [-t|--check_type not_exist|not_exist_or_empty|exist|not_empty]
  55. [match_anywhere|match_prefix|match_postfix]
  56. [bytes_less|bytes_less_or_equal|bytes_equal|bytes_greater_or_equal|bytes_greater]
  57. [int_less|int_less_or_equal|int_equal|int_greater_or_equal|int_greater]
  58. [-o|--check_operand str] [-r|--return_check_value]
  59. exist <hash_key> <sort_key>
  60. count <hash_key>
  61. ttl <hash_key> <sort_key>
  62. hash_scan <hash_key> <start_sort_key> <stop_sort_key>
  63. [-a|--start_inclusive true|false] [-b|--stop_inclusive true|false]
  64. [-s|--sort_key_filter_type anywhere|prefix|postfix]
  65. [-y|--sort_key_filter_pattern str]
  66. [-v|--value_filter_type anywhere|prefix|postfix|exact]
  67. [-z|--value_filter_pattern str] [-o|--output file_name]
  68. [-n|--max_count num] [-t|--timeout_ms num] [-d|--detailed]
  69. [-i|--no_value]
  70. full_scan [-h|--hash_key_filter_type anywhere|prefix|postfix]
  71. [-x|--hash_key_filter_pattern str]
  72. [-s|--sort_key_filter_type anywhere|prefix|postfix|exact]
  73. [-y|--sort_key_filter_pattern str]
  74. [-v|--value_filter_type anywhere|prefix|postfix|exact]
  75. [-z|--value_filter_pattern str] [-o|--output file_name]
  76. [-n|--max_count num] [-t|--timeout_ms num] [-d|--detailed]
  77. [-i|--no_value] [-p|--partition num]
  78. copy_data <-c|--target_cluster_name str> <-a|--target_app_name str>
  79. [-p|--partition num] [-b|--max_batch_count num] [-t|--timeout_ms num]
  80. [-h|--hash_key_filter_type anywhere|prefix|postfix]
  81. [-x|--hash_key_filter_pattern str]
  82. [-s|--sort_key_filter_type anywhere|prefix|postfix|exact]
  83. [-y|--sort_key_filter_pattern str]
  84. [-v|--value_filter_type anywhere|prefix|postfix|exact]
  85. [-z|--value_filter_pattern str] [-n|--no_overwrite] [-i|--no_value]
  86. [-g|--geo_data]
  87. clear_data [-p|--partition num] [-b|--max_batch_count num] [-t|--timeout_ms num]
  88. [-h|--hash_key_filter_type anywhere|prefix|postfix]
  89. [-x|--hash_key_filter_pattern str]
  90. [-s|--sort_key_filter_type anywhere|prefix|postfix|exact]
  91. [-y|--sort_key_filter_pattern str]
  92. [-v|--value_filter_type anywhere|prefix|postfix|exact]
  93. [-z|--value_filter_pattern str] [-f|--force]
  94. count_data [-p|--partition num] [-b|--max_batch_count num] [-t|--timeout_ms num]
  95. [-h|--hash_key_filter_type anywhere|prefix|postfix]
  96. [-x|--hash_key_filter_pattern str]
  97. [-s|--sort_key_filter_type anywhere|prefix|postfix|exact]
  98. [-y|--sort_key_filter_pattern str]
  99. [-v|--value_filter_type anywhere|prefix|postfix|exact]
  100. [-z|--value_filter_pattern str] [-d|--diff_hash_key] [-a|--stat_size]
  101. [-n|--top_count num] [-r|--run_seconds num]
  102. remote_command [-t all|meta-server|replica-server] [-l ip:port,ip:port...] <command>
  103. [arguments...]
  104. server_info [-t all|meta-server|replica-server] [-l ip:port,ip:port...]
  105. server_stat [-t all|meta-server|replica-server] [-l ip:port,ip:port...]
  106. app_stat [-a|--app_name str] [-q|--only_qps] [-u|--only_usage]
  107. [-o|--output file_name]
  108. flush_log [-t all|meta-server|replica-server] [-l ip:port,ip:port...]
  109. local_get <db_path> <hash_key> <sort_key>
  110. sst_dump [--command=check|scan|none|raw] <--file=data_dir_OR_sst_file>
  111. [--from=user_key] [--to=user_key] [--read_num=num] [--show_properties]
  112. mlog_dump <-i|--input log_dir> [-o|--output file_name] [-d|--detailed]
  113. recover [-f|--node_list_file file_name] [-s|--node_list_str str]
  114. [-w|--wait_seconds num] [-b|--skip_bad_nodes]
  115. [-l|--skip_lost_partitions] [-o|--output file_name]
  116. add_backup_policy <-p|--policy_name str> <-b|--backup_provider_type str>
  117. <-a|--app_ids 1,2...> <-i|--backup_interval_seconds num>
  118. <-s|--start_time hour:minute> <-c|--backup_history_cnt num>
  119. ls_backup_policy
  120. query_backup_policy <-p|--policy_name p1,p2...> [-b|--backup_info_cnt num]
  121. modify_backup_policy <-p|--policy_name str> [-a|--add_app 1,2...] [-r|--remove_app 1,2...]
  122. [-i|--backup_interval_seconds num] [-c|--backup_history_count num]
  123. [-s|--start_time hour:minute]
  124. disable_backup_policy <-p|--policy_name str>
  125. enable_backup_policy <-p|--policy_name str>
  126. restore_app <-c|--old_cluster_name str> <-p|--old_policy_name str>
  127. <-a|--old_app_name str> <-i|--old_app_id id>
  128. <-t|--timestamp/backup_id timestamp> <-b|--backup_provider_type str>
  129. [-n|--new_app_name str] [-s|--skip_bad_partition]
  130. query_restore_status <restore_app_id> [-d|--detailed]
  131. get_app_envs
  132. set_app_envs <key> <value> [key value...]
  133. del_app_envs <key> [key...]
  134. clear_app_envs [-a|--all] [-p|--prefix str]
  135. ddd_diagnose [-g|--gpid appid|appid.pidx] [-d|--diagnose] [-a|--auto_diagnose]
  136. [-s|--skip_prompt] [-o|--output file_name]
  137. exit

由于子命令很多,为了方便使用,我们根据功能不同进行分类。