カタカタブログ

SIerで働くITエンジニアがカタカタした記録を残す技術ブログ。Java, Oracle Database, Linuxが中心です。たまに数学やデータ分析なども。

Cent OS 7にWebLogic Server 12c(12.1.3)をインストールしてみた

前にCent OS 7.0の環境を作ったので、Javaでも動かしてみることにした。そういえばWebLogic 12cがずいぶん前に出ていたものの最新版を試していなかったので、開発者向けの12.1.3をインストールしてみる。今回はインストール方法についてまとめた。

インストーラ入手

一応公式文書は以下にあったが、インストーラ付属のREADMEを進めるだけで簡単にインストールできたので特に参照していない。備忘として、リンクを貼っておく。

  • Oracle WebLogic Serverインストールの計画  

http://docs.oracle.com/cd/E50629_01/wls/index.html

  • インストーラをダウンロード

以下のURLより、2015年2月末現在の最新版、12.1.3のインストーラをダウンロードする。ファイル名はwls1213_dev.zip。
http://www.oracle.com/technetwork/jp/middleware/weblogic/downloads/index.html
f:id:osn_th:20150228164014p:plain

  • まずoracleユーザがいなかったので作成
# useradd oracle
# passwd oracle
  • インストーラを適当なパスにて展開

以降はoracleユーザで作業する。ホームディレクトリ直下にwlsというディレクトリを作り、そこにインストーラを配置し展開する。

[oracle@vmora7 wls]$ pwd
/home/oracle/wls
[oracle@vmora7 wls]$ unzip wls1213_dev.zip
[oracle@vmora7 wls]$ cd wls12130/
[oracle@vmora7 wls12130]$ lscoherenceconfigure.shinventory      osarch.xml  README_WIN.txtcommon        configure.xml       oracle_commonouiwlserver
configure.cmd  domain-registry.xml  oraInst.loc    README.txt

ちなみにJavaはOracle JDK 1.7の最新版(1.7.0_75)を使用している。Cent OS 7は標準だとOpen JDK 7が入っている。そのままでも特に問題はないと思われるが、一応Oracle JDKをインストールしておく。
なおOracle JDKのインストール手順は過去記事を参考に。
Cent OS 7にalternativesを使ってOracle JDK7をインストールしたときのメモ - カタカタブログ

# java -version
java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)

WebLogic 12cインストール

README.txtの手順に従って実施する。

  • 環境変数設定

oracleユーザのJAVA_HOME、MW_HOMEをセットする必要がある。毎回読むのは面倒なので、.bashrcに記載する。

[oracle@vmora7 wls12130]$ echo "export JAVA_HOME=/opt/jdk1.7.0_75" >> ~/.bashrc
[oracle@vmora7 wls12130]$ echo "export MW_HOME=/home/oracle/wls/wls12130" >> ~/.bashrc
[oracle@vmora7 wls12130]$ . ~/.bashrc
  • configure.sh実行

configureという名前だが、このシェルがインストーラのよう。WebLogicサーバインストール、初期ドメイン構築、サーバ起動までやってくれる。途中WebLogic管理ユーザ名とパスワードを決める必要があるので、適当にweblogicユーザという名前にしておく(パスワードは適当に)。

