CentOS7.7搭建weblogic12c-集群环境部署(一)

0、前言

在centos7.7系统搭建weblogic12.2.1.4.0集群环境。

准备服务器若干,全程静默安装。

软件列表:

6880880   #补丁工具升级包
fmw_12.2.1.4.0_wls_lite_generic.jar    #weblogic程序安装包
jdk-8u341-linux-x64.tar.gz     #jdk包
p34236279_122140_Generic.zip    #补丁包

1、操作系统(项目上一般用最小化安装操作系统,减少不必要的应用消耗资源)

[root@localhost ~] cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)
[root@localhost ~]

 2、修改主机名(centos7.7修改hosts和network好像不太管用)

[root@localhost ~] hostnamectl set-hostname --static Cluster01

3、关闭selinux

[root@localhost ~]# vi /etc/selinux/config
[root@localhost ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled  #修改此处
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 


[root@localhost ~]# 

 4、重启电源

[root@localhost ~]# reboot

5、配置本地yum源 

[root@Cluster01 ~]# mkdir /etc/yum.repos.d/bak
[root@Cluster01 ~]# mv /etc/yum.repos.d/CentOS-* /etc/yum.repos.d/bak/   #需要把系统自带的repo文件都移走,不然后续可能会报错
[root@Cluster01 ~]# vi /etc/yum.repos.d/centos.repo
[root@Cluster01 ~]# cat /etc/yum.repos.d/centos.repo 
[base]
name=centos7
baseurl=file:///media/cdrom  #挂载点的目录
enabled=1
gpgcheck=0
[root@Cluster01 ~]# 

 6、挂载系统光盘

[root@Cluster01 ~]# mkdir /media/cdrom  #创建挂载点
[root@Cluster01 ~]# mount /dev/cdrom /media/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only
[root@Cluster01 ~]# 

7、使用FileZilla工具上传安装包

[root@Cluster01 ~]# mkdir -p /home/software/
[root@Cluster01 ~]# ll -ls /home/software/
total 807064
     0 drwxr-xr-x 2 root root        69 Sep 19 12:06 6880880   #补丁工具升级包
593208 -rw-r--r-- 1 root root 607441954 Sep 19 12:06 fmw_12.2.1.4.0_wls_lite_generic.jar    #weblogic程序安装包
144692 -rw-r--r-- 1 root root 148162542 Sep 19 12:06 jdk-8u341-linux-x64.tar.gz     #jdk包
 69164 -rw-r--r-- 1 root root  70821301 Sep 19 12:06 p34236279_122140_Generic.zip    #补丁包
[root@Cluster01 ~]# 

 8、yum安装需要的包

[root@Cluster01 ~]# yum -y install unzip net-tools psmisc

9、安装jdk

9.1解压java到创建的java目录

[root@Cluster01 ~]# rpm -qa | grep java
[root@Cluster01 ~]# 
[root@Cluster01 ~]# mkdir -p /usr/java
[root@Cluster01 ~]# tar -zxvf /home/software/jdk-8u341-linux-x64.tar.gz  -C /usr/java/
[root@Cluster01 ~]# ll -ls /usr/java/
total 0
0 drwxr-xr-x 8 root root 273 Sep 19 15:08 jdk1.8.0_341
[root@Cluster01 ~]#

9.2修改java的环境变量

[root@Cluster01 ~]# vi /etc/profile
#末尾追加
export JAVA_HOME=/usr/java/jdk1.8.0_341
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}
export ORACLE_HOME=/home/weblogic/bea

[root@Cluster01 ~]# source  /etc/profile

9.3查看java版本

[root@Cluster01 ~]# java -version
java version "1.8.0_341"
Java(TM) SE Runtime Environment (build 1.8.0_341-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)
[root@Cluster01 ~]# 

10、 创建weblogic用户和组

[root@Cluster01 ~]# groupadd  weblogic
[root@Cluster01 ~]# useradd  weblogic -g weblogic
[root@Cluster01 ~]# passwd weblogic
Changing password for user weblogic.
New password:   QPCBei*%1dd
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@Cluster01 ~]#

11、 创建目录

[root@Cluster01 ~]# mkdir -p /home/weblogic/bea   #创建放置weblogic项目的家目录
[root@Cluster01 ~]# chown -R  weblogic:weblogic /home/weblogic/bea/ 
[root@Cluster01 ~]#mkdir -p /home/weblogic/install   #创建放置相应文件的目录
[root@Cluster01 ~]# chown -R  weblogic:weblogic /home/weblogic/install 
[root@Cluster01 ~]# ll -ls /home/weblogic/
total 0
0 drwxr-xr-x 2 weblogic weblogic 6 Sep 19 15:26 bea
0 drwxrwxr-x 2 weblogic weblogic 6 Sep 19 15:33 install
[root@Cluster01 ~]# 

12、新建oralnst.loc和wsl.rsp相应文件

[root@Cluster01 ~]# su - weblogic
[weblogic@Cluster01 ~]# cd /home/weblogic/install
[weblogic@Cluster01 install]$ vi oralnst.loc 
inventory_loc=/home/weblogic/install/oraInventory
inst_group=weblogic
[weblogic@Cluster01 install]$ 
[weblogic@Cluster01 install]$ vi wsl.rsp 
[ENGINE]
Response File Version=1.0.0.0.0
[GENERIC]
ORACLE_HOME=/home/weblogic/bea
INSTALL_TYPE=WebLogic Server
[weblogic@Cluster01 install]$ 

13、安装weblogic

13.1修改weblogic的环境变量

[weblogic@Cluster01 ~]$ vi ~/.bash_profile 
export JAVA_HOME=/usr/java/jdk1.8.0_341
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}
export ORACLE_HOME=/home/weblogic/bea

[weblogic@Cluster01 ~]$ source ~/.bash_profile

13.2修改安装包的属性

[root@Cluster01 ~]# chown -R  weblogic:weblogic /home/software/fmw_12.2.1.4.0_wls_lite_generic.jar 
[root@Cluster01 ~]# ll -ls /home/software/
total 807064
     0 drwxr-xr-x 2 root     root            69 Sep 19 12:06 6880880
593208 -rw-r--r-- 1 weblogic weblogic 607441954 Sep 19 12:06 fmw_12.2.1.4.0_wls_lite_generic.jar
144692 -rw-r--r-- 1 root     root     148162542 Sep 19 12:06 jdk-8u341-linux-x64.tar.gz
 69164 -rw-r--r-- 1 root     root      70821301 Sep 19 12:06 p34236279_122140_Generic.zip
[root@Cluster01 ~]#

 13.3安装

[weblogic@Cluster01 ~]$ java -jar /home/software/fmw_12.2.1.4.0_wls_lite_generic.jar -silent  -responseFile /home/weblogic/install/wsl.rsp  -invPtrLoc /home/weblogic/install/oralnst.loc

 -invPtrLoc /home/weblogic/install/oralnst.loc
