Hbase 2.0.0v Phoenix 5.0.0v Avatica-go-client 5.2.0v Nginx 1.8.1 with sticky module
3 Regionserver,3 Query Server , Nginx configed stick load balance for 3Query server
nginx conf nginx in 192.168.3.236
upstream phoenix_balance {
sticky expires=1m;
server 192.168.3.190:8765;
server 192.168.3.236:8765;
server 192.168.3.165:8765;
}
server {
listen 8766;
server_name localhost;
location / {
proxy_pass http://phoenix_balance/;
}
}
when i use Java to Read PQS its ok(connect one PQS, connect load balance url),
Class.forName("org.apache.phoenix.queryserver.client.Driver");
String url = "jdbc:phoenix:thin:url=http://192.168.3.236:8766;serialization=PROTOBUF";
conn = DriverManager.getConnection(url, prop);
i use go to connect one PQS its ok,connect to load balance url its failed,
code from avatica-go-client-reference
db, err := sql.Open("avatica", "http://192.168.3.236:8765") //ok
db, err := sql.Open("avatica", "http://192.168.3.236:8766") // faield ,driver:bad connection
rows, err := db.Query("SELECT COUNT(*) FROM test.test1")
Is there a problem with my nginx configuration?
I really hope someone can answer this question for me
I guess the reason is that the Avatica Go client does not support cookies. We can provide our own
baseClientthat supports cookies to the connector. See the demo below:Note: I don't have the environment to test the implementation. Please let me know if it does not work and I will look into it. Thank you!