[ 
https://issues.apache.org/jira/browse/HBASE-7191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16886440#comment-16886440
 ] 

stack commented on HBASE-7191:
------------------------------

Back looking at this issue. This is what I get if I remove the hbase.version 
file:

{code}
 org.apache.hadoop.hbase.util.FileSystemVersionException: HBase file layout 
needs to be upgraded. You have version null and I want version 8. Consult 
http://hbase.apache.org/book.html for further information about upgrading 
HBase. Is your hbase.rootdir valid? If so, you may need to run 'hbase hbck 
-fixVersionFile'.
   at org.apache.hadoop.hbase.util.FSUtils.checkVersion(FSUtils.java:446)
   at 
org.apache.hadoop.hbase.master.MasterFileSystem.checkRootDir(MasterFileSystem.java:273)
   at 
org.apache.hadoop.hbase.master.MasterFileSystem.createInitialFileSystemLayout(MasterFileSystem.java:153)
   at 
org.apache.hadoop.hbase.master.MasterFileSystem.<init>(MasterFileSystem.java:124)
   at 
org.apache.hadoop.hbase.master.HMaster.finishActiveMasterInitialization(HMaster.java:901)
   at 
org.apache.hadoop.hbase.master.HMaster.startActiveMasterManager(HMaster.java:2120)
   at org.apache.hadoop.hbase.master.HMaster.lambda$run$0(HMaster.java:577)
   at java.base/java.lang.Thread.run(Thread.java:844)
{code}

After commit of HBASE-22688 this morning, the fix is running the filesystem 
command from hbck2 with the -fix option. It restores the hbase.version file.

{code}$ 
HBASE_CLASSPATH_PREFIX=../hbase-operator-tools/hbase-hbck2/target/hbase-hbck2-1.0.0-SNAPSHOT.jar
 bin/hbase org.apache.hbase.HBCK2 filesystem -fix{code}

It does NOT put back the hbase.id file. Launching the hbase process creates a 
new one if missing which is probably not ideal; should probably try and find 
old cluster id and put that back rather than create a new one. hbase cluster id 
doesn't seem critical so will leave it for now until someone complains.

Meantime let me close out this issue with a patch that fixes the message that 
is spewed when hbase.version is missing.


> HBCK - Add offline create/fix hbase.version and hbase.id 
> ---------------------------------------------------------
>
>                 Key: HBASE-7191
>                 URL: https://issues.apache.org/jira/browse/HBASE-7191
>             Project: HBase
>          Issue Type: Improvement
>          Components: hbck
>    Affects Versions: 0.94.1
>            Reporter: Enis Soztutar
>            Assignee: xufeng
>            Priority: Major
>         Attachments: 7191-2.patch, hbck1-1.4-v1.patch
>
>
> One of our clients run into a problem, in which they have the hbase.root.dir, 
> and cluster data, but their hbase.id and hbase.version files are corrupted. 
> HMaster creates those on start, but not if there is already existing data.
> We can add smt like --fixIdFile, and ability for HBCK to do some offline 
> repairs for the version file. 



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to