4 Installing the Database

This chapter provides an overview of installing a supported database for use with Oracle Communications Services Gatekeeper.

Database Installation Overview

There are substantial differences between the installation procedures for the different supported databases. JavaDB is included with the Services Gatekeeper software, so it is the only database that you not need to obtain separately, and install first. The other database installations follow these basic steps:

  1. Installing the database software.

  2. Setting up a user account that Services Gatekeeper uses to access the database.

  3. Granting the user account appropriate privileges on the database.

See the following sections for information about the database you are installing:

Installing JavaDB Software

Follow the instructions in this section to install JavaDB for Services Gatekeeper to use. JavaDB is included in the Services Gatekeeper software, so this is the only section in this chapter that instructs you to install Services Gatekeeper first.

About Using JavaDB with Services Gatekeeper

JavaDB is appropriate for test and development implementations and smaller production environments. The instructions below direct you to install the Services Gatekeeper on two physical servers. The first server includes the administration server, along with the AT and NT managed servers, and the JavaDB. The second server includes additional AT and NT servers. Colocating the JavaDB with the other Services Gatekeeper components sacrifices security, but it also achieve high-availability, and is inexpensive. For production environments, install it on a separate physical system so that it is more secure.

If just you want a single-tier implementation, see the instructions in ”Getting Started with Services Gatekeeper” in Services Gatekeeper Getting Started to install everything on one system.

Installing the JavaDB Software

To install the JavaDB software:

  1. Install the Services Gatekeeper administration server and an NT server and AT server on one physical system. Record the IP address and a listening port number.

    See "Installing Services Gatekeeper" for details.

  2. On the system you just installed, navigate to Oracle_home/wlserver/common/derby/bin.

  3. Start the DB service with this command:

    ./startNetworkServer.sh -h NT1_IP_addr
    

    Where NT1_IP_addr is the IP address of the NT server system you installed with Services Gatekeeper.

  4. Navigate to Oracle_home/wlserver/common/derby/lib.

  5. Start the JavaDB tool and create the database with this command:

    java -jar derbyrun.jar ij
    ij> connect 'jdbc:derby://NT1_IP_addr:port_no/RemoteDb;create=true';
    

    Where NT1_IP_addr is the IP address of the NT server system you installed with Services Gatekeeper, and port is the listening port to use.

  6. Create a database user with this command:

    ij> derby.user.username=password
    

    Where username and password are the name and password of the database administrator.

  7. Create the DUAL database table in JavaDB with this command:

    ij> connect 'jdbc:derby://NT1_IP_addr:port_no/RemoteDb';
    ij> create table DUAL(num int);
    ij> disconnect
    

    Where NT1_IP_addr is the IP address of the NT server system you installed with Services Gatekeeper, and port is the listening port to use.

  8. Perform any required post installation tasks

    See "Services Gatekeeper Post-Installation Tasks" for information.S

  9. Configure your domains.

    See "Configuring the Services Gatekeeper Domain" for information.

  10. Install a second server with the Services Gatekeeper NT and AT managed servers. See "Installing Services Gatekeeper" for instructions. We will refer to this system as server2. Record the IP address and the Services Gatekeeper username.

  11. Run this command on the server that contains the Services Gatekeeper administration server and JavaDB:

    scp –r user_projects/ username@server2_IP_addr:install_dir
    

    Where username is the name of the Services Gatekeeper administrator on Server2, server1_IP_addr is the IP address of Server2, and install_dir is the root directory of the installation.

You can use the ij SQL scripting tool or a third-party database administration tool such as SQuirrel SQL Client to administer the database.

Installing Oracle RAC or Oracle Single Instance Database Software

Follow these instructions if you are using Oracle Real Application Clusters (Oracle RAC) or Oracle Database Single Instance database software.

The database must be installed on a dedicated server running outside the Services Gatekeeper cluster.

About Using Oracle RAC with WebLogic Server

Oracle RAC or MySQL are supported production environments that require high availability.

For information about using Oracle WebLogic Server with multiple data sources, see Oracle Fusion Middleware Administering JDBC Data Sources for Oracle WebLogic Server.

Installing the Database Software

To install the database software:

  1. Follow the instructions in the database installation guide, available in the installing and upgrading section on the Oracle Database Documentation Library website.

    During the installation process, select these configuration options:

    • Create the database using the Transaction Processing template.

    • Use the Dedicated Server Mode for the database.

    • Change the processes parameter to be equal to:

      [(wlng.datasource MaximumCapacity + wlng.localTX.datasource MaximumCapacity) * NumberOfServers]

      where NumberOfServers is the number of Services Gatekeeper servers in the cluster. MaximumCapacity is a parameter in the connection pool settings for the JDBC data sources. Normally this value is 150 for both data sources, but you may need to increase it.

  2. Download and install the latest Oracle database patch set.

  3. Continue to "Setting Up a Services Gatekeeper User for the Oracle Database".

Setting Up a Services Gatekeeper User for the Oracle Database

