This chapter explains how to install Oracle R Distribution and Oracle R Enterprise Server on Oracle Exadata Database Machine. This chapter includes these topics:
Exadata is an ideal platform for Oracle R Enterprise. The parallel resources of R computations in Oracle R Enterprise take advantage of the massively parallel grid infrastructure of Exadata.
To install Oracle R Enterprise on Exadata:
On each node:
Install Oracle R Distribution as described in Installing R for Oracle R Enterprise.
Verify and configure the environment as described in Oracle R Enterprise Server Requirements
Install Oracle R Enterprise Server and the supporting packages as described in Installing Oracle R Enterprise Server.
On the first node only, create a user, as described in Creating a Database User for Oracle R Enterprise.
You can simplify the process of installing Oracle R Enterprise on Exadata by using the Distributed Command Line Interface (DCLI) as described in the following topics.
You can use DCLI to simplify the installation of Oracle R Enterprise on Exadata.
With DCLI, you can use a single command to install Oracle R Distribution and Oracle R Enterprise Server across multiple Exadata compute nodes. The following example shows the output of the DCLI help option, which explains the basic syntax of the utility.
See Also:
My Oracle Support for more details about DCLI. Go to the following website, log in with your Customer Support Identifier, and type DCLI
in the search box.
Example 5-1 DCLI Help Option Output
$ 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
This section explains how to run DCLI to install Oracle R Distribution across multiple Exadata Linux compute nodes.
The commands are summarized in DCLI Command Summary for Oracle R Distribution installation on Exadata.
Important:
Before beginning the installation, review the instructions for installing Oracle R Distribution in Installing R for Oracle R Enterprise.
To install Oracle R Distribution on Exadata using DCLI, follow these steps:
Configure the Exadata environment to enable automatic authentication for DCLI on each compute node.
Generate an SSH public-private key for the root user. Execute the following command as root on any node:
$ ssh-keygen -N '' -f /.ssh/id_dsa -t dsa
This command generates public and private key files in the .ssh
subdirectory of the home directory of the root user.
In a text editor, create a file that contains the names of all the compute nodes in the rack. Specify each node name on a separate line. For example, the nodes
file for a 2-node cluster could contain entries like the following:
$ cat nodes exadb01 exadb02
Run the DCLI command with the -k
option to establish SSH trust across all the nodes. The -k
option causes DCLI to contact each node sequentially (not in parallel) and prompts you to enter the password for each node.
$ dcli -t -g nodes -l root -k -s "\-o StrictHostkeyChecking=no"
DCLI with -k
establishes SSH Trust and User Equivalence. Subsequent DCLI commands will not prompt for passwords.
Download the file ord-linux-x86_64-Rversion-Exadataversion.tar.gz
, where Rversion is the version of Oracle R Distribution to install. Install Oracle R Distribution using yum or, if an internet connection is unavailable, by installing the Oracle R Distribution RPMs manually. For a manual installation, contact Oracle Support to obtain the archive compatible with your version of Exadata.
Log in to My Oracle Support.
https://support.oracle.com/
Click Contact Us.
Request permission to access this file:
ord-linux-x86_64-Rversion-Exadataversion.tar.gz
When permission is granted, log in as root to any compute node and download the file.
Create a directory and replicate the downloaded file in this directory across all nodes. For example, the following commands create the directory /home/oracle/ORD
and replicate the file ord-linux-x86_64-
Rversion
-
Exadataversion
.tar.gz
in this directory.
$ 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
Uncompress and untar the file to replicate the dependent RPMs across all nodes.
$ 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
Alternatively, you can download these RPMs from the Oracle public yum server. The locations of the RPMs are listed in "Installing Oracle R Distribution on Oracle Linux Using RPMs".
To install the new RPMs and update existing RPMs across nodes, execute the following RPM command:
$ dcli -t -g nodes -l root rpm -i --force /home/oracle/ORD/ord-linux-x86_64-Rversion-Exadataversion/*.rpm
The --force
flag prevents errors from circular dependencies.
Verify the R installations on each node by first returning to the location where R is installed and then starting R.
$ dcli -g nodes -l oracle R RHOME exadb01: /usr/lib64/R exadb02: /usr/lib64/R
The following command returns this output for each node.
$ 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.
The DCLI commands used to install Oracle R Distribution on a Linux Exadata system are listed in Example 5-2. Replace version
with the version number of the Oracle R Distribution that you are using.
Example 5-2 DCLI Command Summary for Oracle R Distribution
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
This section explains how to run DCLI to install Oracle R Enterprise Server across multiple Exadata Linux compute nodes.
The commands are summarized in DCLI Commands Summary for Oracle R Enterprise Server.
Important:
Before beginning the installation, review the instructions for installing Oracle R Enterprise Server in Installing Oracle R Enterprise Server.
To install Oracle R Enterprise Server on Exadata using DCLI, follow these steps:
Ensure that the ORACLE_HOME
, ORACLE_SID
, R_HOME
, PATH
, and LD_LIBRARY_PATH
environment variables are properly set on each node. For example, you could specify values like the following in a bashrc file:
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
Go to the Oracle R Enterprise home page on the Oracle Technology Network:.
http://www.oracle.com/technetwork/database/options/advanced-analytics/r-enterprise/
Select Oracle R Enterprise Downloads. On the Downloads page, select Oracle R Enterprise Server and the Supporting Packages for Linux. The following files are downloaded for Oracle R Enterprise, where version is the Oracle R Enterprise, release number.
ore-server-linux-x86-64-version.zip ore-supporting-linux-x86-64-version.zip
Log in as root, and copy the installers for Oracle R Enterprise Server and the supporting packages across nodes. For example:
$ 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
Unzip the supporting packages on each node:
$ dcli -t -g nodes -l oracle unzip /home/oracle/ORE/ore-supporting-linux-x86-64-version.zip -d /my_destination_directory/
Install Oracle R Enterprise server components:
$ 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"
Note:
The server
script creates a user for Oracle R Enterprise. By default, the script does not grant the rqadmin
role to the user.
Any Oracle R Enterprise user can execute embedded R, but only those with the rqadmin
role can create and drop the R scripts in the database. Use caution when granting the rqadmin
role.
Verify Oracle R Enterprise loads.
> 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
The DCLI commands used to install Oracle R Enterprise Server and the supporting packages on a Linux Exadata system are listed in Example 5-3.
Example 5-3 DCLI Command Summary for Oracle R Enterprise Server
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)"