[oracle@vmora7 wls12130]$ . ./configure.sh
**************************************************
WebLogic Server 12g (12.1.3.0) Zip Configuration
MW_HOME:   /home/oracle/wls/wls12130
JAVA_HOME: /opt/jdk1.7.0_75
**************************************************
Please wait while 740 jars are unpacked ...
Unpacking com.oracle.state-management.persistence-service-provider-state-management-impl_12.1.3.jar 5Unpacking com.oracle.state-management.state-management-provider-common-internal-api_12.1.3.jar 526 to...Unpacking done                                                                            0 to go
BUILD SUCCESSFUL
Total time: 0 seconds
CLASSPATH=/opt/jdk1.7.0_75/lib/tools.jar:/home/oracle/wls/wls12130/wlserver/server/lib/weblogic_sp.jar:/home/oracle/wls/wls12130/wlserver/server/lib/weblogic.jar:/home/oracle/wls/wls12130/oracle_common/modules/net.sf.antcontrib_1.1.0.0_1-0b3/lib/ant-contrib.jar:/home/oracle/wls/wls12130/wlserver/modules/features/oracle.wls.common.nodemanager_2.0.0.0.jar:
PATH=/home/oracle/wls/wls12130/wlserver/server/bin:/home/oracle/wls/wls12130/oracle_common/modules/org.apache.ant_1.9.2/bin:/opt/jdk1.7.0_75/jre/bin:/opt/jdk1.7.0_75/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/oracle/.local/bin:/home/oracle/bin:/home/oracle/wls/wls12130/oracle_common/modules/org.apache.maven_3.0.5/bin
Your environment has been set.
Configuring WLS...
BUILD SUCCESSFUL
Total time: 0 seconds
Do you want to configure a new domain?  [y/n]? y
<Feb 27, 2015 10:02:39 PM EST> <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.>
<Feb 27, 2015 10:02:40 PM EST> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to FIPS186PRNG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<Feb 27, 2015 10:02:41 PM EST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 24.75-b04 from Oracle Corporation.>
<Feb 27, 2015 10:02:41 PM EST> <Info> <Management> <BEA-140013> </home/oracle/wls/wls12130/user_projects/domains/mydomain/config not found>
<Feb 27, 2015 10:02:41 PM EST> <Info> <Security> <BEA-090065> <Getting boot identity from user.>
Enter username to boot WebLogic server:weblogic
Enter password to boot WebLogic server:
For confirmation, please re-enter password required to boot WebLogic server:
<Feb 27, 2015 10:02:54 PM EST> <Info> <Management> <BEA-141254> <Generating new domain directory in /home/oracle/wls/wls12130/user_projects/domains/mydomain.>
<Feb 27, 2015 10:33:06 PM EST> <Info> <Management> <BEA-141255> <Domain generation completed in 1,812,943 milliseconds.>
<Feb 27, 2015 10:33:06 PM EST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.1.3.0.0  Fri May 30 18:25:10 PDT 2014 1606070 >
<Feb 27, 2015 10:33:08 PM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
<Feb 27, 2015 10:33:08 PM EST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.>
<Feb 27, 2015 10:33:08 PM EST> <Notice> <Log Management> <BEA-170019> <The server log file /home/oracle/wls/wls12130/user_projects/domains/mydomain/servers/myserver/logs/myserver.log is opened. All server side log events will be written to this file.>
<Feb 27, 2015 10:33:14 PM EST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<Feb 27, 2015 10:33:17 PM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.>
<Feb 27, 2015 10:33:17 PM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
Feb 27, 2015 10:33:18 PM weblogic.wsee.WseeCoreMessages logWseeServiceStarting
INFO: The Wsee Service is starting
<Feb 27, 2015 10:33:18 PM EST> <Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.>
<Feb 27, 2015 10:33:18 PM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.>
<Feb 27, 2015 10:33:18 PM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING.>
<Feb 27, 2015 10:33:18 PM EST> <Warning> <Server> <BEA-002611> <The hostname "localhost", maps to multiple IP addresses: 127.0.0.1, 0:0:0:0:0:0:0:1.>
<Feb 27, 2015 10:33:18 PM EST> <Notice> <Server> <BEA-002613> <Channel "Default[4]" is now listening on fe80:0:0:0:a00:27ff:feea:9bb5:7001 for protocols iiop, t3, ldap, snmp, http.>
<Feb 27, 2015 10:33:18 PM EST> <Notice> <Server> <BEA-002613> <Channel "Default[3]" is now listening on fe80:0:0:0:a00:27ff:fe83:d97a:7001 for protocols iiop, t3, ldap, snmp, http.>
<Feb 27, 2015 10:33:18 PM EST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 192.168.33.11:7001 for protocols iiop, t3, ldap, snmp, http.>
<Feb 27, 2015 10:33:18 PM EST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.>
<Feb 27, 2015 10:33:18 PM EST> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 10.0.2.15:7001 for protocols iiop, t3, ldap, snmp, http.>
<Feb 27, 2015 10:33:18 PM EST> <Notice> <Server> <BEA-002613> <Channel "Default[5]" is now listening on 0:0:0:0:0:0:0:1:7001 for protocols iiop, t3, ldap, snmp, http.>
<Feb 27, 2015 10:33:18 PM EST> <Notice> <WebLogicServer> <BEA-000331> <Started the WebLogic Server Administration Server "myserver" for domain "mydomain" running in development mode.>
<Feb 27, 2015 10:33:18 PM EST> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.>
<Feb 27, 2015 10:33:18 PM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.> 

