Hbase出现ERROR: Can't get master address from ZooKeeper; znode data == null解决办法

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://aaaedu.blog.csdn.net/article/details/92801139

问题描述如下:

复制代码

hbase(main):001:0> list
TABLE                                                                                                                                                                                          

ERROR: Can't get master address from ZooKeeper; znode data == null

Here is some help for this command:
List all tables in hbase. Optional regular expression parameter could
be used to filter the output. Examples:

  hbase> list
  hbase> list 'abc.*'
  hbase> list 'ns:abc.*'
  hbase> list 'ns:.*'


hbase(main):002:0> list
TABLE                                                                                                                                                                                          

ERROR: Can't get master address from ZooKeeper; znode data == null

Here is some help for this command:
List all tables in hbase. Optional regular expression parameter could
be used to filter the output. Examples:

  hbase> list
  hbase> list 'abc.*'
  hbase> list 'ns:abc.*'
  hbase> list 'ns:.*'


hbase(main):003:0> 

复制代码

 

 

 

 出现此问题可能是zookeeper不稳定造成的,采用的是虚拟机,经常挂起的状态,使用hbase的list命令出现下面错误,这个可能是hbase的稳定性造成的,解决办法有两种。这里使用第一种办法就解决了。

 

 

 

解决方法:

1.重启hbase

  1. stop-hbase.sh

然后

  2.start-hbase.sh

 

  或者,要么实在不行,就关掉所有集群。再重新开启吧!

 

 

 

 

2.解决方法2:

 

(1)原因:运行hbase(zookeeper)的用户无法写入zookeeper文件,导致znode data为空。

解决:在hbase-site.xml指定一个运行hbase的用户有写入文件权限的目录作为zookeeper数据目录,如
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/home/user88/zk_data</value>
  </property>

(2)hbase-site.xml文件中的

<property>  
<name>hbase.rootdir</name>   
<value>hdfs://hadoop1:49002/hbase</value>  
</property>

 

rootdir中的IP设定很重要,需要设定对应的IP

与core-site.xml中fs.defaultFS中的路径不相同

<property>
      <name>fs.defaultFS</name>
      <value>hdfs://hadoop1:9000</value>
  </property>

3.弱智原因,弄了半天一直在datanode上启动操作,没有在namenode上操作HBase,回到master理科成功!!!!

展开阅读全文

Hbase报错:Can't get master address from ZooKeeper; znode data == null

08-11

HADOOP2.2 HA模式下 安装HBASE0.98.3rn在配置好文件后 进入Hbase 报错 Can't get master address from ZooKeeper; znode data == nullrnHbase-site.xml配置文件:rn[code=text]rn rn hbase.rootdirrn hdfs://mycluster/hbasern rn rn hbase.cluster.distributedrn truern rnrn rn hbase.masterrn hdfs://hadoop001:6000rn rnrn rn hbase.zookeeper.quorumrn hadoop001,hadoop002,hadoop003,hadoop004,hadoop005rn rn rn hbase.master.maxclockskewrn 600000rn rn rn zookeeper.session.timeoutrn 60000rn rn rn hbase.zookeeper.property.clientPortrn 2181rn rn rn hbase.master.portrn 60000rn rn rn hbase.zookeeper.property.dataDirrn /home/hadoop/zookeeper-3.4.6/datarn rnrn[/code]rnHbase-env.sh配置文件:rn[code=text]#JAVArnexport JAVA_HOME=/usr/local/jdk1.7.0_60rnexport HBASE_MANAGES_ZK=falsernexport HBASE_LOG_DIR=/home/hadoop/logs/hbasernexport HADOOP_HOME=/home/hadoop/hadoop-2.2.0rnexport HBASE_HOME=/home/hadoop/hbase-0.98.3-hadoop2rnexport PATH=$HBASE_HOME/bin:$PATH[/code]rnregionservers配置文件:rn[code=text]hadoop001rnhadoop002rnhadoop003rnhadoop004rnhadoop005[/code]rncore-site.xml:rn[code=text]rn rn fs.defaultFSrn hdfs://myclusterrn rn rn fs.default.namern hdfs://hadoop001:9000rn rn rn io.file.buffer.sizern 131072rn rn rn hadoop.tmp.dirrn /home/hadoop/tmprn rn rn hadoop.proxyuser.hadoop.hostsrn *rn rn rn hadoop.proxyuser.hadoop.groupsrn *rn rn rn ha.zookeeper.quorumrn hadoop003,hadoop004,hadoop005rn rn rn zookeeper.znode.parentrn /hbasern rnrn rn fs.trash.interval rn 1440 rn rnrn[/code] 论坛

Can't get definitions factory from context. ??

