29May 2018

將 CDH 5.8.3 原先配置的 Oracle JDK 1.7 置換為 Open JDK 1.7

將 CDH 5.8.3 原先配置的 Oracle JDK 1.7 置換為 Open JDK 1.7


  • Stop All CDH services
  • Stop ALL cloudea manager services
  • Stop ALL cloudera-scm-agent
  • Stop ALL cloudera-scm-server

1.Install openjdk ( build-in with RedHat 6.7 )

yum install java-1.7.0-openjdk.x86_64 java-1.7.0-openjdk-devel.x86_64

check java -version


2.set java home path for cloudera-scm-agent

vi /etc/default/cloudera-scm-agent

export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64

restart cloudera-scm-agent

check /var/log/cloudera-scm-agent/cloudera-scm-agent.log


			[23/May/2018 19:15:40 +0000] 5517 DnsResolutionMonitor throttling_logger INFO
Using java location: '/usr/lib/jvm/java-1.7.0-openjdk.x86_64/bin/java'.


3. set java home path dor cloudera-scm-server

vi /etc/defaulf/cloudera-scm-server
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64

restart cloudera-scm-server

check /var/log/cloudera-scm-server/cloudera-scm-server.log




4. set java home path dor cloudera-scm-server Set configure of cm hosts java home directory cm->host->Confiqurations->Java Home Directory

the values will be / usr/lib/jvm/java-1.7.0-openjdk.x86_64


5. Restart All CDH services

logs show that service start using OpenJDK


6. Check zookeeper log



				2018-05-23 19:40:29,086 INFO org.apache.zookeeper.server.ZooKeeperServer: Server environment:java.home=/usr/lib/jvm/java-1.7.0-openjdk- 

7. Check HDFS logs


NAMENODE,DATANODE logs cannot find keyword opjdk

JOURNALNODE logs found

				2018-05-23 19:40:55,432 INFO org.apache.zookeeper.ZooKeeper: Client environment:java.home=/usr/lib/jvm/java-1.7.0-openjdk- 


8. Check YARN logs


logs not found keywork openjdk


9. Check Hive logs


only found openjdk message about with zookeeper

				2018-05-23 20:04:13,391 INFO org.apache.zookeeper.ZooKeeper: [HiveServer2-Background-Pool: Thread-39]: Client environment:java.home=/usr/lib/jvm/java-1.7.0-openjdk- 

10. Verify HDFS commands

				234 sudo -u hdfs hdfs dfs -put hadoop-cmf-hdfs-JOURNALNODE-parrot01.log.out /est 235 sudo -u hdfs hdfs dfs -put hadoop-cmf-hdfs-JOURNALNODE-parrot01.log.out /test 236 sudo -u hdfs dfs -ls / 237 sudo -u hdfs hdfs dfs -ls / 238 sudo -u hdfs hdfs dfs -rm /est 239 sudo -u hdfs hdfs dfs -ls /test 240 sudo -u hdfs hdfs dfs -cat /test/hadoop-cmf-hdfs-JOURNALNODE-parrot01.log.out 241 sudo -u hdfs hdfs dfs -rm /test/hadoop-cmf-hdfs-JOURNALNODE-parrot01.log.out 

command execute successfully


11. Verify Hive commands

beeline-u jdbc:hive2:// -n hive

test ddl, dml commands

create database, create table, insert into

drop table, drop database.

command execute successfully


Back to list.
Cloudera 如何使用開放原始碼
Cloudera 如何使用開放原始碼
SOP - 封閉網路環境中安裝設定 CDH
SOP - 封閉網路環境中安裝設定 CDH