CDH安装SQOOP错误:Caused by: java.sql.SQLException: No suitable driver found for jdbc:derby:/var/lib/sqoo

在使用ClouderaManager安装sqoop时出现:

org.apache.sqoop.common.SqoopException: JDBCREPO_0007:Unable to lease link
	at org.apache.sqoop.repository.JdbcRepositoryTransaction.begin(JdbcRepositoryTransaction.java:64)
	at org.apache.sqoop.repository.JdbcRepository.doWithConnection(JdbcRepository.java:87)
	at org.apache.sqoop.repository.JdbcRepository.doWithConnection(JdbcRepository.java:63)
	at org.apache.sqoop.repository.JdbcRepository.isRepositorySuitableForUse(JdbcRepository.java:144)
	at org.apache.sqoop.repository.RepositoryManager.initialize(RepositoryManager.java:129)
	at org.apache.sqoop.repository.RepositoryManager.initialize(RepositoryManager.java:78)
	at org.apache.sqoop.core.SqoopServer.initialize(SqoopServer.java:56)
	at org.apache.sqoop.server.ServerInitializer.contextInitialized(ServerInitializer.java:41)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:802)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:944)
	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:779)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:505)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:325)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1068)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:759)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:derby:/var/lib/sqoop2/repository/db;create=true
	at java.sql.DriverManager.getConnection(DriverManager.java:596)
	at java.sql.DriverManager.getConnection(DriverManager.java:187)
	at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:78)
	at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1148)
	at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
	at org.apache.sqoop.repository.JdbcRepositoryTransaction.begin(JdbcRepositoryTransaction.java:62)
	... 31 more

解决方法:

1. 下载db-derby-10.11.1.1-bin.tar.gz解压缩之后将derby.jar和derbyclient.jar放入/var/lib/sqoop2下

2. 将derby.jar拷贝到/opt/cloudera/parcels/CDH-5.4.7-1.cdh5.4.7.p0.3/jars目录下

3. 删除derby-10.8.2.2.jar -> ../../../../../../jars/derby-10.8.2.2.jar的软连接:rm -f derby-10.8.2.2.jar

4. 在/opt/cloudera/parcels/CDH-5.3.0-1.cdh5.3.0.p0.30/lib/sqoop2/webapps/sqoop/WEB-INF/lib/目录下建立/opt/cloudera/parcels/CDH-5.4.7-1.cdh5.4.7.p0.3/jars/derby.jar的软连接:

ln -s ../../../../../../jars/derby.jar derby.jar

你可能感兴趣的:(CDH)