Oracle中間件 12c軟件安裝及域的創建配置

軟件下載地址

https://www.oracle.com/technetwork/middleware/fusion-middleware/downloads/index.html

https://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html

配置java環境變量

[bea@redhat6 data]$ source /home/tyusr/.bashrc

[bea@redhat6 data]$ java

創建應答文件

[bea@redhat6 data]$ ll

total 1825308

-rw-r--r-- 1 bea bea 838986083 Apr 26 01:13 fmw_12.2.1.3.0_wls_Disk1_1of1.zip

-rwxr-xr-x 1 bea bea 839208313 Aug 21 2017 fmw_12.2.1.3.0_wls.jar

-rw-r--r-- 1 bea bea 9063 Aug 8 2017 fmw_12213_readme.htm

drwxr-xr-x 8 bea bea 4096 Mar 28 2018 jdk1.8.0_171

-rw-r--r-- 1 bea bea 190890122 Apr 26 01:14 jdk-8u171-linux-x64.tar.gz

應答文件1

注意:用哪個用戶安裝weblogic,inst_group後面添加哪個賬戶。

[bea@redhat6 data]$ touch oraInst.loc

[bea@redhat6 data]$ cat oraInst.loc

inventory_loc=/data/oraInventory

inst_group=bea

注意兩個應答文件字母拼寫的不同及大小寫

應答文件2

[bea@redhat6 data]$ touch wls.rsp

[bea@redhat6 data]$ cat wls.rsp

[ENGING]

Response File Version=1.0.0.0.0

[GENERIC]

ORACLE_HOME=/data/weblogic

INSTALL_TYPE=WebLogic Server

注意fmw_12.2.1.3.0_wls.jar文件的權限

[bea@redhat6 data]$ ll

total 1825312

-rw-r--r-- 1 bea bea 838986083 Apr 26 01:13 fmw_12.2.1.3.0_wls_Disk1_1of1.zip

-rwxr-xr-x 1 bea bea 839208313 Aug 21 2017 fmw_12.2.1.3.0_wls.jar

-rw-r--r-- 1 bea bea 9063 Aug 8 2017 fmw_12213_readme.htm

drwxr-xr-x 8 bea bea 4096 Mar 28 2018 jdk1.8.0_171

-rw-r--r-- 1 bea bea 190890122 Apr 26 01:14 jdk-8u171-linux-x64.tar.gz

-rw-rw-r-- 1 bea bea 49 Apr 26 01:22 oraInst.loc

-rw-rw-r-- 1 bea bea 0 Apr 26 01:22 wls.rsp

[bea@redhat6 data]$ ls

fmw_12.2.1.3.0_wls_Disk1_1of1.zip fmw_12213_readme.htm jdk-8u171-linux-x64.tar.gz wls.rsp

fmw_12.2.1.3.0_wls.jar jdk1.8.0_171 oraInst.loc

weblogic軟件的安裝

[bea@redhat6 data]$ java -jar fmw_12.2.1.3.0_wls.jar -silent -responseFile /data/wls.rsp -invPtrLoc /data/oraInst.loc

Launcher log file is /tmp/OraInstall2019-04-26_01-26-44AM/launcher2019-04-26_01-26-44AM.log.

Extracting the installer . . . . . . . . . Done

Checking if CPU speed is above 300 MHz. Actual 2594.160 MHz Passed

Checking swap space: must be greater than 512 MB. Actual 1983 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 10363 MB Passed

Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2019-04-26_01-26-44AM

Log: /tmp/OraInstall2019-04-26_01-26-44AM/install2019-04-26_01-26-44AM.log

Copyright (c) 1996, 2017, 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

Actual Result: redhat-6.6

Check complete. The overall result of this check is: Passed

CertifiedVersions Check: Success.

Starting check : CheckJDKVersion

Expected result: 1.8.0_131

Actual Result: 1.8.0_171

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.3.0 completed successfully.

Logs successfully copied to /data/oraInventory/logs.

[bea@redhat6 data]$

[bea@redhat6 data]$

[bea@redhat6 data]$ ll ##注意,12c的zip壓縮包解壓後,得到的文件(fmw_12.2.1.3.0_wls.jar)沒有寫權限,需要手頭添加

total 1825324

-rw-r--r-- 1 bea bea 838986083 Apr 26 01:13 fmw_12.2.1.3.0_wls_Disk1_1of1.zip

