Hi team, I have a question about using Pinot JDBC ...
# general
a
Hi team, I have a question about using Pinot JDBC to connect Pinot controller deployed in K8s.
Copy code
DriverManager.registerDriver(new PinotDriver());
//Connection conn = DriverManager.getConnection(DB_URL);

// will query DefaultTenant if not specified tenant here
Properties info = new Properties();
info.putIfAbsent("tenant", "TestBroker");
Connection conn = DriverManager.getConnection(DB_URL,info);
Statement statement = conn.createStatement();
but the following error returned:
Copy code
Caused by: java.net.UnknownHostException: pinot-broker-8.pinot-broker-headless.pinot.svc.cluster.local: nodename nor servname provided, or not known
	at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
	at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:929)
	at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1515)
	at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:848)
	at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1505)
	at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1364)
	at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1298)
	at java.base/java.net.InetAddress.getByName(InetAddress.java:1248)
	at com.ning.http.client.NameResolver$JdkNameResolver.resolve(NameResolver.java:28)
	at com.ning.http.client.providers.netty.request.NettyRequestSender.remoteAddress(NettyRequestSender.java:359)
	at com.ning.http.client.providers.netty.request.NettyRequestSender.connect(NettyRequestSender.java:370)
	at com.ning.http.client.providers.netty.request.NettyRequestSender.sendRequestWithNewChannel(NettyRequestSender.java:282)
	... 12 more
Is there any configuration to make sure controller can get the right accessible broker url?
I’m locally testing connecting to pinot controller deployed in K8s cluster.
p
Looks like you are trying to hit a private host address inside K8s. Not familiar with the pinot jdbc driver but if you were to call the controller/sql REST end point you can expose this though ingress/httpproxy and access outside of the k8s.
a
Thanks, Peter. DB_URL in my code is an exposed controller end point through ingress. But controller got and returned broker address accessible in K8s. I’ll try httpproxy to achieve it.