impalaapache-kudu

NonRecoverableException: Not enough live tablet servers to create a table with the requested replication factor 3. 1 tablet servers are alive


I am trying to create a Kudu table using Impala-shell.

Query:

CREATE TABLE lol
(
  uname STRING,
  age INTEGER,
  PRIMARY KEY(uname)
)
STORED AS KUDU
TBLPROPERTIES (
'kudu.master_addresses' = '127.0.0.1'
);

CREATE TABLE t (k INT PRIMARY KEY) STORED AS KUDU
TBLPROPERTIES (
'kudu.master_addresses' = '127.0.0.1'
);

But I am getting error:

ERROR: ImpalaRuntimeException: Error creating Kudu table 'impala::default.t'
CAUSED BY: NonRecoverableException: Not enough live tablet servers to create a table with the requested replication factor 3. 1 tablet servers are alive.

Please suggest what should be done for this. I new to Kudu.

**


Solution

  • NonRecoverableException: Not enough live tablet servers to create a table with the requested replication factor 3 , this error is occurring because in query replication factor is not specified

    In KUDU default replication factor = 3.

    If you are running in query standalone cluster in that case only 1 tablet servers are alive in kudu's ( kudu tserver) for above query replication factor should be 1

    You can modife the replication factor as per the requirement by setting

    table_num_replicas (optional) - The number of replicas

    Query:

                             CREATE TABLE lol
                             (
                               uname STRING,
                               age INTEGER,
                               PRIMARY KEY(uname)
                             )
                             STORED AS KUDU
                             TBLPROPERTIES (
                             'kudu.master_addresses' = '127.0.0.1',
                             'kudu.num_tablet_replicas' = '1'
                            );
    

    In KUDU's for large a amount of data partition should be specified.

    Query:

    create table test 
    (
    id int not null,
    code string,
    primary key(id)
    ) 
    partition by hash partitions 8 
    stored as KUDU 
    TBLPROPERTIES ( 
    'kudu.master_addresses' = '127.0.0.1' ,
    'kudu.num_tablet_replicas' = '1'
    );
    

    For setting more property refer https://kudu.apache.org/docs/command_line_tools_reference.html