To set up a Services Gatekeeper user for the Oracle database:

  1. Create a database user for Services Gatekeeper with an allowed (unlimited) quota on its default tablespace (the users tablespace). The user name and password for the user are later copied to each Services Gatekeeper server.

  2. Grant the user the following privileges:

    • CREATE SESSION

    • CREATE TABLE

  3. Continue to "Installing Services Gatekeeper".

Installing Oracle Database Express Edition

Follow the instructions in this section if you are using Oracle Express Edition (XE) as your database.

Oracle XE can be installed either on a server in the Services Gatekeeper cluster or on a separate server. If it is installed in the cluster, it should be in the same server as the Network Tier.

Note:

Oracle XE is recommended over MySQL for Services Gatekeeper development installations because the Oracle XE schema is compatible with enterprise Oracle databases. Neither Oracle XE nor MySQL is recommended for production deployment.

Installing the Oracle XE Software

To install Oracle XE:

  1. Download the Oracle Database Express Edition installer from the Oracle Technology Network website:

    http://www.oracle.com/technetwork/index.html

  2. Follow the instructions to select and download the Oracle Database Express Edition software for your operating system.

  3. Install Oracle XE using the instructions in the installation guide on the Oracle documentation website at:

    https://docs.oracle.com/en/database/

  4. Continue to "Configuring Oracle XE for Services Gatekeeper".

Configuring Oracle XE for Services Gatekeeper

To configure Oracle XE for Services Gatekeeper:

  1. Open a command window.

  2. (Linux only) If the required environment variables are not already set, do the following:

    For Bash, Bourne, or Korn shell, enter the following command:

    source ORACLE_HOME/bin/oracle_env.sh
    

    For C shell, enter the following command:

    source ORACLE_HOME/bin/oracle_env.csh
    
  3. Enter the following command:

    sqlplus /nolog
    
  4. Connect to the database (on Windows you are prompted for the user name and password):

    SQL> connect SYSTEM/SYSTEM_user_password@XE
    
  5. Enter the following command to increase the number of allowable JDBC connections:

    SQL> alter system set processes=300 scope=spfile;
    
  6. Create a Services Gatekeeper user and password using the following command:

    SQL> create user database_username identified by password;
    
  7. Grant the newly created user privileges using the following command:

    SQL> grant create session, create table, resource to database_username;
    
  8. Exit SQL*Plus:

    SQL> exit
    
  9. Restart the database for the changes to take effect.

  10. Continue to "Installing Services Gatekeeper".

Installing MySQL Database

Follow the instructions in this section if you are using MySQL as your database. Services Gatekeeper supports using single instance and clustered MySQL database implementations.

MySQL can be installed either on a server in the Services Gatekeeper cluster or on a separate server. If it is installed in the cluster, it should be in the same server as the Network Tier.

Note:

Oracle XE is preferable to MySQL for Services Gatekeeper development installations because the Oracle XE schema is compatible with enterprise Oracle databases. Oracle XE is not recommended for production deployment.

This section covers the following topics:

Installing the MySQL Database Software

To install a MySQL database:

  1. Download the MySQL database software from the Oracle software delivery website at:

    https://edelivery.oracle.com

  2. Follow the instructions in the MySQL documentation for installing MySQL. The documentation is available on the MySQL website at:

    http://dev.mysql.com

  3. When installing MySQL:

    • Linux: For most Linux distributions, you can use a package manager such as dpkg or YUM.

    • Windows: Unless you have additional special requirements, you can select the Developer Default installation option.

  4. Continue to one of the following sections:

Configuring MySQL on Linux

This section summarizes the commands required to configure MySQL on most versions of Linux. Command locations may differ between Linux distributions.

To configure MySQL on Linux:

  1. As the user root, start the MySQL database:

    /etc/rc.d/init.d/mysqld start
    
  2. Open the /etc/my.cnf file and do the following:

    • Edit the connection variable so that max_connections is equal to:

      [(wlng.datasource MaximumCapacity + wlng.localTX.datasource MaximumCapacity) * NumberOfServers]

      where NumberOfServers is the number of Services Gatekeeper servers in the cluster. MaximumCapacity is a parameter in the connection pool settings for the JDBC data sources. Normally this value is 150 for both data sources, but you may need to increase it.

      [mysqld]
      max_connections=400
      
    • Add an entry for the default character set. The recommended character set is Latin1.

      default-character-set=latin1
      
  3. Save and close the file.

  4. Restart MySQL:

    /etc/rc.d/init.d/mysqld stop
    /etc/rc.d/init.d/mysqld start
    
  5. Continue to "Creating the Database and a Database User".

Configuring MySQL on Windows

To configure MySQL on Windows:

  1. From a text editor, open the my.ini file and do the following:

    • Edit the connection variable so that max_connections is equal to:

      [(wlng.datasource MaximumCapacity + wlng.localTX.datasource MaximumCapacity) * NumberOfServers]

      where NumberOfServers is the number of Services Gatekeeper servers in the cluster. MaximumCapacity is a parameter in the connection pool settings for the JDBC data sources. Normally this value is 150 for both data sources, but you may need to increase it.

      [mysqld]
      max_connections=400
      
    • Add an entry for the default character set. The recommended character set is Latin1.

      default-character-set=latin1
      
  2. Save and close the file.

  3. Continue to "Creating the Database and a Database User".