Launcher log file is /tmp/OraInstall2022-09-19_03-49-27PM/launcher2022-09-19_03-49-27PM.log.
Extracting the installer . . . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 2300.000 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 8063 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 48987 MB    Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2022-09-19_03-49-27PM
Log: /tmp/OraInstall2022-09-19_03-49-27PM/install2022-09-19_03-49-27PM.log
Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
Reading response file..
Skipping Software Updates
Starting check : CertifiedVersions
Expected result: One of oracle-6, oracle-7, redhat-7, redhat-6, SuSE-11, SuSE-12, SuSE-15
Actual Result: redhat-null
Check complete. The overall result of this check is: Passed
CertifiedVersions Check: Success.


Starting check : CheckJDKVersion
Expected result: 1.8.0_191
Actual Result: 1.8.0_341
Check complete. The overall result of this check is: Passed
CheckJDKVersion Check: Success.


Validations are enabled for this session.
Verifying data
Copying Files
Percent Complete : 10
Percent Complete : 20
Percent Complete : 30
Percent Complete : 40
Percent Complete : 50
Percent Complete : 60
Percent Complete : 70
Percent Complete : 80
Percent Complete : 90
Percent Complete : 100

The installation of Oracle Fusion Middleware 12c WebLogic Server and Coherence 12.2.1.4.0 completed successfully.
Logs successfully copied to /home/weblogic/install/oraInventory/logs.
[weblogic@Cluster01 ~]$ 

14、 安装域

14.1修改环境变量

[weblogic@Basis01 ~]$ vi ~/.bashrc   
#末尾追加
export MW_HOME="/home/weblogic/bea"
export WL_HOME="/home/weblogic/bea/oracle_common"
[weblogic@Basis01 ~]$ source ~/.bashrc 
[weblogic@Basis01 ~]$ sh /home/weblogic/bea/oracle_common/common/bin/commEnv.sh 

 14.2新建安装脚本

[weblogic@Cluster01 ~]$ cd /home/weblogic/install
[weblogic@Cluster01 install]$ vi create_domain.py 
readTemplate('/home/weblogic/bea/wlserver/common/templates/wls/wls.jar')
cd('Servers/AdminServer')
set('ListenAddress','')
set('ListenPort', 7001)
cd('../..')
cd('/Security/base_domain/User/weblogic')
cmo.setPassword('Ui*1n)Qcd&93')
setOption('OverwriteDomain', 'true')
writeDomain('/home/weblogic/bea/user_projects/domains/base_domain')
closeTemplate()
exit()
[weblogic@Cluster01 install]$ 

 14.5安装

[weblogic@Cluster01 install]$ sh /home/weblogic/bea/oracle_common/common/bin/wlst.sh /home/weblogic/install/create_domain.py

WARNING: This is a deprecated script. Please invoke the wlst.sh script under oracle_common/common/bin.

Initializing WebLogic Scripting Tool (WLST) ...

Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands



Exiting WebLogic Scripting Tool.

[weblogic@Cluster01 bin]$ 

15、调优

15.1加速启动

 [weblogic@Cluster01 bin]$ vi  /home/weblogic/bea/user_projects/domains/base_domain/bin/startWebLogic.sh
将
umask 027
修改为
umask 002

15.2加速关闭

将
echo "shutdown('${SERVER_NAME}','Server', ignoreSessions='true')" >>"shutdown-${SERVER_NAME}.py"
修改为
echo "shutdown('${SERVER_NAME}','Server', ignoreSessions='true',timeOut=0,force='true')" >>"shutdown-${SERVER_NAME}.py"

16、防火墙放行7001端口

[root@Cluster01 ~]# firewall-cmd --permanent --zone=public --add-port=7001/tcp
success
[root@Cluster01 ~]# firewall-cmd --reload
success
[root@Cluster01 ~]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens32
  sources: 
  services: dhcpv6-client ssh
  ports: 7001/tcp
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

[root@Cluster01 ~]# 

 17、打补丁

17.1先升级打补丁工具

[root@Cluster01 ~]#  mv /home/weblogic/bea/OPatch/   /home/weblogic/bea/OPatch_old^C
[root@Cluster01 ~]#  chown -R weblogic:weblogic /home/software/6880880/
[root@Cluster01 ~]# ll /home/software/
total 807064
drwxr-xr-x 2 weblogic weblogic        69 Sep 19 12:06 6880880
-rw-r--r-- 1 weblogic weblogic 607441954 Sep 19 12:06 fmw_12.2.1.4.0_wls_lite_generic.jar
-rw-r--r-- 1 root     root     148162542 Sep 19 12:06 jdk-8u341-linux-x64.tar.gz
-rw-r--r-- 1 root     root      70821301 Sep 19 12:06 p34236279_122140_Generic.zip
[root@Cluster01 ~]#

17.2安装 

 [weblogic@Cluster01 ~]$ java -jar /home/software/6880880/opatch_generic.jar  -silent oracle_home=/home/weblogic/bea
Launcher log file is /tmp/OraInstall2022-09-20_12-04-46PM/launcher2022-09-20_12-04-46PM.log.
Extracting the installer . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 2300.000 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 8063 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 49543 MB    Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2022-09-20_12-04-46PM
Installation Summary

Disk Space : Required 34 MB, Available 142,703 MB
Feature Sets to Install:
        Next Generation Install Core 13.9.4.0.1
        OPatch 13.9.4.2.5
        OPatch Auto OPlan 13.9.4.2.5
Session log file is /tmp/OraInstall2022-09-20_12-04-46PM/install2022-09-20_12-04-46PM.log

Loading products list. Please wait.
 1%
 40%
Loading products. Please wait.
 42%
 43%
 45%
 ...
<进度条省略...>
 ...
 94%
 95%
 97%
 98%
 99%

Updating Libraries

Starting Installations
 1%
 2%
 3%
 ...
<进度条省略...>
 ...
 92%
 93%
 94%
 95%
 96%
Install pending

Installation in progress
 Component : oracle.glcm.logging 1.6.4.0.0 
Copying files for oracle.glcm.logging 1.6.4.0.0 
 Component : oracle.glcm.comdev 7.8.4.0.0 
Copying files for oracle.glcm.comdev 7.8.4.0.0 
 Component : oracle.glcm.dependency 1.8.4.0.0 
Copying files for oracle.glcm.dependency 1.8.4.0.0 
 Component : oracle.glcm.xmldh 3.4.4.0.0 
Copying files for oracle.glcm.xmldh 3.4.4.0.0 
 Component : oracle.glcm.wizard 7.8.4.0.0 
Copying files for oracle.glcm.wizard 7.8.4.0.0 
 Component : oracle.commons.cli.commons.cli 1.3.1.0.0 
Copying files for oracle.commons.cli.commons.cli 1.3.1.0.0 
 Component : oracle.glcm.opatch.common.api 13.9.4.0.0 
Copying files for oracle.glcm.opatch.common.api 13.9.4.0.0 
 Component : oracle.nginst.common 13.9.4.0.0 
