kudu 1.4 单机安装后 运行java-sample

kudu java-sample: https://github.com/cloudera/kudu-examples/tree/master/java/java-sample
java -Djava.ext.dirs=./ -DkuduMaster=10.0.2.61:7051 whomm.canel2kudu.App
运行发现错误

1) 这个tls报错的问题 https://kudu.apache.org/docs/security.html
#[29810ms] delaying RPC due to Service unavailable: Master config (10.0.2.61:7051) has no leader. Exceptions received: org.apache.kudu.client.RecoverableException: [Peer master-10.0.2.61:7051] Connection disconnected)
配置新增:
–rpc-encryption=disabled
–rpc_authentication=disabled

2)副本默认3个的错误(因为单机安装)
#org.apache.kudu.client.NonRecoverableException: Not enough live tablet servers to create a table with the requested replication factor 3. 1 tablet servers are alive.
配置新增:
–unlock_unsafe_flags=true
–allow_unsafe_replication_factor=true
–default_num_replicas=1

最终配置:

[work@good ~]$ cat /etc/kudu/conf/tserver.gflagfile
# Do not modify these two lines. If you wish to change these variables,
# modify them in /etc/default/kudu-tserver.
--fromenv=rpc_bind_addresses
--fromenv=log_dir

--fs_wal_dir=/var/lib/kudu/tserver
--fs_data_dirs=/var/lib/kudu/tserver

--rpc-encryption=disabled
--rpc_authentication=disabled

--unlock_unsafe_flags=true
--allow_unsafe_replication_factor=true
--default_num_replicas=1

--rpc_negotiation_timeout_ms=9000
[work@good ~]$ cat /etc/kudu/conf/tserver.gflagfile
# Do not modify these two lines. If you wish to change these variables,
# modify them in /etc/default/kudu-tserver.
--fromenv=rpc_bind_addresses
--fromenv=log_dir

--fs_wal_dir=/var/lib/kudu/tserver
--fs_data_dirs=/var/lib/kudu/tserver

--rpc-encryption=disabled
--rpc_authentication=disabled

--unlock_unsafe_flags=true
--allow_unsafe_replication_factor=true
--default_num_replicas=1

--rpc_negotiation_timeout_ms=9000

这两个文件
/etc/kudu/conf/master.gflagfile
/etc/kudu/conf/tserver.gflagfile
都需要修改,然后重启

[root@good work]# service kudu-master restart
Stopped Kudu Master Server:                                [  OK  ]
Started Kudu Master Server (kudu-master):                  [  OK  ]
[root@good work]# service kudu-tserver restart
Stopped Kudu Tablet Server:                                [  OK  ]
Started Kudu Tablet Server (kudu-tserver):                 [  OK  ]

1 评论

  1. 我在Redhat6.5上部署了kudu环境,用java API sample去连接的时候,会报master config[XXX] has no leader,网上搜索了很久没有找到解决办法,无意间看到你的这篇博客,按照你的方法改了配置文件,重启服务,然后运行java代码,果然不再报错了,感谢!!!

发表评论

电子邮件地址不会被公开。 必填项已用*标注