1

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.

**

tk421
  • 5,775
  • 6
  • 23
  • 34

2 Answers2

2

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

0

In addition to the answer you can also set the "Default Number of Replicas" in Kudu's configuration to 1. this way you avoid the hassle of setting this in every command you types. You can access this configuration from Cloudera Manager --> Kudu --> Configuration then search for "Default Number of Replicas" you might need to suppress the setting to avoid the warning message, because the recommended setting is 3.