Copying files for oracle.nginst.common 13.9.4.0.0 
 Component : oracle.nginst.core 13.9.4.0.0 
Copying files for oracle.nginst.core 13.9.4.0.0 
 Component : oracle.glcm.encryption 2.7.4.0.0 
Copying files for oracle.glcm.encryption 2.7.4.0.0 
 Component : oracle.swd.opatch 13.9.4.2.5 
Copying files for oracle.swd.opatch 13.9.4.2.5 
 Component : oracle.glcm.osys.core 13.9.1.0.0 
Copying files for oracle.glcm.osys.core 13.9.1.0.0 
 Component : oracle.glcm.oplan.core 13.9.4.2.0 
Copying files for oracle.glcm.oplan.core 13.9.4.2.0 
Install successful
Post feature install pending
Post Feature installing
 Feature Set : glcm_common_lib
 Feature Set : commons-cli_1.3.1.0.0
Post Feature installing glcm_common_lib
Post Feature installing commons-cli_1.3.1.0.0
 Feature Set : oracle.glcm.opatch.common.api.classpath
Post Feature installing oracle.glcm.opatch.common.api.classpath
 Feature Set : glcm_common_logging_lib
 Feature Set : oracle.glcm.osys.core.classpath
 Feature Set : commons-cli
 Feature Set : glcm_encryption_lib
Post Feature installing oracle.glcm.osys.core.classpath
Post Feature installing glcm_encryption_lib
Post Feature installing commons-cli
Post Feature installing glcm_common_logging_lib
 Feature Set : oracle.glcm.oplan.core.classpath
Post Feature installing oracle.glcm.oplan.core.classpath
 Feature Set : oracle.glcm.opatchauto.core.classpath
Post Feature installing oracle.glcm.opatchauto.core.classpath
 Feature Set : oracle.glcm.opatchauto.core.binary.classpath
Post Feature installing oracle.glcm.opatchauto.core.binary.classpath
 Feature Set : oracle.glcm.opatchauto.core.actions.classpath
Post Feature installing oracle.glcm.opatchauto.core.actions.classpath
 Feature Set : oracle.glcm.opatchauto.core.wallet.classpath
Post Feature installing oracle.glcm.opatchauto.core.wallet.classpath
Post feature install complete
String substitutions pending
String substituting
 Component : oracle.glcm.logging 1.6.4.0.0 
String substituting oracle.glcm.logging 1.6.4.0.0 
 Component : oracle.glcm.comdev 7.8.4.0.0 
String substituting oracle.glcm.comdev 7.8.4.0.0 
 Component : oracle.glcm.dependency 1.8.4.0.0 
String substituting oracle.glcm.dependency 1.8.4.0.0 
 Component : oracle.glcm.xmldh 3.4.4.0.0 
String substituting oracle.glcm.xmldh 3.4.4.0.0 
 Component : oracle.glcm.wizard 7.8.4.0.0 
String substituting oracle.glcm.wizard 7.8.4.0.0 
 Component : oracle.commons.cli.commons.cli 1.3.1.0.0 
String substituting oracle.commons.cli.commons.cli 1.3.1.0.0 
 Component : oracle.glcm.opatch.common.api 13.9.4.0.0 
String substituting oracle.glcm.opatch.common.api 13.9.4.0.0 
 Component : oracle.nginst.common 13.9.4.0.0 
String substituting oracle.nginst.common 13.9.4.0.0 
 Component : oracle.nginst.core 13.9.4.0.0 
String substituting oracle.nginst.core 13.9.4.0.0 
 Component : oracle.glcm.encryption 2.7.4.0.0 
String substituting oracle.glcm.encryption 2.7.4.0.0 
 Component : oracle.swd.opatch 13.9.4.2.5 
String substituting oracle.swd.opatch 13.9.4.2.5 
 Component : oracle.glcm.osys.core 13.9.1.0.0 
String substituting oracle.glcm.osys.core 13.9.1.0.0 
 Component : oracle.glcm.oplan.core 13.9.4.2.0 
String substituting oracle.glcm.oplan.core 13.9.4.2.0 
String substitutions complete
Link pending
Linking in progress
 Component : oracle.glcm.logging 1.6.4.0.0 
Linking oracle.glcm.logging 1.6.4.0.0 
 Component : oracle.glcm.comdev 7.8.4.0.0 
Linking oracle.glcm.comdev 7.8.4.0.0 
 Component : oracle.glcm.dependency 1.8.4.0.0 
Linking oracle.glcm.dependency 1.8.4.0.0 
 Component : oracle.glcm.xmldh 3.4.4.0.0 
Linking oracle.glcm.xmldh 3.4.4.0.0 
 Component : oracle.glcm.wizard 7.8.4.0.0 
Linking oracle.glcm.wizard 7.8.4.0.0 
 Component : oracle.commons.cli.commons.cli 1.3.1.0.0 
Linking oracle.commons.cli.commons.cli 1.3.1.0.0 
 Component : oracle.glcm.opatch.common.api 13.9.4.0.0 
Linking oracle.glcm.opatch.common.api 13.9.4.0.0 
 Component : oracle.nginst.common 13.9.4.0.0 
Linking oracle.nginst.common 13.9.4.0.0 
 Component : oracle.nginst.core 13.9.4.0.0 
Linking oracle.nginst.core 13.9.4.0.0 
 Component : oracle.glcm.encryption 2.7.4.0.0 
Linking oracle.glcm.encryption 2.7.4.0.0 
 Component : oracle.swd.opatch 13.9.4.2.5 
Linking oracle.swd.opatch 13.9.4.2.5 
 Component : oracle.glcm.osys.core 13.9.1.0.0 
Linking oracle.glcm.osys.core 13.9.1.0.0 
 Component : oracle.glcm.oplan.core 13.9.4.2.0 
Linking oracle.glcm.oplan.core 13.9.4.2.0 
Linking in progress
Link successful
Setup pending
Setup in progress
 Component : oracle.glcm.logging 1.6.4.0.0 
Setting up oracle.glcm.logging 1.6.4.0.0 
 Component : oracle.glcm.comdev 7.8.4.0.0 
Setting up oracle.glcm.comdev 7.8.4.0.0 
 Component : oracle.glcm.dependency 1.8.4.0.0 
Setting up oracle.glcm.dependency 1.8.4.0.0 
 Component : oracle.glcm.xmldh 3.4.4.0.0 
Setting up oracle.glcm.xmldh 3.4.4.0.0 
 Component : oracle.glcm.wizard 7.8.4.0.0 
Setting up oracle.glcm.wizard 7.8.4.0.0 
 Component : oracle.commons.cli.commons.cli 1.3.1.0.0 
Setting up oracle.commons.cli.commons.cli 1.3.1.0.0 
 Component : oracle.glcm.opatch.common.api 13.9.4.0.0 
Setting up oracle.glcm.opatch.common.api 13.9.4.0.0 
 Component : oracle.nginst.common 13.9.4.0.0 
Setting up oracle.nginst.common 13.9.4.0.0 
 Component : oracle.nginst.core 13.9.4.0.0 