-rwxr-xr-x 1 bea bea 839208313 Aug 21 2017 fmw_12.2.1.3.0_wls.jar

-rw-r--r-- 1 bea bea 9063 Aug 8 2017 fmw_12213_readme.htm

drwxr-xr-x 8 bea bea 4096 Mar 28 2018 jdk1.8.0_171

-rw-r--r-- 1 bea bea 190890122 Apr 26 01:14 jdk-8u171-linux-x64.tar.gz

-rw-rw-r-- 1 bea bea 49 Apr 26 01:22 oraInst.loc

drwxrwx--- 6 bea bea 4096 Apr 26 01:29 oraInventory

drwxr-x--- 10 bea bea 4096 Apr 26 01:28 weblogic

-rw-rw-r-- 1 bea bea 108 Apr 26 01:23 wls.rsp

[bea@redhat6 bin]$ pwd

/data/weblogic/wlserver/server/bin

[bea@redhat6 bin]$ ls

eclipse.sh saveMemory.sh setWLSEnv.sh startNodeManager.sh startRSDaemon.sh stopNodeManager.sh stopRSDaemon.sh

[bea@redhat6 bin]$ ./setWLSEnv.sh

CLASSPATH=/data/jdk1.8.0_171/lib/tools.jar:/data/weblogic/wlserver/modules/features/wlst.wls.classpath.jar:

PATH=/data/weblogic/wlserver/server/bin:/data/weblogic/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.9.8.0.0/apache-ant-1.9.8/bin:/data/jdk1.8.0_171/jre/bin:/data/jdk1.8.0_171/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/bea/bin:/data/jdk1.8.0_171/jre/bin:/data/jdk1.8.0_171/bin:/data/weblogic/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin

Your environment has been set.

[bea@redhat6 bin]$

方法1,字符

手動創建域目錄

[bea@redhat6 data]$mkdir -p /data/weblogic/user_projects/domains/domain120/

查找wlst腳本工具

[bea@redhat6 weblogic]$ cd wlserver/common/templates/scripts/wlst/

[bea@redhat6 wlst]$ ls

basicWLSDomain.py

將腳本文件拷貝到域目錄下

[bea@redhat6 wlst]$ cp basicWLSDomain.py /data/weblogic/user_projects/domains/domain120/

WLST:weblogic>

weblogic腳本工具是一種命令行腳本界面,系統管理員和操作員用它來監視和管理weblogic server實例以及域。wlst腳本基於java腳本解釋器Python。

原始建域腳本

[root@redhat6 wlst]# cat -n basicWLSDomain.py

1 #======================================================================

2 # This is an example of a simple WLST offline configuration>

3 # a simple WebLogic domain using the Basic WebLogic Server Domain template. The>

4 # demonstrates how to open a domain template, create and edit configuration objects,

5 # and write the domain configuration information to the specified directory.

6 #

7 # This sample uses the demo Derby Server that is installed with your product.

8 # Before starting the Administration Server, you should start the demo Derby server

9 # by issuing one of the following commands:

10 #

11 # Windows: WL_HOME\\common\\derby\\bin\\startNetworkServer.cmd

12 # UNIX: WL_HOME/common/derby/bin/startNetworkServer.sh

13 #

14 # (WL_HOME refers to the top-level installation directory for WebLogic Server.)

15 #

16 # The sample consists of a single server, representing a typical development environment.

17 # This type of configuration is not recommended for production environments.

18 #

19 # Please note that some of the values used in this>

20 # your WebLogic installation and the template you are using.

21 #

22 # Usage:

23 # java weblogic.WLST <wlst>

24 #

25 # Where:

26 # <wlst> specifies the full path to the WLST>

27 #======================================================================

28

29 #======================================================================

30 # Open a domain template.

31 #======================================================================

32

33 readTemplate("/data/weblogic/wlserver/common/templates/wls/wls.jar")

34

35 #======================================================================

36 # Configure the Administration Server and SSL port.

37 #

38 # To enable access by both local and remote processes, you should not set the

39 # listen address for the server instance (that is, it should be left blank or not set).

40 # In this case, the server instance will determine the address of the machine and

41 # listen on it.

42 #======================================================================

43

44 cd('Servers/AdminServer')

45 set('ListenAddress','')

46 set('ListenPort', 7001)

47

48 create('AdminServer','SSL')

49 cd('SSL/AdminServer')

