How to include hbase-site.xml in the classpath

前端 未结 1 1287
醉梦人生
醉梦人生 2021-01-05 12:52

I am currently trying to get my HBase code to use the settings specified in my hbase-site.xml. It seems to use default settings instead of what is specified in the hbase-sit

相关标签:
1条回答
  • 2021-01-05 13:43

    If it's using the default regardless of what you put in your hbase-site.xml, it probably means it is being overriden by another file in your classpath. This is very possible because there is already a conf-site.xml in the hbase jar.

    To fix this, edit your classpath to add the directory containing your hbase-site.xml at the end of the classpath to be sure nothing overrides it. Something like:

    java -cp $CLASSPATH:/usr/lib/hbase/conf path.to.your.Mainclass
    

    If it gets too obscure, I would advise running this from command line and not in Eclipse so you can be exactly sure of what you have in your classpath.

    Hope that helps.

    0 讨论(0)
提交回复
热议问题