Akshay P
Akshay P

Reputation: 1

not able to create table in kudu using impala-shell

I was doing R&D on hadoop, hive, impala, and kudu. Installed HADOOP, HIVE, IMPALA, and KUDU servers.

I have configured --kudu_master_hosts=: in /etc/default -> impala file. i.e like below:

IMPALA_SERVER_ARGS=" \
    -log_dir=${IMPALA_LOG_DIR} \
    -catalog_service_host=${IMPALA_CATALOG_SERVICE_HOST} \
    -state_store_port=${IMPALA_STATE_STORE_PORT} \
    -use_statestore \
    -state_store_host=${IMPALA_STATE_STORE_HOST} \
    -be_port=${IMPALA_BACKEND_PORT}\
    --kudu_master_hosts=<HOST_NAME>:<PORT>"

============== Aftert that re-started the servers. Then using Kudu JAVA client, i was able to create table in kudu and able to insert some records.

Then mapped the same table in impala by doing this:

CREATE EXTERNAL TABLE my_mapping_table
STORED AS KUDU
TBLPROPERTIES (
  'kudu.table_name' = 'testT1'
);

successfully able to access the kudu table in impala and able to see all the records. Now i was trying to create a table in KUDU using impala-shell.

[<HOST_NAME>:21000] > CREATE TABLE my_first_table
                               > (
                               >   id BIGINT,
                               >   name STRING,
                               >   PRIMARY KEY(id)
                               > )
                               > STORED AS KUDU;

But this is giving a error i.e :

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

Can any one explain me what is happening or what is the solution for this error.

Read through KUDU documentation but not getting any ideas.

Regards, Akshay

Upvotes: 0

Views: 2064

Answers (1)

Akshay P
Akshay P

Reputation: 1

This query will help to create table i.e

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

This query will work only if, --kudu_master_hosts=: is set in /etc/default impala file. Else u have to give kudu_master_hosts in table properties. i.e

TBLPROPERTIES (
      'kudu.num_tablet_replicas' = '1',
       --kudu_master_hosts=<HOST_NAME>:<PORT>
    );

Upvotes: 0

Related Questions