50 set('Enabled', 'True')

51 set('ListenPort', 7002)

52

53 #======================================================================

54 # Define the user password for weblogic.

55 #======================================================================

56

57 cd('/')

58 cd('Security/base_domain/User/weblogic')

59 # Please set password here before using this>

60

61 #======================================================================

62 # Create a JMS Server.

63 #======================================================================

64

65 cd('/')

66 create('myJMSServer', 'JMSServer')

67

68 #======================================================================

69 # Create a JMS System resource.

70 #======================================================================

71

72 cd('/')

73 create('myJmsSystemResource', 'JMSSystemResource')

74 cd('JMSSystemResource/myJmsSystemResource/JmsResource/NO_NAME_0')

75

76 #======================================================================

77 # Create a JMS Queue and its subdeployment.

78 #======================================================================

79

80 myq=create('myQueue','Queue')

81 myq.setJNDIName('jms/myqueue')

82 myq.setSubDeploymentName('myQueueSubDeployment')

83

84 cd('/')

85 cd('JMSSystemResource/myJmsSystemResource')

86 create('myQueueSubDeployment', 'SubDeployment')

87

88 #======================================================================

89 # Create and configure a JDBC Data Source, and sets the JDBC user.

90 #======================================================================

91

92 cd('/')

93 create('myDataSource', 'JDBCSystemResource')

94 cd('JDBCSystemResource/myDataSource/JdbcResource/myDataSource')

95 create('myJdbcDriverParams','JDBCDriverParams')

96 cd('JDBCDriverParams/NO_NAME_0')

97 set('DriverName','org.apache.derby.jdbc.ClientDriver')

98 set('URL','jdbc:derby://localhost:1527/db;create=true')

99 set('PasswordEncrypted', 'PBPUBLIC')

100 set('UseXADataSourceInterface', 'false')

101 create('myProps','Properties')

102 cd('Properties/NO_NAME_0')

103 create('user', 'Property')

104 cd('Property/user')

105 cmo.setValue('PBPUBLIC')

106

107 cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource')

108 create('myJdbcDataSourceParams','JDBCDataSourceParams')

109 cd('JDBCDataSourceParams/NO_NAME_0')

110 set('JNDIName', java.lang.String("myDataSource_jndi"))

111

112 cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource')

113 create('myJdbcConnectionPoolParams','JDBCConnectionPoolParams')

114 cd('JDBCConnectionPoolParams/NO_NAME_0')

115 set('TestTableName','SYSTABLES')

116

117 #======================================================================

118 # Target resources to the servers.

119 #======================================================================

120

121 cd('/')

122 assign('JMSServer', 'myJMSServer', 'Target', 'AdminServer')

123 assign('JMSSystemResource.SubDeployment', 'myJmsSystemResource.myQueueSubDeployment', 'Target', 'myJMSServer')

124 assign('JDBCSystemResource', 'myDataSource', 'Target', 'AdminServer')

125

126 #======================================================================

127 # Write the domain and close the domain template.

128 #======================================================================

129

130 setOption('OverwriteDomain', 'true')

131 writeDomain('/data/weblogic/user_projects/domains/basicWLSDomain')

132 closeTemplate()

133

134 #======================================================================

135 # Exit WLST.

136 #=====================================================================

137

138 exit()

修改後的建域腳本

從62(Create a JMS Server.)到127 (Write the domain and close the domain template.)所有的內容都刪除。同時注意修改domain的目錄(131 writeDomain的相關內容)。

[root@redhat6 domain120]# cat -n basicWLSDomain.py

1 #=================================================================

2 # This is an example of a simple WLST offline configuration>

3 # a simple WebLogic domain using the Basic WebLogic Server Domain template. The>

4 # demonstrates how to open a domain template, create and edit configuration objects,

5 # and write the domain configuration information to the specified directory.

6 #

7 # This sample uses the demo Derby Server that is installed with your product.

8 # Before starting the Administration Server, you should start the demo Derby server

9 # by issuing one of the following commands:

10 #

11 # Windows: WL_HOME\\common\\derby\\bin\\startNetworkServer.cmd

12 # UNIX: WL_HOME/common/derby/bin/startNetworkServer.sh

13 #

14 # (WL_HOME refers to the top-level installation directory for WebLogic Server.)

15 #

16 # The sample consists of a single server, representing a typical development environment.