30分ほどかかったが、と出ているのでWebLogicサーバが起動したよう。このシェルはインストール後にそのままサーバ起動プロセスとなり、応答が来ないので注意。

ブラウザからWebLogic管理コンソールにアクセスしてみる

サーバの管理コンソールにログインするため、以下のURLにブラウザからアクセスする。今回仮想マシンで作業したので、ホスト側のMac OSからブラウザでつなげるか確認する(ゲスト仮想マシン側のファイアウォールはあらかじめ無効化しておく)。
http://host:7001/console
f:id:osn_th:20150301021103p:plain
ちゃんとログイン画面がでた!configure.shで決めた管理者ユーザの名前(weblogic)とパスワードを入力してログインする。
f:id:osn_th:20150301021112p:plain
無事、ログインできた!

環境情報

  • WebLogic系の環境情報セット

以下のenvファイルを読みこめば、環境変数がセットされるよう。

. $MW_HOME/wlserver/server/bin/setWLSEnv.sh
  • 起動停止シェル

以下に起動停止スクリプトがある。引数なしでそのまま実行するだけで起動・停止ができる。
・起動: startWebLogic.sh
・停止: stopWebLogic.sh

[oracle@vmora7 ~]$ cd $MW_HOME/user_projects/domains/mydomain/bin
[oracle@vmora7 bin]$ pwd
/home/oracle/wls/wls12130/user_projects/domains/mydomain/bin
[oracle@vmora7 bin]$ ls -l
total 64
drwxrwxr-x. 2 oracle oracle    26 Feb 27 22:03 nodemanager
drwxrwxr-x. 2 oracle oracle    27 Feb 27 22:03 server_migration
drwxrwxr-x. 2 oracle oracle    23 Feb 27 22:03 service_migration
-rwxr-x---. 1 oracle oracle 13872 Feb 27 22:33 setDomainEnv.sh
-rwxr-x---. 1 oracle oracle  1264 Feb 27 22:33 setStartupEnv.sh
-rwxr-x---. 1 oracle oracle  2280 Feb 27 22:33 startComponent.sh
-rwxr-x---. 1 oracle oracle  3024 Feb 27 22:33 startManagedWebLogic.sh
-rwxr-x---. 1 oracle oracle  1051 Feb 27 22:33 startNodeManager.sh
-rwxr-x---. 1 oracle oracle   705 Feb 27 22:33 startRSDaemon.sh
-rwxr-x---. 1 oracle oracle  5900 Feb 27 22:33 startWebLogic.sh
-rwxr-x---. 1 oracle oracle  1944 Feb 27 22:33 stopComponent.sh
-rwxr-x---. 1 oracle oracle  2630 Feb 27 22:33 stopManagedWebLogic.sh
-rwxr-x---. 1 oracle oracle  1070 Feb 27 22:33 stopNodeManager.sh
-rwxr-x---. 1 oracle oracle   848 Feb 27 22:33 stopRSDaemon.sh
-rwxr-x---. 1 oracle oracle  2057 Feb 27 22:33 stopWebLogic.sh

まとめ

WebLogic 12cをインストールし、管理コンソールにログインするところまでは簡単にできた。開発者向けのWebLogicは今回初めてインストールしてみたが、Enterprise版と違いGUIなしでもインストールでき、本当に開発目的だけならとても手軽でよさそうな印象。今度はJavaプログラムのデプロイ等をまたやってみたい。

関連記事