07-16

程序从教材里拷贝过来的,SSH架构,由于之前的文件结构不符合Myelclipse自建的目录,就自己建了一个工程,并按照相应的src和webroot将源代码拷贝到新工程下,第一次在浏览器中输入http://localhost:8080/TES/还能显示主页,但之后就不行了,请高手指点,错误提示如下:rnrn2010-7-16 23:09:35 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet jsp threw exceptionrnjavax.servlet.jsp.JspException: Can't get definitions factory from context.rn at org.apache.struts.taglib.tiles.InsertTag.processDefinitionName(InsertTag.java:577)rn at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:476)rn at org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:438)rn at org.apache.jsp.pages.index_jsp._jspx_meth_tiles_005finsert_005f0(index_jsp.java:123)rn at org.apache.jsp.pages.index_jsp._jspService(index_jsp.java:76)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Thread.java:619)rnrn 论坛

Can't get hostname for you

08-11

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communication link failure, message from server: "Can't get hostname for your address"rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)rn at java.lang.reflect.Constructor.newInstance(Unknown Source)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)rn at com.mysql.jdbc.Util.getInstance(Util.java:387)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:917)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:896)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:885)rn at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1038)rn at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2255)rn at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2286)rn at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2085)rn at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:795)rn at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:44)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)rn at java.lang.reflect.Constructor.newInstance(Unknown Source)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)rn at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:327)rn at java.sql.DriverManager.getConnection(Unknown Source)rn at java.sql.DriverManager.getConnection(Unknown Source)rn at test.Test.(Test.java:21)rn at test.Test.main(Test.java:49)rnrn在debug下,con = DriverManager.getConnection(url) 就报错了rn网上的办法都没用 论坛

fscanf从文件中提数据.出现:error:expression can`t be evaluated...

07-28

#define N 100rn#define FORMAT "%-15s %-10d %-2d \n" rn#define VAR(m) list[m].name,list[m].num,list[m].scorern#define VAR_S(m) list[m].name,&list[m].num,&list[m].scorern#define RETURN_NO_LIST 0rn#define RETURN_SUCCESS 1 rnstatic char *File_Name = "Vampire.txt";rnrntypedef struct rnrn char name[15];rn int num;rn int score;rnSTU;rnrnrnint delet()rnrn int j = 0,m = 0;rn int curr_num = 0; //临时变量rn int target;rn// long int curr_pos;rn char select = 'y';rn FILE *fp;rn char del_name[20]=0; //定义一个存放欲删除姓名的字符串rn STU list[N];rn rn if( (fp=fopen(File_Name,"r+")) == NULL)rn rn printf("File Not Found!:( \n");rn rn while( !feof(fp)) //到达文件末尾,即返回一个非零值rn rn// fread(&list[n],sizeof(STU),1,fp);rn [color=#FF0000]fscanf(fp,FORMAT,VAR_S(curr_num)); [/color] //调试时候,到这里,我查找list[]数组.发现list[]的成员全部都出现一个错误:error:expression can`t be evaluated...rn curr_num ++;rn rn target = curr_num;rn if(fclose(fp))rn rn perror("fclose"); //向stderr写入错误信息rn exit(EXIT_FAILURE);rn rnrn while(select == 'y' || select == 'Y')rn rn printf("请输入要删除的学生姓名:\n");rn// output(list,n); //显示目前该数组中的所有学生信息rn// fflush(stdin);rn scanf("%s",del_name); //让用户输入一个欲删除信息的学生姓名rn// for(i=0;i 0) rn rn// curr_pos = ftell(fp);rn// fscanf(fp,"%s",list.name);rn if(strcmp(del_name,list[target - 1].name) == 0)rn break;rn target --;rn rn rn if(m == 0)rn rn printf("不存在该学生!:(\n");rn return RETURN_NO_LIST;rn rn// fseek(fp,curr_pos,SEEK_SET);rn// fprintf(fp,"%42s","");rn for(j = target;j < (curr_num - 1);j++)rn list[j] = list[j+1];rn curr_num --;rn// output(list,n); //打印删除后的数组学生信息rnrn printf("您还要继续删除吗?要(y/Y),不要(n/N)!\n");rn scanf("%c",&select);rn// fflush(stdin);rn rnrn if( (fp=fopen(File_Name,"w")) == NULL)rn rn printf("File Not Found!:( \n");rn rn for (j = 0; j < curr_num; j++)rn rn fprintf(fp,FORMAT,VAR(j));rn rn if(fclose(fp))rn rn perror("fclose");rn exit(EXIT_FAILURE);rn elsern return 0;rnrnrn这个是什么问题?请高手指教了... 论坛

kernel panic:can't handle the cache error!

