JDBC 접속 관련 문의

35 views
Skip to first unread message

evelyn...@gmail.com

unread,
Oct 5, 2016, 4:02:51 AM10/5/16
to Apache Tajo 한국 사용자 그룹
이클립스에서 JDBC를 통해 타조 마스터에 접속을 시도하고 있습니다.

hosts 파일은 다음과 같습니다.
192.168.153.129 h1

하둡 버전 : 2.7.3
타조 버전 : tajo-0.11.3

tajo-site.xml은 다음과 같이 세팅 했습니다.
  <name>tajo.master.client-rpc.address</name>
  <value>h1:26002</value>

자바 소스에서 커넥션을 다음과 같이 설정하면 정상적으로 접속이 되고, 쿼리도 수행됩니다.
    Connection conn = DriverManager.getConnection("jdbc:tajo://localhost:26002/default");
OR
    Connection conn = DriverManager.getConnection("jdbc:tajo://127.0.0.1:26002/default");

그러나  다음과 같이 설정하면 
Exception in thread "main" java.sql.SQLException: Connection refused: /192.168.153.129:26002
에러가 발생합니다.
    Connection conn = DriverManager.getConnection("jdbc:tajo://192.168.153.129:26002/default");
OR
    Connection conn = DriverManager.getConnection("jdbc:tajo://h1:26002/default");

netstat 를 실행해 보면 다음과 같이 나옵니다.
h@h1:~/tajo$ netstat -ntl | grep 26002
tcp        0      0 127.0.0.1:26002         0.0.0.0:*               LISTEN     


tajo-site.xml 설정을 제대로 인식하지 못하는 것 같은데, 해결 방법을 알려주시면 감사하겠습니다.

evelyn...@gmail.com

unread,
Oct 6, 2016, 1:20:25 AM10/6/16
to Apache Tajo 한국 사용자 그룹

위 사항에 대하여 여러가지 테스트를 해보았습니다.
tajo-0.11.0, tajo-0.11.1, tajo-0.11.2, tajo-0.11.3 및 데스크탑 버전 모두 동일한 증상을 보입니다.

tajo-site.xml의 설정을 다음과 같이 26012 포트로 설정해도
  <name>tajo.master.client-rpc.address</name>
  <value>h1:26012</value>

h@h1:~$ netstat -ntl 명령을 실행하면 기존 포트를 리스닝하고 있습니다.
tcp        0      0 127.0.0.1:26002         0.0.0.0:*               LISTEN

getconf 명령을 실행하면 h1:26012 이 아닌 localhost:26002가 여전히 나옵니다.
h@h1:~/tajo$ ./bin/tajo getconf tajo.master.client-rpc.address
localhost:26002

제생각엔 tajo-site.xml 파일의 설정을 인식하지 못하는 것 같습니다.

위 사항에 대해 알려진 해결책이 있는가요? 

CharSyam

unread,
Oct 6, 2016, 1:34:28 AM10/6/16
to evelyn...@gmail.com, Apache Tajo 한국 사용자 그룹
어떻게 바꾸신건지 여쭤봐도 될까요?

2016년 10월 6일 오후 2:20, <evelyn...@gmail.com>님이 작성:

CharSyam

unread,
Oct 6, 2016, 1:36:34 AM10/6/16
to evelyn...@gmail.com, Apache Tajo 한국 사용자 그룹
혹시나 tajo-site.xml 의 위치라든지 이런게 안맞는게 아닌가 싶어서요.

2016년 10월 6일 오후 2:34, CharSyam <char...@gmail.com>님이 작성:
Reply all
Reply to author
Forward
0 new messages