この章では、Oracle Exadataデータベース・マシンへのOracle R DistributionおよびOracle R Enterprise Serverのインストール方法を説明します。この章の内容は、次のとおりです。
ExadataはOracle R Enterpriseに最も適したプラットフォームです。Oracle R EnterpriseのR計算の並列リソースは、Exadataの大規模なパラレル・グリッド・インフラストラクチャを活用します。
Oracle R EnterpriseをExadataにインストールするには、次の手順を実行します。
各ノードで、次の手順を実行します。
Oracle R Enterprise向けのRのインストールの説明に従って、Oracle R Distributionをインストールします。
Oracle R Enterprise Serverの要件の説明に従って、環境を確認および構成します。
Oracle R Enterprise Serverのインストールの説明に従って、Oracle R Enterprise ServerおよびSupporting Packagesをインストールします。
最初のノードでのみ、Oracle R Enterpriseのデータベース・ユーザーの作成の説明に従ってユーザーを作成します。
次の各項で説明する分散コマンドライン・インタフェース(DCLI)を使用することで、ExadataへのOracle R Enterpriseのインストール・プロセスを簡略化できます。
DCLIを使用してExadataへのOracle R Enterpriseのインストールを簡略化できます。
DCLIを使用することで、1つのコマンドを使用して、複数のExadata計算ノードにOracle R DistributionおよびOracle R Enterprise Serverをインストールできます。次の例に、このユーティリティの基本構文を説明する、DCLIのヘルプ・オプションの出力を示します。
関連項目:
DCLIの詳細は、My Oracle Supportを参照してください。次のWebサイトに移動し、カスタマサポートIDでログインして、検索ボックスにDCLI
と入力します。
例5-1 DCLIのヘルプ・オプションの出力
$ dcli -h Distributed Shell for Oracle Storage This script executes commands on multiple cells in parallel threads. The cells are referenced by their domain name or ip address. Local files can be copied to cells and executed on cells. This tool does not support interactive sessions with host applications. Use of this tool assumes ssh is running on local host and cells. The -k option should be used initially to perform key exchange with cells. User may be prompted to acknowledge cell authenticity, and may be prompted for the remote user password. This -k step is serialized to prevent overlayed prompts. After -k option is used once, then subsequent commands to the same cells do not require -k and will not require passwords for that user from the host. Command output (stdout and stderr) is collected and displayed after the copy and command execution has finished on all cells. Options allow this command output to be abbreviated. Return values: 0 -- file or command was copied and executed successfully on all cells 1 -- one or more cells could not be reached or remote execution returned non-zero status. 2 -- An error prevented any command execution Examples: dcli -g mycells -k dcli -c stsd2s2,stsd2s3 vmstat dcli -g mycells cellcli -e alter iormplan active dcli -g mycells -x reConfig.scl usage: dcli [options] [command] options: --version show program's version number and exit -c CELLS comma-separated list of cells -d DESTFILE destination directory or file -f FILE file to be copied -g GROUPFILE file containing list of cells -h, --help show help message and exit -k push ssh key to cell's authorized_keys file -l USERID user to login as on remote cells (default: celladmin) -n abbreviate non-error output -r REGEXP abbreviate output lines matching a regular expression -s SSHOPTIONS string of options passed through to ssh --scp=SCPOPTIONS string of options passed through to scp if different from sshoptions --serial serialize execution over the cells -t list target cells --unkey drop keys from target cells' authorized_keys file -v print extra messages to stdout --vmstat=VMSTATOPS vmstat command options -x EXECFILE file to be copied and executed
この項では、複数のExadataのLinux計算ノードにOracle R DistributionをインストールするためのDCLIの実行方法を説明します。
コマンドは、ExadataへのOracle R Distributionインストール用のDCLIコマンドのサマリーにまとめられています。
重要
インストールを開始する前に、Oracle R Enterprise向けのRのインストールでOracle R Distributionのインストール手順を確認してください。
DCLIを使用してExadataにOracle R Distributionをインストールするには、次の手順を実行します。
各計算ノードでDCLIに対する自動認証を有効化するようにExadata環境を構成します。
rootユーザーのSSH公開鍵-秘密鍵を生成します。任意のノードで次のコマンドをrootで実行します。
$ ssh-keygen -N '' -f /.ssh/id_dsa -t dsa
このコマンドによって、rootユーザーのホーム・ディレクトリの.ssh
サブディレクトリに公開鍵および秘密鍵のファイルが生成されます。
テキスト・エディタで、ラック内のすべての計算ノードの名前を含むファイルを作成します。1行に1つのノード名を指定します。たとえば、2ノード・クラスタのnodes
ファイルには、次のようなエントリが含まれます。
$ cat nodes exadb01 exadb02
全ノードでSSH信頼を確立するために、-k
オプションを使用してDCLIコマンドを実行します。-k
オプションによって、DCLIが各ノードに順に(並行にではなく)接触し、各ノードのパスワードの入力が求められます。
$ dcli -t -g nodes -l root -k -s "\-o StrictHostkeyChecking=no"
-k
を使用したDCLIは、SSH信頼およびユーザー等価関係を確立します。この後のDCLIコマンドではパスワードの入力は求められません。
ファイルord-linux-x86_64-Rversion-Exadataversion.tar.gz
をダウンロードします。ここでのRversionは、インストールするOracle R Distributionのバージョンです。yumを使用するか、または、インターネット接続を使用できない場合はOracle R Distribution RPMを手動でインストールして、Oracle R Distributionをインストールします。手動でインストールする場合は、Oracleサポートに連絡して、ご使用のバージョンのExadataと互換性のあるアーカイブを入手します。
My Oracle Supportにログインします。
https://support.oracle.com/
「問合せ」をクリックします。
このファイルへのアクセス権を要求します。
ord-linux-x86_64-Rversion-Exadataversion.tar.gz
権限が付与されたら、rootとして任意の計算ノードにログインし、ファイルをダウンロードします。
ディレクトリを作成し、このディレクトリにダウンロードしたファイルをすべてのノードにレプリケートします。たとえば、次のコマンドは、ディレクトリ/home/oracle/ORD
を作成し、ファイルord-linux-x86_64-
Rversion
-
Exadataversion
.tar.gz
をこのディレクトリにレプリケートします。
$ dcli -t -g nodes -l root mkdir -p /home/oracle/ORD $ dcli -t -g nodes -l root -f ord-linux-x86_64-Rversion-Exadataversion.tar.gz -d /home/oracle/ORD/ord-linux-x86_64-Rversion-Exadataversion.tar.gz
このファイルを圧縮解除およびuntarして、全ノードに依存RPMをレプリケートします。
$ dcli -t -g nodes -l root tar xvfz /home/oracle/ORD/ord-linux-x86_64-Rversion-Exadataversion.tar.gz -C /home/oracle/ORD $ ls /home/oracle/ORD/ord-linux-x86_64-Rversion-Exadataversion.tar.gz
または、Oracle Public YumサーバーからこれらのRPMをダウンロードすることもできます。RPMの場所は、「RPMを使用したOracle LinuxへのOracle R Distributionのインストール」にリストされています。
新しいRPMをインストールし、全ノードの既存のRPMを更新するには、次のRPMコマンドを実行します。
$ dcli -t -g nodes -l root rpm -i --force /home/oracle/ORD/ord-linux-x86_64-Rversion-Exadataversion/*.rpm
--force
フラグによって、循環依存のエラーが発生しません。
Rがインストールされている場所に戻ってからRを開始することによって、各ノードでRインストールを確認します。
$ dcli -g nodes -l oracle R RHOME exadb01: /usr/lib64/R exadb02: /usr/lib64/R
次のコマンドでは、各ノードに対して次の出力を返します。
$ dcli -g nodes -l oracle R --vanilla exadb01: Oracle Distribution of R version 3.2.0 (--) -- "Full of Ingredients" exadb01: Copyright (C) 2012 The R Foundation for Statistical Computing exadb01: Platform: x86_64-unknown-linux-gnu (64-bit) exadb01: exadb01: R is free software and comes with ABSOLUTELY NO WARRANTY. exadb01: You are welcome to redistribute it under certain conditions. exadb01: Type 'license()' or 'licence()' for distribution details. exadb01: exadb01: Natural language support but running in an English locale exadb01: exadb01: R is a collaborative project with many contributors. exadb01: Type 'contributors()' for more information and exadb01: 'citation()' on how to cite R or R packages in publications. exadb01: exadb01: Type 'demo()' for some demos, 'help()' for on-line help, or exadb01: 'help.start()' for an HTML browser interface to help. exadb01: Type 'q()' to quit R. exadb01: exadb01: You are using Oracle's distribution of R. Please contact exadb01: Oracle Support for any problems you encounter with this exadb01: distribution.
例5-2に、Linux ExadataシステムへのOracle R Distribution のインストールで使用するDCLIコマンドをリストします。version
を、ご使用のOracle R Distributionのバージョン番号に置き換えます。
例5-2 Oracle R Distribution用のDCLIコマンドのサマリー
ssh-keygen -N " -f ~/.ssh/id_dsa -t dsa vi nodes # enter node names dcli -t -g nodes -l root -k -s "\-o StrictHostkeyChecking=no" dcli -t -g nodes -l root mkdir -p /home/oracle/ORD dcli -t -g nodes -l root -f ord-linux-x86_64-version.tar.gz -d /home/oracle/ORD/ord-linux-x86_64-version.tar.gz dcli -t -g nodes -l root tar xvfz /home/oracle/ORD /ord-linux-x86_64-version.tar.gz -C /home/oracle/ORD dcli -t -g nodes -l root rpm -i --force /home/oracle/ORD/ord-linux-x86_64-version/*.rpm dcli -g nodes -l root R RHOME dcli -g nodes -l root R --vanilla
この項では、複数のExadataのLinux計算ノードにOracle R Enterprise ServerをインストールするためのDCLIの実行方法を説明します。
コマンドは、Oracle R Enterprise Server用のDCLIコマンドのサマリーにまとめられています。
重要
インストールを開始する前に、Oracle R Enterprise ServerのインストールでOracle R Enterprise Serverのインストール手順を確認してください。
DCLIを使用してExadataにOracle R Enterprise Serverをインストールするには、次の手順を実行します。
環境変数ORACLE_HOME
、ORACLE_SID
、R_HOME
、PATH
およびLD_LIBRARY_PATH
を、各ノードに適切に設定してください。たとえば、bashrcファイルで次のように値を指定できます。
export ORACLE_HOME=/hostname/app/oracle/product/release_number/dbhome_1 export ORACLE_SID=ORCL export R_HOME=/usr/lib64/R export PATH=$PATH:$R_HOME/bin:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$R_HOME/lib
Oracle Technology NetworkのOracle R Enterpriseのホーム・ページに移動します。
http://www.oracle.com/technetwork/database/options/advanced-analytics/r-enterprise/
「Oracle R Enterprise Downloads」を選択します。「Downloads」ページで、「Oracle R Enterprise Server」および「Supporting Packages for Linux」を選択します。次のファイルはOracle R Enterpriseに対してダウンロードされます。ここでのversionは、Oracle R Enterpriseのリリース番号です。
ore-server-linux-x86-64-version.zip ore-supporting-linux-x86-64-version.zip
rootとしてログインし、Oracle R Enterprise ServerおよびSupporting Packagesのインストーラを全ノードにコピーします。例:
$ dcli -g nodes -l oracle mkdir -p /home/oracle/ORE $ dcli -g nodes -l oracle -f ore-server-linux-x86-64-version.zip -d /home/oracle/ORE/ore-server-linux-x86-64-version.zip $ dcli -g nodes -l oracle -f ore-supporting-linux-x86-64-version.zip -d /home/oracle/ORE/ore-supporting-linux-x86-64-version.zip
各ノードでSupporting Packagesを解凍します。
$ dcli -t -g nodes -l oracle unzip /home/oracle/ORE/ore-supporting-linux-x86-64-version.zip -d /my_destination_directory/
Oracle R Enterprise Serverコンポーネントをインストールします。
$ dcli -t -g nodes -l oracle "cd /my_destination_directory; ./server.sh -y --admin --sys syspassword --perm permtablespace --temp temptablespace --rqsys rqsyspassword --user-perm usertablespace --user-temp usertemptablespace --pass rquserpassword --user RQUSER"
注意:
server
スクリプトによって、Oracle R Enterpriseのユーザーが作成されます。デフォルトでは、ユーザーにrqadmin
ロールは付与されません。
すべてのOracle R Enterpriseユーザーは埋込みRを実行できますが、データベースのRスクリプトを作成および削除できるのはrqadmin
ロールを持つユーザーのみです。rqadmin
ロールを付与する場合は注意が必要です。
「RQADMINロールについて」を参照してください。
Oracle R Enterpriseのロードを確認します。
> library(ORE) Loading required package: OREbase Attaching package: OREbase The following objects are masked from âpackage:baseâ: cbind, data.frame, eval, interaction, order, paste, pmax, pmin, rbind, table Loading required package: OREembed Loading required package: OREstats Loading required package: MASS Loading required package: OREgraphics Loading required package: OREeda Loading required package: OREmodels Loading required package: OREdm Loading required package: lattice Loading required package: OREpredict Loading required package: ORExml
例5-3に、Linux ExadataシステムへのOracle R Enterprise Server およびSupporting Packagesのインストールで使用するDCLIコマンドをリストします。
例5-3 Oracle R Enterprise Server用のDCLIコマンドのサマリー
dcli -g nodes -l oracle mkdir -p /home/oracle/ORE dcli -g nodes -l oracle -f ore-server-linux-x86-64-version.zip -d /home/oracle/ORE/ore-server-linux-x86-64-version.zip dcli -g nodes -l oracle -f ore-supporting-linux-x86-64-version.zip -d /home/oracle/ORE/ore-supporting-linux-x86-64-version.zip dcli -t -g nodes -l oracle /home/oracle/ORE/server/./server.sh ./demo_user.sh cd /home/oracle/ORE sqlplus / as sysdba grant RQADMIN to rquser; grant CREATE TABLE to rquser; grant CREATE SESSION to rquser; grant CREATE VIEW to rquser; grant CREATE PROCEDURE to rquser; grant CREATE MINING MODEL to rquser; exit; dcli -t -g nodes -l oracle ORE -e "library(ORE)"