Sun Java System Portal Server 7.2 Deployment Planning Guide

Deploying Communities on a High-Availability Database

To provide high availability to an enterprise scale community, the Derby database that is installed with Portal Server must be replaced by a JDBC connectable database that provides high availability.

ProcedureTo Replace the Derby Database

  1. Set up the database.

    1. Install RDBMS or identify one that already exits on the system.

    2. Create Database instance (or tablespace in the case of Oracle) to be used by collaboration.

    3. Create database user accounts.

    4. Establish appropriate privileges for the user accounts.

  2. Set up the Web Container for the New Database.

    1. Locate the JDBC driver.

    2. Add the JDBC driver to the web container's JVM software classpath.

    3. Add the JVM software option.

      -Djdbc.drivers=JDBC_DRIVER_CLASS

  3. Configure Community Membership and Configuration.

    1. Configure the communitymc database configuration file:

      PORTAL-DATA-DIR/portals/PORTAL-ID/config/portal.dbadmin.

      Parameters

      db.driver=vendor-specific-classpath.jdbc.ClientDriver

      db.driver.classpath=/opt/jarfile-directory-pathclient.jar

      community.db.user=database-user-account (created in step 1c).

      community.db.password=database-user-account-password (created in step 1c).

      community.db.url=jdbc:xxx://xxxxx.pstest.com:port/database-instance-created-in-step-1b.

    2. Remove the derby-specific property in:

      PORTAL-DATA-DIR/portals/PORTAL-ID/config/communitymc.properties.

      For example: javax.jdo.option.Mapping=derby

    3. Load the schema onto the database by using the following commands:

      cd /var/opt/SUNWportal/portals/portal1/config

      /usr/sfw/bin/ant -f config.xml -D"portal.id=portal1" configure

    4. Edit the JDBC resource in the web container configuration to point to the new database.

  4. Configure and Install Portlet Applications.

    1. Locate the portlet applications:

      PORTAL-DATA-DIR/portals/PORTAL-ID/portletapps

    2. Configure the portlet applications to use the new database, for example:

      cd /var/opt/SUNWportal/portals/portal1/portletapps/surveys

      Edit the tokens_xxx.properties file.

    3. Create the JDBC Resource for each application using the values from the tokens_xxx.properties file.

      • Resource JNDI Name: jdbc/DB-JNDI-NAME

      • Resource Type: javax.sql.DataSource

      • Datasource Classname: DB-DATASOURCE

      • User: DB-USER

      • Password: DB-PASSWORD

      • URL: DB-URL

    4. Undeploy the existing portlets that use Derby Database as the datastore.

    5. Deploy the newly configured portlet applications.

ProcedureTo Deploy High-Availability Database

Before You Begin