Setting up oracle.nginst.core 13.9.4.0.0 
 Component : oracle.glcm.encryption 2.7.4.0.0 
Setting up oracle.glcm.encryption 2.7.4.0.0 
 Component : oracle.swd.opatch 13.9.4.2.5 
Setting up oracle.swd.opatch 13.9.4.2.5 
 Component : oracle.glcm.osys.core 13.9.1.0.0 
Setting up oracle.glcm.osys.core 13.9.1.0.0 
 Component : oracle.glcm.oplan.core 13.9.4.2.0 
Setting up oracle.glcm.oplan.core 13.9.4.2.0 
Setup successful
Save inventory pending
Saving inventory
 97%
Saving inventory complete
 98%
Configuration complete
 Component : glcm_common_logging_lib
Saving the inventory glcm_common_logging_lib
 Component : oracle.glcm.opatch.common.api.classpath
 Component : glcm_encryption_lib
 Component : glcm_common_lib
 Component : svctbl_lib
Saving the inventory oracle.glcm.opatch.common.api.classpath
Saving the inventory glcm_encryption_lib
Saving the inventory glcm_common_lib
Saving the inventory svctbl_lib
 Component : cieCfg_common_rcu_lib
 Component : oracle.glcm.logging
 Component : cieCfg_common_lib
Saving the inventory cieCfg_common_lib
 Component : com.bea.core.binxml_dependencies
Saving the inventory com.bea.core.binxml_dependencies
Saving the inventory oracle.glcm.logging
Saving the inventory cieCfg_common_rcu_lib
 Component : svctbl_jmx_client
Saving the inventory svctbl_jmx_client
 Component : cieCfg_wls_shared_lib
Saving the inventory cieCfg_wls_shared_lib
 Component : cieCfg_wls_lib
Saving the inventory cieCfg_wls_lib
 Component : cieCfg_wls_external_lib
Saving the inventory cieCfg_wls_external_lib
 Component : cieCfg_wls_impl_lib
Saving the inventory cieCfg_wls_impl_lib
 Component : oracle.fmwplatform.fmwprov_lib
Saving the inventory oracle.fmwplatform.fmwprov_lib
 Component : fmwplatform-wlst-dependencies
Saving the inventory fmwplatform-wlst-dependencies
 Component : oracle.fmwplatform.ocp_lib
Saving the inventory oracle.fmwplatform.ocp_lib
 Component : oracle.fmwplatform.ocp_plugin_lib
Saving the inventory oracle.fmwplatform.ocp_plugin_lib
 Component : wlst.wls.classpath
Saving the inventory wlst.wls.classpath
 Component : maven.wls.classpath
Saving the inventory maven.wls.classpath
 Component : glcm_common_logging_lib
Saving the inventory glcm_common_logging_lib
 Component : glcm_encryption_lib
Saving the inventory glcm_encryption_lib
 Component : glcm_common_lib
 Component : oracle.glcm.oplan.core.classpath
Saving the inventory glcm_common_lib
Saving the inventory oracle.glcm.oplan.core.classpath
 Component : oracle.glcm.opatch.common.api.classpath
Saving the inventory oracle.glcm.opatch.common.api.classpath
The install operation completed successfully.
Logs successfully copied to /home/weblogic/install/oraInventory/logs.
[weblogic@Cluster01 ~]$ 

 17.3查看打补丁工具版本

[weblogic@Cluster01 ~]$ sh /home/weblogic/bea/OPatch/opatch version
OPatch Version: 13.9.4.2.5

OPatch succeeded.
[weblogic@Cluster01 ~]$ 

17.4打补丁

[weblogic@Cluster01 ~]$ sh /home/weblogic/bea/OPatch/opatch   apply 
 /home/software/p34236279_122140_Generic.zip
Oracle Interim Patch Installer version 13.9.4.2.5
Copyright (c) 2022, Oracle Corporation.  All rights reserved.

Oracle Home       : /home/weblogic/bea
Central Inventory : /home/weblogic/install/oraInventory
   from           : /home/weblogic/bea/oraInst.loc
OPatch version    : 13.9.4.2.5
OUI version       : 13.9.4.0.0
Log file location : /home/weblogic/bea/cfgtoollogs/opatch/opatch2022-09-20_12-30-30PM_1.log

OPatch detects the Middleware Home as "/home/weblogic/bea"

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   34236279  

Do you want to proceed? [y|n]
y   #根据提示按y键
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/home/weblogic/bea')


Is the local system ready for patching? [y|n]
y  #根据提示按y键
User Responded with: Y
Backing up files...
Applying interim patch '34236279' to OH '/home/weblogic/bea'
ApplySession: Optional component(s) [ oracle.fmwconfig.common.wls.shared, 12.2.1.4.0 ] , [ oracle.jrf.thirdparty.jee, 12.2.1.4.0 ] , [ oracle.jrf.thirdparty.jee, 12.2.1.4.0 ] , [ oracle.webservices.wls.jaxrpc, 12.2.1.4.0 ] , [ oracle.webservices.jrf, 12.2.1.4.0 ] , [ oracle.toplink.doc, 12.2.1.4.0 ]  not present in the Oracle Home or a higher version is found.

