如何为kafka和zookeeper设置java\u home cloudera快速启动

nuypyhwy  于 2021-05-27  发布在  Hadoop
关注(0)|答案(2)|浏览(471)

我已经将kafka服务添加到我的cloudera集群中,当我尝试启动它时,它失败了,出现以下错误

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/kafka/common/utils/KafkaThread : Unsupported major.minor version 52.0

据我所知,这是因为java版本不同,kafka需要1.8版本,而cloudera quickstart是在1.7版本中构建的。我已经安装了1.8,但我的cloudera仍在使用1.7版本。我已经更新了javau home和path veriables,还更新了.profile和.bashrc文件。
java——终端上的版本显示以下输出。

[root@quickstart default]# java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)

但当我尝试从cloudera manager启动kafka时,它显示了以下错误。请帮忙。

ccrfmcuu

ccrfmcuu1#

bashrc和profile都只针对您的用户。
如果你想改变整个系统,你可以编辑/etc/profile

up9lanfz

up9lanfz2#

这是你能做的。
登录到名称节点的终端。停止所有服务

service hadoop-hdfs-datanode stop
    service hadoop-hdfs-journalnode stop        
    service hadoop-hdfs-namenode stop        
    service hadoop-hdfs-secondarynamenode stop        
    service hadoop-httpfs stop        
    service hadoop-mapreduce-historyserver stop        
    service hadoop-yarn-nodemanager stop        
    service hadoop-yarn-proxyserver stop        
    service hadoop-yarn-resourcemanager stop        
    service hbase-master stop        
    service hbase-regionserver stop
    service hbase-rest stop
    service hbase-solr-indexer stop
    service hbase-thrift stop
    service hive-metastore stop
    service hive-server2 stop
    service impala-catalog stop
    service impala-server stop
    service impala-state-store stop
    service oozie stop
    service solr-server stop
    service spark-history-server stop
    service sqoop2-server stop
    service sqoop-metastore stop
    service zookeeper-server stop

停止服务器和代理

service cloudera-scm-agent stop
    service cloudera-scm-server stop

然后将以下内容添加到 /etc/bashrc ```
export JAVA_HOME=/usr/jdk1.8.0_231
export JRE_HOME=${JAVA_HOME}
export JDK_HOME=${JAVA_HOME}
export ANT_HOME=/usr/local/apache-ant/apache-ant-1.9.2
export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.4
export PATH=/usr/local/firefox:/sbin:$JAVA_HOME/bin:$ANT_HOME/bin:$M2_HOME/bin:$PATH

最后从cloudera manager重新启动服务和集群。

相关问题