Install the Oracle 10g Release 2 database.

  1. Prepare the Oracle database.

    1. Create a database instance named portal. An example is, SID=portal.


      Note –

      To avoid ORA-27102 out of memory errors on Solaris 10, perform the following command: projadd -U oracle -K "project.max-shm-memory=(priv,4294967295B,deny)" user.oracle


    2. b. Log in to the Oracle Enterprise Manager as SYSTEM. The path is typically http://hostname:1158/em. (em stands for Enterprise Manager).

      or command line sqlplus /nolog CONNECT sys/password AS SYSDBA;

    3. Create a tablespace communitymc_portal-ID for example, communitymc_portal1.

      For example,


      SQL> CREATE TABLESPACE COMMUNITYMC_PORTAL1 LOGGING DATAFILE '
      /app/oracle/oradata/portal/communitymc_01.dbf' SIZE 400M REUSE AUTOEXTEND ON NEXT  
      1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL;
    4. Create a user account with the following values:

      Username: portal

      Password: portal

      Default Tablespace: communitymc_Portal—ID

      Assign roles: CONNECT and RESOURCE

      For example,


      SQL> create user portal identified by portal;
      
      SQL>alter user portal default tablespace  COMMUNITYMC_PORTAL1;
      
      SQL> grant connect,resource to portal;
  2. Prepare the web container for the new database.

    1. Locate the Oracle JDBC driver using one of the following methods. The file isojdbc14.jar.

      • Use the existing ojdbc14.jar file on the machine on which Oracle is installed. It is normally located in: $ORACLE_HOME/jdbc/lib/ojdbc14.jar.

      • Download the ojdbc14.jar file from the Oracle web site. Verify that you download the version that is compatible with the your Oracle RDBMS.

    2. Add the JDBC driver to the JVM software classpath.

      Add the JDBC driver (ojdbc14.jar) to the JVM software classpath.

      For example,

      class-path-suffix...//opt/SUNWjavadb/lib/derbyclient.jar: /oracle/ojdbc14.jar...

    3. Add the following JVM software option:

      -Djdbc.drivers=oracle.jdbc.OracleDriver.

      For example, in Web Server server.xml

      <jvm-options>-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver</jvm-options>

      <jvm-options>-Djdbc.drivers=oracle.jdbc.OracleDriver</jvm-options>


      Note –

      It is possible to remove the derby classfiles and options once all the portlets/applications that are using derby database JDBC resources have been converted to using oracle resources.


  3. Configure Community Membership and Configuration.

    1. Edit the communitymc database configuration file:

      vi Portal-data-dir/portals/Portal-ID/config/portal.dbadmin

      db.driver=oracle.jdbc.OracleDriver

      db.driver.classpath=JDBC-Driver-Path/ojdbc14.jar url=jdbc:oracle:thin:@Oracle-Host:Oracle-Port:portal

      For example, portal.dbadmin


      db.driver=oracle.jdbc.OracleDriver
      db.driver.classpath=/oracle/ojdbc14.jar
      community.db.user=portal
      community.db.password=portal
      community.db.url=jdbc:oracle:thin:@machine1.pstest.com:1521:portal
      portal.id=portal1
    2. Remove or comment out the following property from the communitymc configuration file.

      vi Portal-Data-Dir/portals/Portal-ID/config/communitymc.properties

      #javax.jdo.option.Mapping=derby

    3. Load the community schema onto Oracle by using the following commands:

      cd /var/opt/SUNWportal/portals/portal1/config

      /usr/sfw/bin/ant -f config.xml -D"portal.id=portal1" configure

    4. Check that tables have been created in Oracle by typing the following:


      SQL> connect portal/portal
      Connected.
      SQL> select * from cat;
       
      TABLE_NAME                     TABLE_TYPE
      ------------------------------ -----------
      BIN$I3usV+V+I7HgRAgAIMbswQ==$0 TABLE
      JPOX_TABLES                    TABLE
      COMMUNITY                      TABLE
      COMMUNITY_USER                 TABLE
      COMMUNITY_DP                   TABLE
    5. Edit the communitymc JDBC resource to point to Oracle.

      1. Log in to the web container administration console.

      2. Locate the JDBC resource named jdbc/communitymc.

      3. Set the Datasource classname to oracle.jdbc.pool.OracleDataSource.

      4. Set following properties:

        • user: portal

        • password: portal

        • url: jdbc:oracle:thin:@Oracle-Host:Oracle-Port:portal


        <jdbc-resource>
            <jndi-name>jdbc/communitymc</jndi-name>
            <datasource-class>oracle.jdbc.pool.OracleDataSource</datasource-class>
            <idle-timeout>30</idle-timeout>
            <wait-timeout>10</wait-timeout>
            <property>
              <name>Password</name>
              <value>portal</value>
            </property>
            <property>
              <name>portNumber</name>
              <value>1521</value>
            </property>
            <property>
              <name>databaseName</name>
              <value>communitymc_portal1</value>
            </property>
            <property>
              <name>User</name>
              <value>portal</value>
            </property>
            <property>
              <name>serverName</name>
              <value>machine1.pstest.com</value>
              <description/>
            </property>
            <property>
              <name>url</name>
              <value>jdbc:oracle:thin:@machine1.pstest.com:1521:portal</value>
              <description/>
            </property>
          </jdbc-resource>

      Note –

      On some web containers, you might need to edit the JDBC Connection Pool instead of the JDBC resource.


  4. Configure and Install the Fileshare, Surveys, and Wiki Portlet Applications.

    1. Locate the portlet application:

      Portal-Data-Dir/portals/Portal-ID/portletapps/Portlet_Application

    2. Configure tokens_ora.properties.

      Each application located under /portals/portal1/portletapps/ has its own tokens_ora.properties file in addition to a tokens.properties file. The necessary oracle database access parameters need to be corrected in the tokens_ora.properties file to reflect the actual database connectivity.

    3. Create a JDBC Resource for each application using the values from the tokens_ora.properties file.

      • Resource JNDI Name: jdbc/OracleFilesharingDB. The value should match the DB-JNDI-NAME value in the tokens_ora.properties file.

      • Resource Type: javax.sql.DataSource.

      • Datasource Classname: oracle.jdbc.pool.OracleDataSource. The value should match DB-DATASOURCE value in the tokens_ora.properties file.

      • User: portalfs. The value should match the DB-USER value in the tokens_ora.properties file.

      • Password: portalfs. The value should match the DB_PASSWORD value in the tokens_ora.properties file.

      • URL: jdbc:oracle:thin:@oracle.acme.com:1521:portal. The value should match the DB-URL value in the tokens_ora.properties file.


      Note –

      On some web containers, you might need to define the JDBC Connection Pool connection pool prior to setting up the JDBC resource.


    4. Undeploy the existing portlets that use the Derby Database as the datastore.

      /opt/SUNWportal/bin/psadmin undeploy-portlet -u uid=amadmin,ou=people,dc=acme,dc=com -f Password-File -p Portal ID -g portlet

    5. Deploy the newly configured portlet.

      cd Portal-Data-Dir/portals/Portal-ID/portletapps/Portlet_Application

      /usr/sfw/bin/ant -D"portal.id=portal1" -Dapp.version=ora