Patching component oracle.org.bouncycastle.bcprov.ext.jdk15on, 1.60.0.0.0...
Patching component oracle.org.bouncycastle.bcprov.ext.jdk15on, 1.60.0.0.0...
Patching component oracle.wls.admin.console.en, 12.2.1.4.0...
Patching component oracle.wls.admin.console.en, 12.2.1.4.0...
Patching component oracle.fmwconfig.common.config.shared, 12.2.1.4.0...
Patching component oracle.fmwconfig.common.wls.shared.internal, 12.2.1.4.0...
Patching component oracle.webservices.wls, 12.2.1.4.0...
Patching component oracle.rsa.crypto, 12.2.1.4.0...
Patching component oracle.rsa.crypto, 12.2.1.4.0...
Patching component oracle.wls.jrf.tenancy.common.sharedlib, 12.2.1.4.0...
Patching component oracle.wls.jrf.tenancy.common.sharedlib, 12.2.1.4.0...
Patching component oracle.wls.jrf.tenancy.common.sharedlib, 12.2.1.4.0...
Patching component oracle.org.apache.xmlgraphics.batik.all, 1.11.0.0.1...
Patching component oracle.org.apache.xmlgraphics.batik.all, 1.11.0.0.1...
Patching component oracle.wls.common.nodemanager, 12.2.1.4.0...
Patching component oracle.wls.jrf.tenancy.ee.only.sharedlib, 12.2.1.4.0...
Patching component oracle.mysql, 8.0.14.0.0...
Patching component oracle.mysql, 8.0.14.0.0...
Patching component oracle.com.fasterxml.jackson.jaxrs.jackson.jaxrs.json.provider, 2.9.9.0.0...
Patching component oracle.com.fasterxml.jackson.jaxrs.jackson.jaxrs.json.provider, 2.9.9.0.0...
Patching component oracle.com.fasterxml.jackson.core.jackson.core, 2.9.9.0.0...
Patching component oracle.com.fasterxml.jackson.core.jackson.core, 2.9.9.0.0...
Patching component oracle.org.bouncycastle.bcprov.jdk15on, 1.60.0.0.0...
Patching component oracle.org.bouncycastle.bcprov.jdk15on, 1.60.0.0.0...
Patching component oracle.log4j.log4j, 2.11.1.0.0...
Patching component oracle.log4j.log4j, 2.11.1.0.0...
Patching component oracle.org.bouncycastle.bcpkix.jdk15on, 1.60.0.0.0...
Patching component oracle.org.bouncycastle.bcpkix.jdk15on, 1.60.0.0.0...
Patching component oracle.com.fasterxml.jackson.dataformat.jackson.dataformat.xml, 2.9.9.0.0...
Patching component oracle.com.fasterxml.jackson.dataformat.jackson.dataformat.xml, 2.9.9.0.0...
Patching component oracle.commons.collections.commons.collections, 3.2.2.0.0...
Patching component oracle.commons.collections.commons.collections, 3.2.2.0.0...
Patching component oracle.wls.security.core.sharedlib, 12.2.1.4.0...
Patching component oracle.webservices.base, 12.2.1.4.0...
Patching component oracle.com.fasterxml.jackson.core.jackson.databind, 2.9.9.0.0...
Patching component oracle.com.fasterxml.jackson.core.jackson.databind, 2.9.9.0.0...
Patching component oracle.wls.shared.with.cam, 12.2.1.4.0...
Patching component oracle.com.fasterxml.jackson.core.jackson.annotations, 2.9.9.0.0...
Patching component oracle.com.fasterxml.jackson.core.jackson.annotations, 2.9.9.0.0...
Patching component oracle.wls.common.cam.wlst, 12.2.1.4.0...
Patching component oracle.wls.security.core, 12.2.1.4.0...
Patching component oracle.wls.security.core, 12.2.1.4.0...
Patching component oracle.datadirect, 12.2.1.4.0...
Patching component oracle.datadirect, 12.2.1.4.0...
Patching component oracle.com.fasterxml.jackson.module.jackson.module.jsonschema, 2.9.9.0.0...
Patching component oracle.com.fasterxml.jackson.module.jackson.module.jsonschema, 2.9.9.0.0...
Patching component oracle.com.fasterxml.jackson.module.jackson.module.jaxb.annotations, 2.9.9.0.0...
Patching component oracle.com.fasterxml.jackson.module.jackson.module.jaxb.annotations, 2.9.9.0.0...
Patching component oracle.jrf.toplink, 12.2.1.4.0...
Patching component oracle.org.jboss.logging.jboss.logging.vfinal, 3.3.0.0.0...
Patching component oracle.org.jboss.logging.jboss.logging.vfinal, 3.3.0.0.0...
Patching component oracle.wls.admin.console.nonen, 12.2.1.4.0...
Patching component oracle.wls.admin.console.nonen, 12.2.1.4.0...
Patching component oracle.com.fasterxml.jackson.jaxrs.jackson.jaxrs.base, 2.9.9.0.0...
Patching component oracle.com.fasterxml.jackson.jaxrs.jackson.jaxrs.base, 2.9.9.0.0...
Patching component oracle.wls.evaluation.database, 12.2.1.4.0...
Patching component oracle.wls.evaluation.database, 12.2.1.4.0...
Patching component oracle.wls.libraries, 12.2.1.4.0...
Patching component oracle.wls.libraries, 12.2.1.4.0...
Patching component oracle.wls.libraries, 12.2.1.4.0...
Patching component oracle.wls.core.app.server, 12.2.1.4.0...
Patching component oracle.wls.core.app.server, 12.2.1.4.0...
Patching component oracle.wls.core.app.server, 12.2.1.4.0...
Patching component oracle.wls.jrf.tenancy.common, 12.2.1.4.0...
Patching component oracle.wls.jrf.tenancy.common, 12.2.1.4.0...
Patch 34236279 successfully applied.
Log file location: /home/weblogic/bea/cfgtoollogs/opatch/opatch2022-09-20_12-30-30PM_1.log

OPatch succeeded.
[weblogic@Cluster01 ~]$ 

17.5查看补丁列表

[weblogic@Cluster01 ~]$ sh /home/weblogic/bea/OPatch/opatch  lspatches
34236279;WLS PATCH SET UPDATE 12.2.1.4.220602

OPatch succeeded.
[weblogic@Cluster01 ~]$ 

 17.6查看补丁是否应用上

[weblogic@Cluster01 ~]$ sh /home/weblogic/bea/OPatch/opatch  lsinventory
Oracle Interim Patch Installer version 13.9.4.2.5
Copyright (c) 2022, Oracle Corporation.  All rights reserved.

Oracle Home       : /home/weblogic/bea
Central Inventory : /home/weblogic/install/oraInventory
   from           : /home/weblogic/bea/oraInst.loc
OPatch version    : 13.9.4.2.5
OUI version       : 13.9.4.0.0
Log file location : /home/weblogic/bea/cfgtoollogs/opatch/opatch2022-09-20_12-37-02PM_1.log

OPatch detects the Middleware Home as "/home/weblogic/bea"

Lsinventory Output file location : /home/weblogic/bea/cfgtoollogs/opatch/lsinv/lsinventory2022-09-20_12-37-02PM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: Cluster01
ARU platform id: 226
ARU platform description:: Linux x86-64

Interim patches (1) :