04-24

[code=c]Booting image at bc050000 ...rnraspi_read: from:50000 len:40rn. Image Name: Linux Kernel Imagern Created: 2014-04-24 9:44:21 UTCrn Image Type: MIPS Linux Kernel Image (lzma compressed)rn Data Size: 4533294 Bytes = 4.3 MBrn Load Address: 80000000rn Entry Point: 803e7000rnraspi_read: from:50040 len:452c2ern...................................................................... Verifyirnng Checksum ... OKrn Uncompressing Kernel Image ... OKrnNo initrdrn## Transferring control to Linux (at address 803e7000) ...rn## Giving linux memsize in MB, 32rnrnStarting kernel ...rnrnrnLINUX started...rnrn THIS IS ASICrnLinux version 2.6.21 (root@ubuntu) (gcc version 3.4.2) #1 Thu Apr 24 17:44:09 CSrnT 2014rnrn The CPU frequency set to 360 MHzrnCPU revision is: 0001964crnDetermined physical RAM map:rn memory: 02000000 @ 00000000 (usable)rnInitrd not found or empty - disabling initrdrnBuilt 1 zonelists. Total pages: 8128rnKernel command line: console=ttyS1,57600n8 root=/dev/ram0rnPrimary instruction cache 32kB, physically tagged, 4-way, linesize 32 bytes.rnPrimary data cache 16kB, 4-way, linesize 32 bytes.rnSynthesized TLB refill handler (20 instructions).rnSynthesized TLB load handler fastpath (32 instructions).rnSynthesized TLB store handler fastpath (32 instructions).rnSynthesized TLB modify handler fastpath (31 instructions).rnCache parity protection disabledrncause = c0808028, status = 11000000rnPID hash table entries: 128 (order: 7, 512 bytes)rncalculating r4koff... 0015f900(1440000)rnCPU frequency 360.00 MHzrnUsing 180.000 MHz high precision timer.rnDentry cache hash table entries: 4096 (order: 2, 16384 bytes)rnInode-cache hash table entries: 2048 (order: 1, 8192 bytes)rnMemory: 25152k/32768k available (3145k kernel code, 7616k reserved, 846k data, 3rn236k init, 0k highmem)rnMount-cache hash table entries: 512rnNET: Registered protocol family 16rnSCSI subsystem initializedrnusbcore: registered new interface driver usbfsrnusbcore: registered new interface driver hubrnusbcore: registered new device driver usbrndeice id : ef 40 17 0 0 (40170000)rnTime: MIPS clocksource has been installed.rnW25Q64BV(ef 40170000) (8192 Kbytes)rnmtd .name = raspi, .size = 0x00800000 (8M) .erasesize = 0x00010000 (64K) .numerarnseregions = 0rnCreating 5 MTD partitions on "raspi":rn0x00000000-0x00800000 : "ALL"rn0x00000000-0x00030000 : "Bootloader"rn0x00030000-0x00040000 : "Config"rn0x00040000-0x00050000 : "Factory"rn0x00050000-0x01000000 : "Kernel"rnmtd: partition "Kernel" extends beyond the end of device "raspi" -- size truncatrned to 0x7b0000rnNET: Registered protocol family 2rnIP route cache hash table entries: 1024 (order: 0, 4096 bytes)rnTCP established hash table entries: 1024 (order: 1, 8192 bytes)rnTCP bind hash table entries: 1024 (order: 0, 4096 bytes)rnTCP: Hash tables configured (established 1024 bind 1024)rnTCP reno registeredrndetected lzma initramfsrndetected lzma initramfsrninitramfs: LZMA lc=3,lp=0,pb=2,dictSize=1048576,origSize=14032896rnLZMA initramfs by Ming-Ching Tiew ............................rn................................................................................rn................................................................................rn...........................RT3xxx EHCI/OHCI init.rnsquashfs: version 3.2-r2 (2007/01/15) Phillip Lougherrnsquashfs: LZMA suppport for slax.org by jrornfuse init (API version 7.8)rnio scheduler noop registered (default)rnRalink gpio driver initializedrnHDLC line discipline: version $Revision: 1.1.1.1 $, maxframe=4096rnN_HDLC line discipline registered.rnSerial: 8250/16550 driver $Revision: 1.9 $ 2 ports, IRQ sharing disabledrnserial8250: ttyS0 at I/O 0xb0000500 (irq = 37) is a 16550Arnserial8250: ttyS1 at I/O 0xb0000c00 (irq = 12) is a 16550ArnRAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksizernloop: loaded (max 8 devices)rnrdm_major = 253rnrdm_major = 253rnd, mtu = 1500!rnMAC_ADRH -- : 0x000000c0rnMAC_ADRL -- : 0x00059c6brnPROC INIT OK!rnPPP generic driver version 2.4.2rnPPP BSD Compression module registeredrnNET: Registered protocol family 24rnPPPoL2TP kernel driver, V0.17rnPPTP driver version 0.8.1rnrnrn=== pAd = c0019000, size = 805096 ===rnrn<-- RTMPAllocAdapterBlock, Status=0rnblock2mtd: version $Revision: 1.1.1.1 $rnrt3xxx-ehci rt3Cache error exception:rncp0_errorepc == b80f2800rnc0_cacheerr == 21480400rnDecoded c0_cacheerr: primary cache fault in insn reference.rnError bits: ED EI E0rnIDX: 0x00080400rnDErrAddr0: 0xffffffffrnKernel panic - not syncing: Can't handle the cache error![/code]rn谁能给解释解释,该从哪里入手,新手分不多,跪求各位大虾指点rn我正在看http://hi.baidu.com/comcat/item/b519b80c9108268903ce1b87这个帖子,期待给力的回复 论坛

