十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
你的URL是不是拼错了,'emp:url action="queryPvpAccpAccount.do"/?'+paramStr+'cdh='+cdh;,这个paramStr没有参数,然后你就cdh啦
创新互联公司成立10余年来,这条路我们正越走越好,积累了技术与客户资源,形成了良好的口碑。为客户提供网站制作、网站建设、网站策划、网页设计、域名注册、网络营销、VI设计、网站改版、漏洞修补等服务。网站是否美观、功能强大、用户体验好、性价比高、打开快等等,这些对于网站建设都非常重要,创新互联公司通过对建站技术性的掌握、对创意设计的研究为客户提供一站式互联网解决方案,携手广大客户,共同发展进步。
看你用什么版本的hadoop,推荐使用cdh版的
jar包导入web工程
调用HBase接口
如:
hbaseConfig = new Configuration();
conf = HBaseConfiguration.create(hbaseConfig);
admin = new HBaseAdmin(conf);
this.setTableName(tableName);
找不到JAVA_HOME 说明JDK环境变量没有配置正确,建议查看一下是否有安装JDK,再查看一下path里有没有增加JAVA_HOME的环境变量. eoch path 即可查看。
在安装presudo版本的CDH5中,第一次需要格式化HDFS,执行:
$ sudo -u hdfs hdfs namenode -format
但是会出现:
[root@AY1312280620257702e0Z conf]# sudo -u hdfs hdfs namenode -format
Error: JAVA_HOME is not set and could not be found.
[root@AY1312280620257702e0Z conf]# echo $JAVA_HOME
/usr/qiuxin/software/jdk1.7.0_25
[root@AY1312280620257702e0Z conf]# echo $JAVA_HOME
/usr/qiuxin/software/jdk1.7.0_25
[root@AY1312280620257702e0Z conf]# sudo -u hdfs hdfs namenode -format
Error: JAVA_HOME is not set and could not be found.
[root@AY1312280620257702e0Z conf]# java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
[root@AY1312280620257702e0Z conf]#
[root@AY1312280620257702e0Z ~]# for x in `cd /etc/init.d ; ls hadoop-hdfs-*` ; do sudo service $x start ; done
Starting Hadoop datanode:[ OK ]
Error: JAVA_HOME is not set and could not be found.
Starting Hadoop namenode:[ OK ]
Error: JAVA_HOME is not set and could not be found.
Starting Hadoop secondarynamenode:[ OK ]
Error: JAVA_HOME is not set and could not be found.
需要进行如下配置,即可解决如上问题:
在/etc/sudores 的最后一行增加:
On systems on which
sudo
clears or restricts environment variables, you also need to add the following line to the
/etc/sudoers
file:
Defaults env_keep+=JAVA_HOME
同时需要配置:
If your JDK is located at one of the standard locations, it's detected by the script (using this component called bigtop-utils). However, if it's not, you'd have to go to /etc/default/bigtop-utils and set and export JAVA_HOME ( to /usr/qiuxin/software/jdk1.7.0_25) there. You only need to do it once and all CDH components would use that variable to figure out where JDK is.
[root@AY1312280620257702e0Z ~]# vi /etc/default/bigtop-utils
增加:export JAVA_HOME=/usr/qiuxin/software/jdk1.7.0_25
[root@AY1312280620257702e0Z ~]# source /etc/default/bigtop-utils