Patch  34236279     : applied on Tue Sep 20 12:31:57 CST 2022
Unique Patch ID:  24804177
Patch description:  "WLS PATCH SET UPDATE 12.2.1.4.220602"
   Created on 2 Jun 2022, 21:32:46 hrs PST8PDT
   Bugs fixed:
     32201179, 31671559, 29247835, 34044945, 30670689, 27703270, 32697451
     29940841, 31724565, 29660156, 33580024, 31770512, 32965618, 32064362
     30692988, 31157988, 33480646, 33890487, 33422662, 33328978, 33277149
     29671344, 31199699, 33791665, 30558254, 31526201, 32228228, 30801769
     32649503, 34026019, 31525147, 34016065, 33876615, 30568713, 31918617
     30597194, 32312961, 27291550, 31510290, 32920991, 32593893, 33379618
     30961904, 34069658, 30459026, 33828242, 32976692, 32520971, 31287540
     30885237, 32503912, 31742292, 33045273, 30285053, 31011293, 33636224
     32875528, 31657139, 33676277, 25900775, 18183882, 32415913, 32868847
     33245345, 30341541, 26547727, 31808363, 32883876, 30837932, 31975423
     33293539, 32950042, 33666810, 33671996, 31913015, 30874677, 30814590
     33730691, 33470327, 30734182, 30362026, 32962304, 29769772, 31091695
     32431772, 32408938, 33171421, 32891581, 33560373, 30885114, 31142740
     30563848, 30624882, 32893667, 33114718, 30067299, 33586390, 28294508
     31113242, 32425607, 30245934, 32118304, 29971088, 33890469, 32651810
     31498405, 30478451, 32235275, 30965440, 33166329, 33329852, 29630055
     31088577, 33034990, 33494788, 33164116, 33798087, 31234573, 30718589
     32097062, 31873968, 25973136, 32639821, 34130143, 33735326, 33691226
     30964331, 30589563, 30362086, 33660731, 33560637, 34172370, 30866037
     33216541, 29906301, 30284059, 33613719, 30326976, 30633620, 32301793
     32959063, 30155056, 31160218, 33671762, 32077694, 30469093, 33015183
     33767326, 31470145, 30342923, 31297042, 33270137, 30580458, 34166452
     31332264, 32248716, 32528774, 32054481, 33063225, 25348765, 30543380
     30739376, 33207639, 30958807, 33691381, 32214441, 30740009, 32519960
     31816475, 31207149, 33170754, 29878681, 32508456, 30771358, 31401659
     30885217, 33287665, 30652362, 31765567, 34185325, 32847474, 33152312
     32497814, 33964662, 33005860, 31567049, 33617787, 26444945, 31184158
     32108759, 34092344, 32307656, 30469341, 30465861, 30230430, 31232471
     33145710, 30510407, 30615058, 31380363, 31583896, 31247235, 33625910
     33628018, 34197839, 30729141, 31502307, 32832099, 31047981, 31316252
     31118905, 33355727, 34132210, 33349324, 30068341, 31441174, 33270388
     30885128, 30912052, 32412974, 34181077, 32371861, 32016868, 30295025
     34087946, 32069620, 29742586, 34096039, 33362866, 32875564, 33380581
     33261059, 32068710, 34033370, 25219796, 32244262, 31475287, 31483446
     33666033, 28852411, 32153389, 30998532, 31234666, 30884852, 30838007
     32235872, 31332368, 32230661, 33792809, 32373306, 34102404, 33542139
     33562620, 30153412, 34055705, 29026751, 31765550, 31353368, 30656708
     33181541, 34157256, 30143011, 32373197, 31564423, 34069324, 32953480
     32211968, 33825902, 33446922, 33670829, 29449188, 31359854, 31833635
     30468443, 33297017

--------------------------------------------------------------------------------

OPatch succeeded.
[weblogic@Cluster01 ~]$ sh /home/weblogic/bea/OPatch/opatch  lsinventory  | grep 34236279
Patch  34236279     : applied on Tue Sep 20 12:31:57 CST 2022
[weblogic@Cluster01 ~]$ 

18、启动weblogic

18.1启动

[weblogic@Basis01 ~]$  cd /home/weblogic/bea/user_projects/domains/base_domain/bin/
[weblogic@Basis01 bin]$  nohup ./startWebLogic.sh &   #后台运行脚本,会在当前目录生成脚本日志,通过日志查看启动情况
[1] 23092
     nohup: ignoring input and appending output to ‘nohup.out’

[weblogic@Cluster01 bin]$ 

18.2查看启动日志 ,看到双running即表示启动成功

[weblogic@Cluster01 bin]$ tail -50f nohup.out 
***************************************************
*  To start WebLogic Server, use a username and   *
*  password assigned to an admin-level user.  For *
*  server administration, use the WebLogic Server *
*  console at http://hostname:port/console        *
***************************************************
Starting WLS with line:
/usr/java/jdk1.8.0_341/bin/java -server   -Xms256m -Xmx512m -XX:CompileThreshold=8000 -cp /home/weblogic/bea/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=AdminServer -Djava.security.policy=/home/weblogic/bea/wlserver/server/lib/weblogic.policy  -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader  -javaagent:/home/weblogic/bea/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/home/weblogic/bea/wlserver/server -Dweblogic.home=/home/weblogic/bea/wlserver/server      weblogic.Server
<Sep 20, 2022 12:40:16 PM CST> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.> 
<Sep 20, 2022 12:40:16 PM CST> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.> 
<Sep 20, 2022 12:40:17 PM CST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.341-b10 from Oracle Corporation.> 
<Sep 20, 2022 12:40:17 PM CST> <Info> <RCM> <BEA-2165021> <"ResourceManagement" is not enabled in this JVM. Enable "ResourceManagement" to use the WebLogic Server "Resource Consumption Management" feature. To enable "ResourceManagement", you must specify the following JVM options in the WebLogic Server instance in which the JVM runs: -XX:+UnlockCommercialFeatures -XX:+ResourceManagement.> 
<Sep 20, 2022 12:40:21 PM CST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.2.1.4.0
OPatch Patches:
34236279;24804177;Tue Sep 20 12:31:57 CST 2022;WLS PATCH SET UPDATE 12.2.1.4.220602> 
<Sep 20, 2022 12:40:21 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> 
<Sep 20, 2022 12:40:21 PM CST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.> 
<Sep 20, 2022 12:40:21 PM CST> <Info> <WorkManager> <BEA-002942> <CMM memory level becomes 0. Setting standby thread pool size to 256.> 
<Sep 20, 2022 12:40:22,411 PM CST> <Notice> <LoggingService> <BEA-320400> <The log file /home/weblogic/bea/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms, such as Windows.> 
<Sep 20, 2022 12:40:22,411 PM CST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /home/weblogic/bea/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log00004. Log messages will continue to be logged in /home/weblogic/bea/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log.> 
<Sep 20, 2022 12:40:22,424 PM CST> <Notice> <Log Management> <BEA-170019> <The server log file weblogic.logging.FileStreamHandler instance=1617040485
Current log file=/home/weblogic/bea/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log
Rotation dir=/home/weblogic/bea/user_projects/domains/base_domain/servers/AdminServer/logs
 is opened. All server side log events will be written to this file.> 
