Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

failed to create schema in hbase using phoenix java program

Highlighted

failed to create schema in hbase using phoenix java program

New Contributor

HBase version : 1.2.6 Phoenix Version : 4.10.0-HBase-1.2.0

While creating schema or table I am getting this error:

Failed to move working directory snapshot

{ ss=_UPGRADING_TABLE_SYSTEM.MUTEX table=SYSTEM.MUTEX type=DISABLED }

So because of this error it is not creating the schema or table.

java-program: ------------------

Properties connectionProps = new Properties();
connectionProps.put("phoenix.schema.isNamespaceMappingEnabled", "true");
connectionProps.put("phoenix.schema.mapSystemTablesToNamespace", "true");
connection = DriverManager.getConnection("jdbc:phoenix:localhost",connectionProps);
statement = connection.createStatement();
statement.executeUpdate("CREATE SCHEMA MYSCHEMA");
connection.commit();

hbase-site.xml ----------------

 <property>
	    <name>phoenix.schema.isNamespaceMappingEnabled</name>
	    <value>true</value>
   </property>
  	<property>
	    <name>phoenix.schema.mapSystemTablesToNamespace</name>
	    <value>true</value>
   </property>

please help me.

5 REPLIES 5
Highlighted

Re: failed to create schema in hbase using phoenix java program

Expert Contributor

@Vishal Biradar

You must add the isNamespaceMappingEnabled property to hbase-site.xml, not to hdfs-site.xml. Also, don't forget to restart HBase after that.

Could you please try the "sqlline.py" utility to create your schema to check if it works that way? It's under /usr/hdp/current/phoenix/bin or /usr/hdp/current/phoenix-client/bin (depending on your HDP version).

Highlighted

Re: failed to create schema in hbase using phoenix java program

New Contributor

its hbase-site.xml only by mistake i wrote hdfs-site.xml.

Highlighted

Re: failed to create schema in hbase using phoenix java program

Super Collaborator

Are you using HDP? SYSTEM.MUTEX is not used in Phoenix 4.7 which is part of HDP packages. If your question is about the release from Apache site, please be more specific about the version.

Highlighted

Re: failed to create schema in hbase using phoenix java program

New Contributor

Its not working properly on windows ??

But on mac its working fine..

Do I need to add any env. variables on windows related to hbase and phoenix..

Anyone is using hbase and phoenix on windows ???

Highlighted

Re: failed to create schema in hbase using phoenix java program

Super Collaborator

make sure that you are using the correct version of phoenix-client.jar . For any OS it's highly recommended to have hbase-site.xml the same as the server has and set HBASE_CONF_DIR pointing to the directory where this file is located.

Don't have an account?
Coming from Hortonworks? Activate your account here