17 # This type of configuration is not recommended for production environments.

18 #

19 # Please note that some of the values used in this>

20 # your WebLogic installation and the template you are using.

21 #

22 # Usage:

23 # java weblogic.WLST <wlst>

24 #

25 # Where:

26 # <wlst> specifies the full path to the WLST>

27 #===============================================================

28

29 #==============================================================

30 # Open a domain template.

31 #================================================================

32

33 readTemplate("/data/weblogic/wlserver/common/templates/wls/wls.jar")

34

35 #================================================================

36 # Configure the Administration Server and SSL port.

37 #

38 # To enable access by both local and remote processes, you should not set the

39 # listen address for the server instance (that is, it should be left blank or not set).

40 # In this case, the server instance will determine the address of the machine and

41 # listen on it.

42 #==================================================================

43

44 cd('Servers/AdminServer')

45 set('ListenAddress','')

46 set('ListenPort', 7001)

47

48 create('AdminServer','SSL')

49 cd('SSL/AdminServer')

50 set('Enabled', 'True')

51 set('ListenPort', 7002)

52 #set('ServerStartMode', prod)

53 #==============================================================

54 # Define the user password for weblogic.

55 #==============================================================

56

57 cd('/')

58 cd('Security/base_domain/User/weblogic')

59 cmo.setPassword('1qaz@WSX')

60 # Please set password here before using this>

61

62

63 setOption('OverwriteDomain', 'true')

64 writeDomain('/data/weblogic/user_projects/domains/domain120')

65 closeTemplate()

66

67 #==============================================================

68 # Exit WLST.

69 #=====================================================================

70

71 exit()

注意:有些情況下用戶想更改登錄weblogic的用戶名,可以在.py腳本里直接指定用戶名“cmo.setName('weblogic')”。

解決創建域緩慢的問題

在Oracle官網中,有對域創建過程緩慢做相應的說明:

if you notice that it takes a long time to create or update a domain using WLST on a UNIX or Linux operating system, set the CONFIG_JVM_ARGS environment variable to the following value to resolve this issue:

-Djava.security.egd=file:/dev/urandom

[bea@redhat6 bin]$ export CONFIG_JVM_ARGS='-Djava.security.egd=file:/dev/urandom'

基本原理:重設了Linux系統下獲取隨機數的來源。

wlst創建域

路徑 /data/weblogic/wlserver/common/bin

[bea@redhat6 bin]$ ./wlst.sh /data/weblogic/user_projects/domains/domain120/basicWLSDomain.py

WARNING: This is a deprecated>

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Exiting WebLogic Scripting Tool.

此時說明域已經創建完成。

更改域啟動加載慢的問題

路徑 /data/weblogic/user_projects/domains/domainXXX/bin

[bea@redhat6 bin]$ vim setDomainEnv.sh

管理控制檯運行慢,在WLS_home/mydomain/bin/setDomainEnv.sh最後加:

JAVA_OPTIONS="${JAVA_OPTIONS} -Djava.security.egd=file:/dev/./urandom"

export JAVA_OPTIONS

啟動中間件管理服務器

由於通過wlst腳本工具創建的域,默認情況下是開發模式。因此需要在執行./startWebLogic.sh啟動weblogic console之後,在控制檯下將模式更改為生產模式。更改之後需要重啟weblogic console才可以生效。

Oracle中間件 12c軟件安裝及域的創建配置


Oracle中間件 12c軟件安裝及域的創建配置


Oracle中間件 12c軟件安裝及域的創建配置

創建且啟動應用實例

Administrator創建成功後,可以在console控制檯上創建應用實例(受管服務器)。

應用實例的創建與10.3.6的創建方式相同,但在字符界面下啟動應用實例和10.3.6有些區別(可能10.3.6啟動的標準方法就是如此,只是本人之前一直僥倖用不規範的方法啟動且啟動成功)。

10.3.6啟動應用實例的方法

進入特定的目錄

./startManagedWebLogic.sh appServer

12c啟動應用實例的方法

進入特定的目錄

./startManagedWebLogic.sh appServer http://10.6.11.134:7001/

在前臺啟動應用實例後,進入server目錄創建密碼文件。之後再配置應用實例後臺啟動。

#nohup ./startManagedWebLogic.sh appServer http://10.6.11.134:7001/ > nohup8020.out &

(此應用實例使用的端口是8020)


分享到:


相關文章: