kudu命令详解

课程链接: http://edu.51cto.com/course/15174.html

kudu tablet

  • kudu tablet leader_step_down

    功能:强制使的leader step down(即强制使现在的leader节点变为follower节点)

kudu tablet leader_step_down 10.110.18.102:7051,10.110.18.184:7051,10.110.18.185:7051 08c7def983394ff3ac64b5292dfb5dea
  • kudu tablet change_config add_replica

    功能:为在tablet server:中添加一个备份,该备份类型为replica_type(VOTER/NON-VOTER:是否参加选举)

kudu tablet change_config add_replica  10.110.18.102:7051,10.110.18.184:7051,10.110.18.185:7051 08c7def983394ff3ac64b5292dfb5dea 1618d3a544e4463286ae91f78419f4c6

注意:经测试发现当类型为VOTER时,如果tablet备份为3,新增加一个备份后变为4,过一段时间(5分钟以后),会自动变为三份。 NON-VOTER有待在kudu1.5.0版本测试

  • kudu tablet change_config change_replica_type

    功能:修改ts_uuid中tablet_id的类型(VOTER/NON-VOTER)

  • kudu tablet change_config move_replica

    功能:将tablet_id从from_ts_uuid移动至to_ts_uuid

注意:kudu1.4.0不支持,kudu1.5.0版本开始支持,可负载均衡

  • kudu tablet change_config remove_replica

    功能:将tablet_id的备份从ts_uuid删除

kudu tablet change_config remove_replica 10.110.18.102:7051,10.110.18.184:7051,10.110.18.185:7051 08c7def983394ff3ac64b5292dfb5dea 1f854d396f54483ea9e5e537b6b63503

注意:经测试发现当tablet个数等于或小于备份数时,删除指定tablet不成功。即想要迁移tablet可以先迁移到的目标机器上新增tablet 然后再删除源tablet


  • kudu tserver set_flag [-force]

    功能:设置指定flag

  • kudu tserver status

    查看指定tserver_address的状态

  • kudu tserver timestamp

    功能:获取tserver_address当前的时间戳

  • kudu tserver list [-columns=] [-format=] [-timeout_ms=]

    功能:获取集群中的tablet server

  • kudu wal dump [-print_entries=] [-noprint_meta] [-truncate_data=]

功能:显示指定path下的wal日志,path必须指定具体文件

kudu wal dump /data/kudu/tserver_data/wals/43c10f7d81144e3287a3f80aa0e0f684/wal-000000001

该操作会列数具体的wal内容,包括针对该tablet的具体操作


  • kudu table delete

    功能:删除table_name表

  • kudu table list [-list_tablets]

    功能:列举所有表以及tablets


  • kudu remote_replica check

    功能:检查tserver_address的状态

  • kudu remote_replica copy [-force_copy]

kudu remote_replica copy bd556b05db4f4446b0223163223ffce6  10.110.18.185:7050  10.110.18.176:7050 -force_copy

验证失败,错误如下: W1101 10:22:27.238106 31485 tool_action_remote_replica.cc:333] NOTE: this copy may happen asynchronously and may timeout if the tablet size is large. Watch the logs on the target tablet server for indication of progress.

  • kudu remote_replica delete

功能:删除指定tserver_address的 tablet_id

kudu remote_replica delete 10.110.18.184:7050  bd556b05db4f4446b0223163223ffce6  movetablet
  • kudu remote_replica dump

    功能:获取指定tserver_address指定tablet_id中的数据

kudu remote_replica dump 10.110.18.184:7050 bd556b05db4f4446b0223163223ffce6

结果如下: (int64 RowID=9, int64 ID=1, string NAME="kudu-content-1") (int64 RowID=5, int64 ID=1, string NAME="kudu-content-1")


  • kudu master set_flag master_address flag value [-force]

    功能:为master_address节点设置参数

  • kudu master status

    功能:查看master_address信息

  • kudu master timestamp

    功能:获取master_address的时间戳

  • kudu master list [-columns=] [-format=] [-timeout_ms=]

    功能:列举集群的master信息


  • kudu local_replica copy_from_remote [-fs_wal_dir=

    ] [-fs_data_dirs=]

    功能:从source拷贝名为tablet_id到本地 [-fs_wal_dir=] [-fs_data_dirs=]

kudu local_replica copy_from_remote 8a94ebf9a7ec487dbcde74a2937ffc72 10.110.18.185:7050  -fs_wal_dir=/data/kudu/tserver_data  -fs_data_dirs=/data/kudu/tserver_data 

测试出现异常,如下: I1102 09:29:36.918705 13489 fs_manager.cc:263] Time spent opening block manager: real 0.000s user 0.000s sys 0.000s IO error: Could not lock /data/kudu/tserver_data/data/block_manager_instance: Could not lock /data/kudu/tserver_data/data/block_manager_instance: lock /data/kudu/tserver_data/data/block_manager_instance: Resource temporarily unavailable (error 11)

  • kudu local_replica data_size [-fs_wal_dir=] [-fs_data_dirs=] [-format=]
           功能:获取 [-fs_wal_dir=] [-fs_data_dirs=]下的tablets
kudu local_replica data_size ea3dbfb02bf6411aae64b63247c2d7a9  -fs_wal_dir=/data/kudu/tserver_wal -fs_data_dirs=/data/kudu/tserver_data  -format=json
  • kudu local_replica list [-fs_wal_dir=

    ] [-fs_data_dirs=] [-list_detail]

    功能:获取 [-fs_wal_dir=

    ] [-fs_data_dirs=]下的tablets

  • kudu local_replica cmeta print_replica_uuids [-fs_wal_dir=

    ] [-fs_data_dirs=]

