无法正常连接到Phoenix?

can not connect to Phoenix without exception?

我正在连接Phoenix,我遇到了一个奇怪的问题:在某些机器上我可以成功连接,但是我可以连接失败。但是失败的时候就是not throw any exception,就是blocked,所以我不知道这是哪里出了问题。我在哪里可以看到日志?

public class TestPhoenix {

    private static String driver = "org.apache.phoenix.jdbc.PhoenixDriver";
    private  static  String url = "jdbc:phoenix:192.168.1.91,192.168.1.50,192.168.1.60:2182";

    public static void main(String[] args)throws  Exception{

        Class.forName(driver);
        Properties properties = new Properties();

        if (driver.equals("org.apache.phoenix.jdbc.PhoenixDriver")){

            properties.setProperty("phoenix.functions.allowUserDefinedFunctions","true");

        }
        Connection conn = null;
        conn= DriverManager.getConnection(url, properties);

        System.out.println(conn);
    }

}

我运行 程序:

java -cp phoenix-4.5.1-HBase-1.1.jar:. TestPhoenix

好的,我找到问题了,我没有在某些机器上配置主机。我配置 zookeeper 如下:

server.1=data1:2888:3888
server.2=s5:2888:3888
server.3=s6:2888:3888

配置hadoop如下:

<property>
  <name>fs.defaultFS</name>
  <value>hdfs://s5.hadoop.ipin.com:20000</value>
  <description>The name of the default file system.  Either the
  literal string "local" or a host:port for DFS.</description>
</property>

问题是我没有在某些机器上添加 data1 s5 s6 s5.hadoop.ipin.com,所以我的程序总是试图获取这些主机,所以我配置/etc/hosts如下:

192.168.1.40 s5 s4.hadoop.ipin.com
192.168.1.50 s5 s5.hadoop.ipin.com
192.168.1.60 s6 s6.hadoop.ipin.com
192.168.1.91 data91 data1

然后就可以成功连接了