<Sep 20, 2022 12:40:22,666 PM CST> <Notice> <Security> <BEA-090946> <Security pre-initializing using security realm: myrealm> 
<Sep 20, 2022 12:40:22,966 PM CST> <Notice> <Security> <BEA-090947> <Security post-initializing using security realm: myrealm> 
<Sep 20, 2022 12:40:24,015 PM CST> <Notice> <Security> <BEA-090082> <Security initialized using administrative security realm: myrealm> 
<Sep 20, 2022 12:40:24,385 PM CST> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://192.168.194.75:7001/jndi/weblogic.management.mbeanservers.runtime.> 
<Sep 20, 2022 12:40:24,569 PM CST> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://192.168.194.75:7001/jndi/weblogic.management.mbeanservers.domainruntime.> 
<Sep 20, 2022 12:40:24,624 PM CST> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://192.168.194.75:7001/jndi/weblogic.management.mbeanservers.edit.> 
<Sep 20, 2022 12:40:25,332 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.> 
<Sep 20, 2022 12:40:25,332 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> 
<Sep 20, 2022 12:40:25,371 PM CST> <Notice> <Log Management> <BEA-170036> <The Logging monitoring service timer has started to check for logged message counts every 30 seconds.> 
<Sep 20, 2022 12:40:25,509 PM CST> <Notice> <Security> <BEA-090171> <Loading the identity certificate and private key stored under the alias DemoIdentity from the jks keystore file /home/weblogic/bea/user_projects/domains/base_domain/security/DemoIdentity.jks.> 
<Sep 20, 2022 12:40:25,512 PM CST> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /home/weblogic/bea/wlserver/server/lib/DemoTrust.jks.> 
<Sep 20, 2022 12:40:25,514 PM CST> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /usr/java/jdk1.8.0_341/jre/lib/security/cacerts.> 
<Sep 20, 2022 12:40:25,555 PM CST> <Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.> 
<Sep 20, 2022 12:40:25,672 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.> 
<Sep 20, 2022 12:40:25,753 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING.> 
<Sep 20, 2022 12:40:25,782 PM CST> <Warning> <Server> <BEA-002611> <The hostname "localhost", maps to multiple IP addresses: 127.0.0.1, 0:0:0:0:0:0:0:1.> 
<Sep 20, 2022 12:40:25,783 PM CST> <Warning> <Server> <BEA-002611> <The hostname "Cluster01", maps to multiple IP addresses: 192.168.194.75, fe80:0:0:0:c32:8e9e:d191:157e%2.> 
<Sep 20, 2022 12:40:25,783 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Sep 20, 2022 12:40:25,783 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.194.75:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Sep 20, 2022 12:40:25,783 PM CST> <Notice> <WebLogicServer> <BEA-000331> <Started the WebLogic Server Administration Server "AdminServer" for domain "base_domain" running in development mode.> 
<Sep 20, 2022 12:40:25,784 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 0:0:0:0:0:0:0:1%lo:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Sep 20, 2022 12:40:25,784 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Sep 20, 2022 12:40:25,784 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.194.75:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Sep 20, 2022 12:40:25,784 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 0:0:0:0:0:0:0:1%lo:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Sep 20, 2022 12:40:25,792 PM CST> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.> 
<Sep 20, 2022 12:40:25,797 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.> 

 19、打开控制台

web浏览器打开http://ip:端口/console访问

