Sqoop

mysql 커넥터 관련 버그

유나아빠 2016. 11. 22. 12:57

새로운 하둡 환경을 구축하고 sqoop으로 mysql의 데이터를 하둡으로 옮기는 배치처리중 아래와 같은 에러가 발생


ERROR manager.SqlManager: Error reading from database: java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@689604d9 is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries.

java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@689604d9 is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries.


구글링을 해보니 버그리스트에 들어있었다.

https://issues.apache.org/jira/browse/SQOOP-1400


새로운 하둡환경에 mysql 커넥터를 yum으로 설치했는데 그게 화근이었다.


yum install mysql-connector-java


yum으로 설치하면 디폴트 mysql-connector-java-5.1.17.jar 이 설치되는데

이 놈이 sqoop하고 상성이 잘 안맞는 모양이다.


해결책으로는 아래 링크의 내용을 참고로 sqoop 옵션에 --driver com.mysql.jdbc.Driver를 추가

그리고 mysql-connector-java-5.1.17.jar 이것도 최신 커넥터로 재설치 했다.


http://stackoverflow.com/questions/26375269/sqoop-error-manager-sqlmanager-error-reading-from-database-java-sql-sqlexcept