dfs、yarn和hbase启动后,jps只有一下六项,eclipse中编写程序无法在hbase中建立表

查看数: 10776 | 评论数: 6 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2016-3-6 23:06

正文摘要:

大家好,我是新手,我是在Windows下运行的start-dfs.cmd start-yarn.cmd 和start-hbase.cmd,我的hbase-site.xml如下: <configuration>     <property>        ...

回复

小屁孩儿 发表于 2016-3-7 17:03:53
wscl1213 发表于 2016-3-7 10:09
java.net.UnknownHostException: master
master不识别,换成ip

已经解决了,最终根本原因是VMware没有禁用!谢谢了!

点评

没有禁用??  发表于 2016-3-8 11:59
wscl1213 发表于 2016-3-7 10:09:17
小屁孩儿 发表于 2016-3-7 08:53
目前我希望能够在java中对hbase进行操作,刚才修改了一下代码:
public class Hbase {
        public static  ...

java.net.UnknownHostException: master
master不识别,换成ip

小屁孩儿 发表于 2016-3-7 08:53:59
wscl1213 发表于 2016-3-7 07:37
如果是测试环境,可以取消hadoop hdfs的用户权限检查。打开conf/hdfs-site.xml,找到dfs.permissions属性修 ...

目前我希望能够在java中对hbase进行操作,刚才修改了一下代码:
public class Hbase {
        public static void main(String args[]) throws Exception{
               
                createTable();
               
        }
       
       
        public static void createTable() throws IOException{
    Configuration conf=HBaseConfiguration.create();
    conf.set("hbase.zookeeper.quorum", "master");
    conf.set("hbase.zookeeper.property.clientPort", "2181");
        //Connection conn= ConnectionFactory.createConnection(conf);
        HBaseAdmin hBaseAdmin = new HBaseAdmin(conf);
        HTableDescriptor desc = new HTableDescriptor(TableName.valueOf("test"));
        desc.addFamily(new HColumnDescriptor("test_1"));
        desc.addFamily(new HColumnDescriptor("test_2"));
        desc.addFamily(new HColumnDescriptor("test_3"));
                hBaseAdmin.createTable(desc);
                System.out.println("成功创建表!");
                hBaseAdmin.close();
        }
        }


出现这个问题:
2016-03-07 08:46:17,535 WARN [org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper] - Unable to create ZooKeeper Connection
java.net.UnknownHostException: master
        at java.net.InetAddress.getAllByName0(Unknown Source)
        at java.net.InetAddress.getAllByName(Unknown Source)
        at java.net.InetAddress.getAllByName(Unknown Source)
        at org.apache.zookeeper.client.StaticHostProvider.<init>(StaticHostProvider.java:61)
        at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:445)
        at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:380)
        at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.checkZk(RecoverableZooKeeper.java:141)
        at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:221)
        at org.apache.hadoop.hbase.zookeeper.ZKUtil.checkExists(ZKUtil.java:417)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.checkIfBaseNodeAvailable(HConnectionManager.java:942)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.access$600(HConnectionManager.java:604)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation$StubMaker.makeStubNoRetries(HConnectionManager.java:1680)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation$StubMaker.makeStub(HConnectionManager.java:1726)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation$MasterServiceStubMaker.makeStub(HConnectionManager.java:1780)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getKeepAliveMasterService(HConnectionManager.java:1985)
        at org.apache.hadoop.hbase.client.HBaseAdmin$MasterCallable.prepare(HBaseAdmin.java:3452)
        at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:114)
        at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:91)
        at org.apache.hadoop.hbase.client.HBaseAdmin.executeCallable(HBaseAdmin.java:3479)
        at org.apache.hadoop.hbase.client.HBaseAdmin.createTableAsync(HBaseAdmin.java:629)
        at org.apache.hadoop.hbase.client.HBaseAdmin.createTable(HBaseAdmin.java:520)
        at org.apache.hadoop.hbase.client.HBaseAdmin.createTable(HBaseAdmin.java:454)
        at hbase.Hbase.createTable(Hbase.java:38)
        at hbase.Hbase.main(Hbase.java:23)


运行到这一句HBaseAdmin hBaseAdmin = new HBaseAdmin(conf);时,就无法继续了
wscl1213 发表于 2016-3-7 07:37:09
如果是测试环境,可以取消hadoop hdfs的用户权限检查。打开conf/hdfs-site.xml,找到dfs.permissions属性修改为false(默认为true)OK了。(1.2.1 版本只有这个方法可行),如何操作可以参考第一个问题。







如果这里不行的话,就是防火墙等原因了
关闭

推荐上一条 /2 下一条