安装完成。 

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: 很高兴为您提供CentOS 7搭建Hadoop 3.3.集群的手记。 1. 安装Java 首先,需要安装Java。可以使用以下命令安装OpenJDK 8: sudo yum install java-1.8.-openjdk-devel 2. 下载Hadoop 下载Hadoop 3.3.版本,并将其解压缩到/opt目录下: sudo tar -xzf hadoop-3.3..tar.gz -C /opt 3. 配置Hadoop 进入Hadoop目录并编辑hadoop-env.sh文件: cd /opt/hadoop-3.3. sudo nano etc/hadoop/hadoop-env.sh 将JAVA_HOME设置为Java安装路径: export JAVA_HOME=/usr/lib/jvm/java-1.8.-openjdk 编辑core-site.xml文件: sudo nano etc/hadoop/core-site.xml 添加以下内容: <configuration> <property> <name>fs.defaultFS</name> <value>hdfs://localhost:900</value> </property> </configuration> 编辑hdfs-site.xml文件: sudo nano etc/hadoop/hdfs-site.xml 添加以下内容: <configuration> <property> <name>dfs.replication</name> <value>1</value> </property> <property> <name>dfs.namenode.name.dir</name> <value>/opt/hadoop-3.3./data/namenode</value> </property> <property> <name>dfs.datanode.data.dir</name> <value>/opt/hadoop-3.3./data/datanode</value> </property> </configuration> 编辑mapred-site.xml文件: sudo cp etc/hadoop/mapred-site.xml.template etc/hadoop/mapred-site.xml sudo nano etc/hadoop/mapred-site.xml 添加以下内容: <configuration> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> </configuration> 编辑yarn-site.xml文件: sudo nano etc/hadoop/yarn-site.xml 添加以下内容: <configuration> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> <property> <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name> <value>org.apache.hadoop.mapred.ShuffleHandler</value> </property> </configuration> 4. 启动Hadoop 格式化Hadoop文件系统: sudo bin/hdfs namenode -format 启动Hadoop: sudo sbin/start-all.sh 5. 验证Hadoop 在浏览器中访问http://localhost:987/,可以看到Hadoop集群的状态。 在Hadoop集群中创建一个目录: sudo bin/hdfs dfs -mkdir /test 在Hadoop集群中上传一个文件: sudo bin/hdfs dfs -put etc/hadoop/core-site.xml /test 在Hadoop集群中查看文件: sudo bin/hdfs dfs -ls /test 以上就是CentOS 7搭建Hadoop 3.3.集群的手记,希望对您有所帮助。 ### 回答2: 本篇文章主要介绍了如何在CentOS7系统上搭建Hadoop-3.3.0的集群,并在这个过程中遇到的一些问题和解决方案。 一、环境准备 操作系统:CentOS7 JDK版本:1.8.0_282 Hadoop版本:hadoop-3.3.0.tar.gz(可自行到官网下载) 二、系统设置 1、关闭防火墙 因为Hadoop集群需要互相通信和数据传输,所以需要关闭系统的防火墙,以避免互相之间的阻拦。 systemctl stop firewalld systemctl disable firewalld 2、设置hostname 为了方便节点之间的通信,需要给每个节点设置一个唯一的hostname。可以通过以下命令设置: hostnamectl set-hostname <hostname> 三、安装 JDK Hadoop运行依赖于JDK,需要先安装JDK。这里默认已经安装了openjdk-1.8.0_282版本,因此就不再重复说明了。如果您还没有安装JDK,可以通过以下命令进行安装: yum install java-1.8.0-openjdk-devel.x86_64 四、安装 Hadoop 1、解压缩 Hadoop 将下载好的hadoop-3.3.0.tar.gz复制到/opt/目录下,并解压缩: tar -zxvf hadoop-3.3.0.tar.gz 2、配置Hadoop环境变量 配置Hadoop环境变量,可以方便我们在任何地方都能够使用hadoop相关命令。在/etc/profile.d/目录下创建一个hadoop.sh文件,输入以下内容: export HADOOP_HOME=/opt/hadoop-3.3.0 export PATH=$HADOOP_HOME/bin:$PATH 最后执行以下命令,让环境变量生效: source /etc/profile 3、配置Hadoop 进入hadoop-3.3.0目录下,修改etc/hadoop/hadoop-env.sh文件,将JAVA_HOME指向正确的JDK目录: export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64 接下来修改etc/hadoop/core-site.xml文件,添加以下配置: <configuration> <property> <name>fs.defaultFS</name> <value>hdfs://<NameNode_IP>:9000</value> </property> </configuration> 其中,NameNode_IP需要替换为NameNode的IP地址。 修改etc/hadoop/hdfs-site.xml文件,添加以下配置: <configuration> <property> <name>dfs.replication</name> <value>2</value> </property> <property> <name>dfs.namenode.name.dir</name> <value>/opt/hdfs/namenode</value> </property> <property> <name>dfs.datanode.data.dir</name> <value>/opt/hdfs/datanode</value> </property> <property> <name>dfs.namenode.datanode.registration.ip-hostname-check</name> <value>false</value> </property> </configuration> 其中,dfs.replication表示副本数,dfs.namenode.name.dir表示NameNode元数据的存放路径,dfs.datanode.data.dir表示DataNode数据的存放路径,dfs.namenode.datanode.registration.ip-hostname-check设置为false表示关闭IP和hostname的检查,否则可能会导致节点无法正常注册。 最后,在etc/hadoop/mapred-site.xml和etc/hadoop/yarn-site.xml文件中添加以下内容: mapred-site.xml: <configuration> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> </configuration> yarn-site.xml: <configuration> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> </configuration> 五、配置ssh免密登录 在Hadoop集群中,各个节点之间需要相互通信,并且需要使用ssh远程登录操作。为了方便操作,可以实现ssh免密登录,即在各个节点之间可以直接相互访问而无需输入密码。具体实现步骤如下: 1、在每个节点上生成公钥和私钥 ssh-keygen -t rsa 2、将公钥拷贝到各个节点上 ssh-copy-id -i ~/.ssh/id_rsa.pub <hostname> 其中,<hostname>需要替换成对应节点的hostname。 3、测试是否成功 ssh <hostname> 如果可以直接登录而无需输入密码,则表示ssh免密登录配置成功。 六、启动Hadoop集群 1、启动Hadoop 首先需要启动NameNode和DataNode,使用以下命令启动: hadoop-daemon.sh start namenode hadoop-daemon.sh start datanode 然后启动ResourceManager和NodeManager,使用以下命令启动: yarn-daemon.sh start resourcemanager yarn-daemon.sh start nodemanager 启动成功后使用jps命令查看进程,看是否启动正常。 2、验证Hadoop 在启动Hadoop集群之后,可以通过以下命令验证是否正常: hadoop fs -mkdir /test hadoop fs -ls / 如果命令执行没有报错,则表示Hadoop集群启动成功并且在操作系统上正常运行。 以上便是在CentOS7系统上搭建Hadoop-3.3.0集群的过程。在实际操作中可能还会遇到一些其他的问题,需要我们不断的尝试和调试。相信通过这篇文章,读者可以对Hadoop的安装和配置有更深入的理解,并可以顺利搭建自己的Hadoop集群。 ### 回答3: CentOS 7是一种广泛使用的Linux操作系统,用于服务器和桌面应用程序。Hadoop是一个开源的分布式计算框架,专门用于处理大规模数据。在本文中,将介绍如何在CentOS 7上安装Hadoop 3.3.0,并建立Hadoop集群。 1. 安装Java 由于Hadoop是使用Java编写的,因此必须首先在系统上安装Java。可以使用以下命令来安装Oracle Java: ```shell $ sudo yum install java-1.8.0-openjdk-devel ``` Java将安装在`/usr/lib/jvm/java-1.8.0-openjdk`目录中。 2. 配置DNS 为了更好地管理Hadoop集群,可以将每个节点的IP地址映射到相应的主机名。可以在/etc/hosts文件中添加这些条目。例如,假设存在以下主机: - 192.168.1.10:master - 192.168.1.11:slave1 - 192.168.1.12:slave2 可以在每个节点上编辑/etc/hosts文件,添加以下内容: ```shell 192.168.1.10 master 192.168.1.11 slave1 192.168.1.12 slave2 ``` 3. 安装Hadoop 可以从Hadoop官方网站下载Hadoop二进制文件,或者使用以下命令下载并解压缩最新版本: ```shell $ wget https://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/hadoop-3.3.0/hadoop-3.3.0.tar.gz $ tar -xzvf hadoop-3.3.0.tar.gz -C /opt ``` Hadoop将解压缩到/opt/hadoop-3.3.0目录中。 4. 配置Hadoop 接下来需要配置Hadoop。可以在/opt/hadoop-3.3.0/etc/hadoop目录中找到所有Hadoop配置文件。必须编辑以下文件: - core-site.xml - hdfs-site.xml - mapred-site.xml - yarn-site.xml 第一个文件是core-site.xml。在每个节点上打开此文件,并添加以下配置: ```xml <configuration> <property> <name>fs.defaultFS</name> <value>hdfs://master:9000/</value> </property> </configuration> ``` 第二个文件是hdfs-site.xml。在每个节点上打开此文件,并添加以下配置: ```xml <configuration> <property> <name>dfs.replication</name> <value>2</value> </property> <property> <name>dfs.namenode.name.dir</name> <value>/opt/hadoop-3.3.0/data/namenode</value> </property> <property> <name>dfs.datanode.data.dir</name> <value>/opt/hadoop-3.3.0/data/datanode</value> </property> </configuration> ``` 第三个文件是mapred-site.xml。在每个节点上打开此文件,并添加以下配置: ```xml <configuration> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> </configuration> ``` 最后一个文件是yarn-site.xml。在每个节点上打开此文件,并添加以下配置: ```xml <configuration> <property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> <property> <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name> <value>org.apache.hadoop.mapred.ShuffleHandler</value> </property> </configuration> ``` 5. 配置SSH 为了在集群节点之间进行通信,必须配置SSH。可以使用以下命令在每个节点上安装SSH客户端和服务器: ```shell $ sudo yum install openssh-server openssh-clients ``` 要在所有节点上免密码认证,必须使用以下命令生成SSH秘钥: ```shell $ ssh-keygen -t rsa ``` 按照默认设置创建SSH秘钥对,并在使用此命令的过程中将公共SSH秘钥添加到所有节点上的~/.ssh/authorized_keys文件中: ```shell $ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys ``` 6. 启动Hadoop 现在,可以在集群节点上启动Hadoop。首先要格式化NameNode: ```shell $ /opt/hadoop-3.3.0/bin/hdfs namenode -format ``` 然后,在master节点上启动Hadoop: ```shell $ /opt/hadoop-3.3.0/sbin/start-all.sh ``` 这将启动Hadoop集群中的所有节点。可以在每个节点上检查日志,以确保节点正在正确运行: ```shell $ tail -f /opt/hadoop-3.3.0/logs/*.log ``` 7. 使用Hadoop 现在,可以在Hadoop集群上运行MapReduce作业。可以使用Hadoop的example程序来运行简单的MapReduce任务。例如,可以使用以下命令来运行wordcount程序: ```shell $ /opt/hadoop-3.3.0/bin/hadoop jar /opt/hadoop-3.3.0/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.3.0.jar wordcount input output ``` 该命令将从input目录中读取数据,并将结果写入output目录。可以使用以下命令查看输出: ```shell $ /opt/hadoop-3.3.0/bin/hdfs dfs -cat output/* ``` 以上是搭建Hadoop集群的基本步骤,如果需要实现更复杂的功能,可以在这些基本步骤的基础上进行进一步的配置和调整。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值