Sun N1 Grid Engine 6.1 Installation Guide

ProcedureHow to Set Up dbWriter

  1. Extract the accounting and reporting software using either the tar method or the pkgadd method.

    • tar Method


      # cd sge-root
      

      Type the following command as one string, with a space between the -dc and the path to the tar file.


      # gunzip -dc 
      cdrom-mount-point/N1_Grid_Engine_6_1/ARCo/tar/n1ge-6_0-arco-1_0.tar.gz | tar xvpf -
      
    • pkgadd Method

      At the command prompt, type the following command and respond to the script questions.


      # cd cdrom_mount_point/N1_Grid_Engine_6_1/ARCo/Packages
      # pkgadd -d . SUNWsgeea
      
  2. As the administrative user, set your environment variables.

    • If you are using a Bourne shell or Korn shell, type the following command:


      $ . sge-root/default/common/settings.sh
      
    • If you are using a C shell, type the following command:


      % source sge-root/default/common/settings.csh
      
  3. Change the global configuration to enable reporting.

    For details on how to enable reporting, see Report Statistics (ARCo) in Sun N1 Grid Engine 6.1 Administration Guide.


    % qconf -mconf
    <......>
    reporting_params    accounting=true \
     reporting=true flush_time=00:00:15 joblog=true \
     sharelog=00:00:00<......>
    

    By default, no report variables are activated. You can use the qconf command to enable statistics gathering on specific variables, as shown in the following example.


    % qconf -me global
    hostname              global
    <......>
    report_variables      cpu,np_load_avg,mem_free,virtual_free
    <......>
  4. Install the dbWriter software.


    Note –

    The dbwriter software needs to be installed as user root.



    # cd sge-root/dbwriter
    % cd sge-root/dbwriter
    % su
    password:
    # ./inst_dbwriter
    # ./inst_dbwriter
    
    Welcome to the GE installation
    ---------------------------------------
    
    GE dbWriter installation
    ---------------------------------
    The dbWriter installation will take approximately 5 minutes
    
    Hit <RETURN> to continue >> 
  5. Specify the location of sge-root, and the name of your cell or cells.


    Hit <RETURN> to continue >> 
    
    Checking $SGE_ROOT directory
    ----------------------------
    
    The GE root directory is:
    
       $SGE_ROOT = /opt/n1ge6
    
    If this directory is not correct (e.g. it may contain an automounter
    prefix) enter the correct path to this directory or hit <RETURN>
    to use default [/opt/n1ge6] >> 
    
    Your $SGE_ROOT directory: /opt/n1ge6
    
    Hit <RETURN> to continue >> 
    
    GE cells
    -----------------
    
    GE supports multiple cells.
    
    If you are not planning to run multiple GE clusters or if you don't
    know yet what is a GE cell it is safe to keep the default cell name
    
       default
    
    If you want to install multiple cells you can enter a cell name now.
    
    The environment variable
    
       $SGE_CELL=<your_cell_name>
    
    will be set for all further GE commands.
    
    Enter cell name [default] >> 
    
    Using cell >default<. 
    Hit <RETURN> to continue >> 
  6. Specify the location of your Java Software Development Kit.

    Version 1.4.2 or higher is required. If your JAVA_HOME environment variable is set, the script will use that as a default value.


    Please enter the path to your java 1.4 installation [/usr/java] >>/opt/j2sdk1.4.2_06
    
  7. Specify the connection parameters for the reporting database.


    Setup your database connection parameters
    -----------------------------------------
    
    Enter your database type ( o = Oracle, p = PostgreSQL, m = MySQL ) [] >> p
    
    Please enter the name of your postgres db host []>> my-host.my-domain
    
    Please enter the port of your postgres db [5432] >>
    
    Please enter the name of your postgres database [arco] >> 
  8. Provide the user name and password of the database user.


    Please enter the name of the database user [arco_write] >> 
    
    Please enter the password of the database user >> 
    Please retype the password >> 
  9. Type the name of the database schema.

    • If the JDBC driver is found, you will be asked for the name of the schema.

      For PostgreSQL this value is normally public. For Oracle, this value should be the user name of the database owner (arco_write).


      Please enter the name of the database schema [public] >> 
      
      Search for the jdbc driver org.postgresql.Driver 
      in directory /opt/n1ge6/dbwriter/lib ..........
      found in /opt/n1ge6/dbwriter/lib/pg73jdbc2.jar
      
      OK, jdbc driver found
    • If no corresponding JDBC driver is found, you are asked to copy the JAR file of the database driver into the sge-root/dbwriter/lib directory.


      Note –

      The JDBC driver for PostgresSQL is provided with the installation. If you install the ARCo software on Oracle or MySQL, you should copy the appropriate JDBC driver into the $SGE_ROOT/dbwriter/lib directory.


      After you copy the JAR file to the correct location, press RETURN, and the search repeats.


      Error: jdbc driver org.postgresql.Driver
             not found in any jar file of directory
             /opt/n1ge6/dbwriter/lib
      
      Please copy a jdbc driver for your database into
      this directory!
      
      Press enter to continue >>
  10. Verify that the database has been set up correctly.


    Should the connection to the database be tested? (y/n) [y] >> 
    • If the test succeeds, you will be notified.


      Test db connection to 'jdbc:postgresql://my-host.my-domain:5432/arco' ... OK
    • If the test fails, you are given the option to repeat the setup procedure.


      Test db connection to 'jdbc:postgresql://my-host.my-domain:5432/arco' ... Failed
      Do you want to repeat database connection setup? (y/n) [y] >>
  11. Database model initialization or upgrade

    During the next step, the database tables are created or updated and the user arco_read is granted limited access to the database tables. The ARCo web application connects to the database using the user arco_readuser.


    Query db version ... no sge tables found
    New version of the database model is needed
    
    Should the database model be upgraded to version 1? (y/n) [y] >> 
    
    
    The ARCo web application connects to the database
    with a user which has restricted access.
    The name of this database user is needed to grant
    the user access to the sge tables.
    
    Please enter the name of this database user [arco_read] >> 
    Upgrade to database model version 1 ... Install version 6.0 (id=0) -------
    Create table sge_job
    Create index sge_job_idx0
    Create index sge_job_idx1
    create table sge_job_usage
    Create table sge_job_log
    Create table sge_job_request
    Create table sge_job_request
    Create table sge_queue
    Create index sge_queue_idx0
    Create table sge_queue_values
    Create index sge_queue_values_idx0
    Create table sge_host
    Create index sge_host_idx0
    Create table sge_host_values
    Create index sge_host_values_idx0
    Create table sge_department
    Create index sge_department_idx0
    Create table sge_department_values
    Create index sge_department_values_idx0
    Create table sge_project
    Create index sge_project_idx0
    Create table sge_project_values
    Create index sge_project_values_idx0
    Create table sge_user
    Create table sge_user_values
    Create index sge_user_values_idx0
    Create table sge_group
    Create index sge_group_idx0
    Create table sge_group_values
    Create index sge_group_values_idx0
    Create table sge_share_log
    Create view view_accounting
    Create view view_job_times
    Create view view_jobs_completed
    Create view view_job_log
    Create view view_department_values
    Create view view_group_values
    Create view_host_values
    Create view view_project_values
    Create view view_queue_values
    Create view view_user_values
    committing changes
    version 6.0 (id=0) successfully installed
    Install version 6.0u1 (id=1) -------
    Create table sge_version
    Update view view_job_times
    Update version table
    committing changes
    version 6.0u1 (id=1) successfully installed
    OK
  12. Specify how often the dbWriter program should check the N1 Grid Engine log files for new data.


    Please enter the interval between two dbwriter runs in seconds [60] >> 
  13. Specify the spool directory for the dbwriter.

    The dbwriter log files are stored in this directory. At startup the dbwriter process writes its pid in the file dbwriter.pid in this directory.


    Please enter the path of the dbwriter spool directory [$SGE_ROOT/$SGE_CELL/spool/dbwriter]>>
  14. Type the location of the file containing the rules for calculating derived values.

    Based on the accounting and reporting data, the dbWriter program calculates some derived values. The derived values are reporting information that are calculated from one or more raw values. The dbWriter program also enables you to delete data from the reporting database, when that data is not longer needed. The rules governing the derived value calculations and data deletion are stored in a file. The dbWriter program distribution contains an example file for a PostgreSQL database and an example file for an Oracle database. The example files are $SGE_ROOT/dbwriter/database/postgres/dbwriter.xml and $SGE_ROOT/dbwriter/database/oracle/dbwriter.xml

    You can accept the default file location, or you can specify a alternative path.


    Please enter the file with the derived value rules 
    [$SGE_ROOT/dbwriter/database/postgres/dbwriter.xml] >>
  15. Set the level of logging that the dbWriter program should use.


    The dbWriter can run with different debug levels
    Possible values: WARNING INFO CONFIG FINE FINER FINEST
    Please enter the debug level of the dbwriter [INFO] >> 
  16. Verify the settings.

    If you answer n, you are given the option to repeat the setup.


    All parameters are now collected
    --------------------------------
    
          SGE_ROOT=/opt/n1ge6
          SGE_CELL=default
         JAVA_HOME=/usr/java (java version "1.4.2")
            DB_URL=jdbc:postgresql://my-host.my-domain:5432/arco
           DB_USER=arco_write
          INTERVAL=60
    REPORTING_FILE=/opt/n1ge6/default/common/reporting
      DERIVED_FILE=/opt/n1ge6/dbwriter/database/postgres/dbwriter.xml
       DEBUG_LEVEL=INFO
    
    Are this settings correct? (y/n) [y] >> y
    

    The installation scripts creates a start script, sge-root/dbwriter/bin/sgedbwriter. Your configuration parameters are stored in sge-root/cell/common/dbwriter.conf. If any configuration changes are necessary, you can edit the dbwriter.conf file or repeat the installation script.


    Create configuration file for dbWriter in 
    /opt/n1ge6/default/common
  17. The installation script prompts you to choose whether to install a boot time startup script for the dbwriter:


    dbwriter startup script
    -----------------------
    
    We can install the startup script that will
    start dbwriter at machine boot (y/n) [y] >> y
    Installing startup script /etc/rc2.d/S96sgedbwriter
    Installation of dbWriter completed
  18. Start the dbWriter program.


    # /etc/init.d/sgedbwriter start