Error 1005, Can't Create Table...

07-02

CREATE TABLE tbl_projectrn(rnid INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,rnname VARCHAR(128),rndescription TEXT,rncreate_time DATETIME,rncreate_user_id INTEGER,rnupdate_time DATETIME,rnupdate_user_id INTEGERrn);rnrnCREATE TABLE IF NOT EXISTS 'tbl_issue'rn(rn'id' INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,rn'name' varchar(256) NOT NULL,rn'description' varchar(2000),rn'project_id' INTEGER,rn'type_id' INTEGER,rn'status_id' INTEGER,rn'owner_id' INTEGER,rn'requester_id' INTEGER,rn'create_time' DATETIME,rn'create_user_id' INTEGER,rn'update_time' DATETIME,rn'update_user_id' INTEGERrn) ENGINE = InnoDBrn;rnrnCREATE TABLE IF NOT EXISTS 'tbl_user'rn(rn'id' INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,rn'email' Varchar(256) NOT NULL,rn'username' Varchar(256),rn'password' Varchar(256),rn'last_login_time' Datetime,rn'create_time' DATETIME,rn'create_user_id' INTEGER,rn'update_time' DATETIME,rn'update_user_id' INTEGERrn) ENGINE = InnoDBrn;rnrnCREATE TABLE IF NOT EXISTS 'tbl_project_user_assignment'rn(rn'project_id' Int(11) NOT NULL,rn'user_id' Int(11) NOT NULL,rn'create_time' DATETIME,rn'create_user_id' INTEGER,rn'update_time' DATETIME,rn'update_user_id' INTEGER,rnPRIMARY KEY ('project_id','user_id')rn) ENGINE = InnoDBrn;rnrnALTER TABLE 'tbl_issue' ADD CONSTRAINT 'FK_issue_project' FOREIGN KEYrn('project_id') REFERENCES 'tbl_project' ('id') ON DELETE CASCADE ONrnUPDATE RESTRICT;rnALTER TABLE 'tbl_issue' ADD CONSTRAINT 'FK_issue_owner' FOREIGN KEYrn('owner_id') REFERENCES 'tbl_user' ('id') ON DELETE CASCADE ON UPDATErnRESTRICT;rnALTER TABLE 'tbl_issue' ADD CONSTRAINT 'FK_issue_requester' FOREIGNrnKEY ('requester_id') REFERENCES 'tbl_user' ('id') ON DELETE CASCADE ONrnUPDATE RESTRICT;rnALTER TABLE 'tbl_project_user_assignment' ADD CONSTRAINT 'FK_project_rnuser' FOREIGN KEY ('project_id') REFERENCES 'tbl_project' ('id') ONrnDELETE CASCADE ON UPDATE RESTRICT;rnALTER TABLE 'tbl_project_user_assignment' ADD CONSTRAINT 'FK_user_rnproject' FOREIGN KEY ('user_id') REFERENCES 'tbl_user' ('id') ONrnDELETE CASCADE ON UPDATE RESTRICT;rnrn我用的mysql, 我先按照上面的语句,创建了几个表格。表格创建成功后,我设置外建的时候出现了error 1005,上网查了一下,下面是网上说的原因,但是我没找到我这里的语句哪错了,希望明白的人指点一下。rnrn“原因之一:设置关联的字段类型不匹配,比如bigint 和 int rn 解决:外键的相关字段修改成同一类型就可以解决这个问题 rn原因之二: rn解决:1. mysql支持外键约束,数据库类型必须是InnoDB rn 2. 建外键的表的列(字段)要加上index”rn 论坛

没有更多推荐了,返回首页