在VB

时间:2017-12-03 12:48:49

标签: hbase apache-zookeeper

我在虚拟盒上的Ubuntu中安装了我的hbase。在Windows中,我用java编写了一个程序来检查表是否存在?

@Test
public void checkTableExists() throws IOException
{
    Configuration conf = HBaseConfiguration.create();
    conf.set("hbase.zookeeper.quorum", "192.168.1.3");
    conf.set("hbase.zookeeper.clientPort.property", "2181");
    conf.set("hbse.client.retries.number", "3");
    conf.set("zookeeper.recovery.retry", "2");

    Connection connection = ConnectionFactory.createConnection(conf); 

    Admin admin = connection.getAdmin();

    System.out.println(admin.tableExists(TableName.valueOf("test1")));

    admin.close();
    connection.close();

}

但我没有得到输出。相反,我收到了这个错误:

17:52:05.661 [hconnection-0x5e2c3d18-shared - pool1-t1] DEBUG org.apache.hadoop.hbase.ipc.RpcClientImpl - 对服务ClientService使用SIMPLE身份验证,sasl = false 17:52:05.662 [hconnection-0x5e2c3d18-shared - pool1-t1] DEBUG org.apache.hadoop.hbase.ipc.RpcClientImpl - 连接到localhost / 127.0.0.1:35899 17:52:06.668 [hconnection-0x5e2c3d18-shared - pool1-t1] INFO org.apache.hadoop.hbase.client.RpcRetryingCaller - 调用异常,tries = 11,retries = 35,started = 58956 ms前,取消= false ,msg =拒绝连接:没有进一步的信息行' test1 ,,'在桌子上' hbase:meta' at region = hbase:meta ,, 1.1588230740,hostname = localhost,35899,1512303024113,seqNum = 0 17:52:06.670 [main] DEBUG org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate - 使用键[[MergedContextConfiguration @ 71bbf57e testClass = HbaseApplicationTest,locations =' {}',类从缓存中检索ApplicationContext =' {}',contextInitializerClasses =' []',activeProfiles =' {}',propertySourceLocations =' {}' ,propertySourceProperties =' {}',contextCustomizers = set [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@6a41eaa2,org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0,org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@13805618],contextLoader =' org.springframework.test.context .support.DelegatingSmartContextLoader',parent = [null]]] 17:52:06.670 [main] DEBUG org.springframework.test.context.cache - Spring测试ApplicationContext缓存统计信息:[DefaultContextCache @ 2e4b8173 size = 1,maxSize = 32,parentContextCount = 0,hitCount = 2,missCount = 1] 17:52:06.671 [main] DEBUG org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate - 从密钥[[MergedContextConfiguration @ 71bbf57e testClass = HbaseApplicationTest,locations =' {}',类中从缓存中检索到的ApplicationContext =' {}',contextInitializerClasses =' []',activeProfiles =' {}',propertySourceLocations =' {}' ,propertySourceProperties =' {}',contextCustomizers = set [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@6a41eaa2,org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0,org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@13805618],contextLoader =' org.springframework.test.context .support.DelegatingSmartContextLoader',parent = [null]]] 17:52:06.671 [main] DEBUG org.springframework.test.context.cache - Spring测试ApplicationContext缓存统计信息:[DefaultContextCache @ 2e4b8173 size = 1,maxSize = 32,parentContextCount = 0,hitCount = 3,missCount = 1] 17:52:06.673 [main] DEBUG org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate - 使用键[[MergedContextConfiguration @ 71bbf57e testClass = HbaseApplicationTest,locations =' {}',类从缓存中检索ApplicationContext =' {}',contextInitializerClasses =' []',activeProfiles =' {}',propertySourceLocations =' {}' ,propertySourceProperties =' {}',contextCustomizers = set [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@6a41eaa2,org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0,org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@13805618],contextLoader =' org.springframework.test.context .support.DelegatingSmartContextLoader',parent = [null]]] 17:52:06.673 [main] DEBUG org.springframework.test.context.cache - Spring测试ApplicationContext缓存统计信息:[DefaultContextCache @ 2e4b8173 size = 1,maxSize = 32,parentContextCount = 0,hitCount = 4,missCount = 1] 17:52:06.673 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - 返回单例bean的缓存实例' org.springframework.boot.test.mock.mockito.MockitoBeans' 17:52:06.673 [main] DEBUG org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate - 使用键[[MergedContextConfiguration @ 71bbf57e testClass = HbaseApplicationTest,locations =' {}',类从缓存中检索ApplicationContext =' {}',contextInitializerClasses =' []',activeProfiles =' {}',propertySourceLocations =' {}' ,propertySourceProperties =' {}',contextCustomizers = set [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@6a41eaa2,org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0,org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@13805618],contextLoader =' org.springframework.test.context .support.DelegatingSmartContextLoader',parent = [null]]] 17:52:06.674 [main] DEBUG org.springframework.test.context.cache - Spring测试ApplicationContext缓存统计信息:[DefaultContextCache @ 2e4b8173 size = 1,maxSize = 32,parentContextCount = 0,hitCount = 5,missCount = 1] 17:52:06.713 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - 测试方法之后:context [DefaultTestContext @ 711f39f9 testClass = HbaseApplicationTest,testInstance = HbaseApplicationTest @ 184f6be2,testMethod = checkTableExists @ HbaseApplicationTest,testException = org。 apache.hadoop.hbase.client.RetriesExhaustedException:尝试次数= 36后失败,异常: Sun Dec 03 17:52:06 IST 2017,null,java.net.SocketTimeoutException:callTimeout = 60000,callDuration = 79009:连接被拒绝:没有进一步的信息行' test1 ,,'在桌子上' hbase:meta' at region = hbase:meta ,, 1.1588230740,hostname = localhost,35899,1512303024113,seqNum = 0 ,mergedContextConfiguration = [MergedContextConfiguration @ 71bbf57e testClass = HbaseApplicationTest,locations =' {}',classes =' {}',contextInitializerClasses =' []', activeProfiles =' {}',propertySourceLocations =' {}',propertySourceProperties =' {}',contextCustomizers = set [org.springframework.boot.test .context.filter.ExcludeFilterContextCustomizer @ 6a41eaa2,org.springframework.boot.test.mock.mockito.MockitoContextCustomizer @ 0,org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer @ 0,org.springframework.boot.test.autoconfigure .web.servlet.WebDriverContextCustomizerFactory $ Customizer @ 13805618],contextLoader =' org.springframework.test.context.support.DelegatingSmartContextLoader',parent = [null]]],使用@DirtiesContext [false]注释的类mode [null],使用模式[null]注释@DirtiesContext [false]的方法。 17:52:07.202 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - 在测试类之后:context [DefaultTestContext @ 711f39f9 testClass = HbaseApplicationTest,testInstance = [null],testMethod = [null],testException = [null ],mergedContextConfiguration = [MergedContextConfiguration @ 71bbf57e testClass = HbaseApplicationTest,locations =' {}',classes =' {}',contextInitializerClasses =' []' ,activeProfiles =' {}',propertySourceLocations =' {}',propertySourceProperties =' {}',contextCustomizers = set [org.springframework.boot。 test.context.filter.ExcludeFilterContextCustomizer@6a41eaa2,org.springframework.boot.test.mock.mockito.MockitoContextCustomizer @ 0,org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer @ 0,org.springframework.boot.test。 autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@13805618],contextLoader =' org.springframework。 test.context.support.DelegatingSmartContextLoader',parent = [null]]],使用模式[null]注释@DirtiesContext [false]的类。 17:52:07.232 [Thread-0] INFO org.springframework.context.support.GenericApplicationContext - 关闭org.springframework.context.support.GenericApplicationContext@80503:启动日期[Sun Dec 03 17:50:17 IST 2017];上下文层次结构的根 17:52:07.233 [Thread-0] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - 返回单例bean的缓存实例' lifecycleProcessor' 17:52:07.233 [Thread-0] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - 在org.springframework.beans.factory.support.DefaultListableBeanFactory@5e57643e中销毁单例:定义bean [org.springframework.context.annotation .internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event .internalEventListenerFactory,org.springframework.boot.test.mock.mockito.MockitoPostProcessor $ SpyPostProcessor,org.springframework.boot.test.mock.mockito.MockitoPostProcessor]。工厂层级的根

我哪里错了?

0 个答案:

没有答案