Creating the Database and a Database User

To configure MySQL for Services Gatekeeper, perform the following for each IP address in the cluster:

  1. Create the Services Gatekeeper database user and password.

    You will need to provide this user name and password when you configure the Services Gatekeeper domain. For information about the various command-level modes of accessing the MySQL server, see the documentation on the MySQL website.

  2. Grant access privileges:

    GRANT ALL ON *.* TO database_username@ip_address IDENTIFIED BY user_password
    
  3. Create the database for Services Gatekeeper:

    CREATE DATABASE database_name
    

    You will need to provide the database name when you configure the Services Gatekeeper domain.

  4. Continue to "Installing Services Gatekeeper".

Installing MySQL Cluster CGE

Follow the instructions in this section if you are using MySQL Cluster Carrier Grade Edition (CGE) as your database. Services Gatekeeper supports using single instance and clustered MySQL database implementations.

MySQL can be installed either on a server in the Services Gatekeeper cluster or on a separate server. If it is installed in the cluster, it should be in the same server as the Network Tier.

Installing the MySQL Cluster CGE Software

To install MySQL Cluster SGE software:

  1. Download a supported version of MySQL Cluster from the Oracle software delivery website:

    https://edelivery.oracle.com/

  2. Install the MySQL Cluster CGE software using the instructions in the installation guide on the Oracle documentation website:

    http://docs.oracle.com/cd/E17952_01/index.html

Configuring the Management Server Node

For a first Cluster, start with a single MySQL Server (mysqld), a pair of Data Nodes (ndbd) and a single management node(ndb_mgmd) – all running on the same server. Using the management server node, you can start and stop other nodes, configure data, run backup, and perform other tasks.

To configure the management server node:

  1. Create the config.ini file on the management server, under the /var/lib/mysql-cluster/ directory.

    The following is an example of the ndbd default section in the config.ini file. For the hostname parameter, host_name_or_IP_address represents the host name or IP address of the node. For example:

    hostname=node1.example.com

    The system values in this example are suggested values. The values you use will depend on how your system is set up.

    Example ndbd default section of the config.ini file:

    [ndbd default]
    NoOfReplicas=2
    DataMemory=4G
    IndexMemory=400M
    MaxNoOfAttributes=500000
    MaxNoOfTables=1760
    MaxNoOfOrderedIndexes=3000
    MaxNoOfUniqueHashIndexes=1250
    MaxNoOfConcurrentOperations=100000
    [ndb_mgmd]
    NodeId=1
    hostname=host_name_or_IP_address
    datadir=/var/lib/mysql-cluster/
    [ndbd]
    NodeId=2
    hostname=host_name_or_IP_address
    datadir=/usr/local/mysql/data/
    [ndbd]
    NodeId=3
    hostname=host_name_or_IP_address
    datadir=/usr/local/mysql/data/
    [mysqld]
    NodeId=4
    hostname=host_name_or_IP_address
    [mysqld]
    NodeId=5
    hostname=host_name_or_IP_address
    [mysqld]
    [mysqld]
    
  2. Create the my.cnf file under the /etc directory, using the following values:

    [mysqld]
    ndbcluster
    datadir=/usr/local/mysql/data
    basedir=/usr/local/mysql
    user = mysql
    port = 3306
    default-storage-engine=ndb
    ndb-connectstring= host_name_or_IP_address
    [mysql_cluster]
    ndb-connectstring= host_name_or_IP_address
    

Starting the MySQL Cluster Processes

To start the MySQL Cluster processes:

  1. Enter the following commands in order:

    ./ndb_mgmd -f /var/lib/mysql-cluster/config.ini
    ./ndbd
    mysqld_safe--ndb_nodeid=4 --user=mysql& 
    

    After you run these commands, the ndb_mgm prompt appears.

  2. Check the status of the cluster by entering the following command:

    ndb_mgm> show
    

    The status of the cluster is displayed on the command line. For example:

    Connected to Management Server at: 12.345.67.81:1186
    Cluster Configuration
    ---------------------
    [ndbd(NDB)]     2 node(s)
    id=2    @12.345.67.82  (mysql-5.5.30 ndb-7.2.12, Nodegroup: 0, Master)
    id=3    @12.345.67.83  (mysql-5.5.30 ndb-7.2.12, Nodegroup: 1)
    
    [ndb_mgmd(MGM)] 1 node(s)
    id=1    @12.345.67.82  (mysql-5.5.30 ndb-7.2.12)
    
    [mysqld(API)]   3 node(s)
    id=4    @12.345.67.82  (mysql-5.5.30 ndb-7.2.12)
    id=5    @12.345.67.83  (mysql-5.5.30 ndb-7.2.12)
    id=6 (not connected, accepting connect from any host)
    

    Wait for the data nodes to finish starting.

  3. Start your MySQL server.