功能:获取[-fs_wal_dir=

] [-fs_data_dirs=] 下 所在节点的uuid

  • kudu local_replica cmeta set_term [-fs_wal_dir=

    ] [-fs_data_dirs=]

  • kudu local_replica cmeta rewrite_raft_config …​ [-fs_wal_dir=

    ] [-fs_data_dirs=]

  • kudu local_replica dump block_ids [-fs_wal_dir=

    ] [-fs_data_dirs=]

    功能:获取[-fs_wal_dir=

    ] [-fs_data_dirs=]下对应的Disk Rowset的block_id列表

kudu local_replica dump block_ids b7de17353521401b95576999a0e53b1c    -fs_wal_dir=/data/kudu/tserver_data  -fs_data_dirs=/data/kudu/tserver_data
  • kudu local_replica dump meta [-fs_wal_dir=

    ] [-fs_data_dirs=]

    功能:获取[-fs_wal_dir=

    ] [-fs_data_dirs=] 下的元数据信息,包括各rowset的block id, column id等。

kudu local_replica dump meta b7de17353521401b95576999a0e53b1c   -fs_wal_dir=/data/kudu/tserver_data  -fs_data_dirs=/data/kudu/tserver_data
  • kudu local_replica dump rowset

    功能:获取[-fs_wal_dir=

    ] [-fs_data_dirs=]中对应[-dump_data]的rowset的内容 信息

kudu local_replica dump block_ids b7de17353521401b95576999a0e53b1c    -fs_wal_dir=/data/kudu/tserver_data  -fs_data_dirs=/data/kudu/tserver_data   
  • kudu local_replica dump wals [-fs_wal_dir=

    ] [-fs_data_dirs=] [-print_entries=] [-noprint_meta] [-truncate_data=]

    功能:获取[-fs_wal_dir=

    ] [-fs_data_dirs=]中的的wal信息

kudu local_replica dump wals b7de17353521401b95576999a0e53b1c -fs_wal_dir=/data/kudu/tserver_data  -fs_data_dirs=/data/kudu/tserver_data
  • kudu fs check [-fs_wal_dir=

    ] [-fs_data_dirs=] [-repair]

    **功能:检测[-fs_wal_dir=

    ] [-fs_data_dirs=]的文件系统,-repair为修复该fs的问题,需要修复时需要把对应的kudu-master或kudu-tserver stop,不然会出现:Could not lock ****: Resource temporarily unavailable (error 11)

kudu fs check -fs_wal_dir=/data/kudu/tserver_data  -fs_data_dirs=/data/kudu/tserver_data 
  • kudu fs format [-fs_wal_dir=

    ] [-fs_data_dirs=] [-uuid=]

    功能:产生新文件系统[-fs_wal_dir=

    ] [-fs_data_dirs=],可以指定-uuid=uuid,不指定会自动生成一个。

     ```
     [root@kudu-102 bin]# ./kudu fs format -fs_wal_dir=/data/kudu/ts_datas -fs_data_dirs=/data/kudu/ts_datas -uuid=b69cdeb85db14251afec1a952c1be9e9
     I1103 02:24:16.666724 23882 env_posix.cc:1460] Not raising process file limit of 50000; it is already as high as it can go
     I1103 02:24:16.666936 23882 file_cache.cc:463] Constructed file cache lbm with capacity 20000
     I1103 02:24:16.671298 23882 fs_manager.cc:377] Generated new instance metadata in path /data/kudu/ts_datas/instance:
     uuid: "b69cdeb85db14251afec1a952c1be9e9"
     format_stamp: "Formatted at 2017-11-03 02:24:16 on kudu-102"
     ```
    
    • 数据目录下必须为空的kudu文件系统,否则无法产生新分系统
  • kudu fs dump block [-fs_wal_dir=

    ] [-fs_data_dirs=]

    功能:输出[-fs_wal_dir=

    ] [-fs_data_dirs=]下的二进制内容,不会对内容进行解析

    • 该命令kudu1.4.0未支持,kudu1.5.0有待验证
  • kudu fs dump cfile [-fs_wal_dir=

    ] [-fs_data_dirs=] [-noprint_meta] [-noprint_rows]

    功能:输出的cfile的文件内容,这解释了一个cfile格式的块的内容,并输出解码的行数据。

kudu fs dump cfile 8 -fs_wal_dir=/data/kudu/tserver_data  -fs_data_dirs=/data/kudu/tserver_data
  • kudu fs dump tree [-fs_wal_dir=

    ] [-fs_data_dirs=]

    功能:输出[-fs_wal_dir=

    ] [-fs_data_dirs=]的文件目录结构

  • kudu fs dump uuid [-fs_wal_dir=

    ] [-fs_data_dirs=]

    功能:获取[-fs_wal_dir=

    ] [-fs_data_dirs=] 的uuid


  • kudu perf loadgen [-buffer_flush_watermark_pct=] [-buffer_size_bytes=] [-buffers_num=] [-flush_per_n_rows=] [-keep_auto_table] [-num_rows_per_thread=] [-num_threads=] [-run_scan] [-seq_start=] [-show_first_n_errors=] [-string_fixed=] [-string_len=] [-table_name=] [-table_num_buckets=] [-table_num_replicas=] [-use_random]

    • kudu1.4.0不支持

你可能感兴趣的:(kudu)