1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Quad incAdvent Calendar 2017

Day 6

AWS 上に JobScheduler を構築した話

Posted at

AWSには自前でジョブ実行用のサービスがあるので、こういうのはあまりやらないと思いますが、色々とハマったのでメモ。

インストール

JobScheduler インストール

  1. インストーラーをここからダウンロードします。

    スクリーンショット 2017-06-08 0.33.37.png

  2. 解凍した中にある jobscheduler_install.xml を以下の形に修正します。

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    
        <!-- Select the license model (GPL or Commercial) -->
        <entry key="licenceOptions" value="GPL"/>

        <!-- If you selected GPL as license model than the licence must be empty.
             Otherwise please enter a license key if available.
             It is also possible to modify the license key later. -->
        <entry key="licence" value=""/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.HTMLLicencePanel id="gpl_licence"/>
<com.izforge.izpack.panels.HTMLLicencePanel id="commercial_licence"/>
<com.izforge.izpack.panels.TargetPanel id="target">

    <!-- SELECT THE INSTALLATION PATH FOR THE BINARIES AND LIBRARIES
         The installation expands this path with the Scheduler ID as subdirectory.
         The path must be absolute!
         Default paths are
         /opt/sos-berlin.com/jobscheduler for Unix
         C:\Program Files\sos-berlin.com\jobscheduler for Windows -->
    <installpath>/opt/sos-berlin.com/jobscheduler</installpath>

</com.izforge.izpack.panels.TargetPanel>
<com.izforge.izpack.panels.UserPathPanel id="userpath">

    <!-- SELECT THE DATA PATH FOR CONFIGURATION AND LOG FILES
         The installation expands this path with the Scheduler ID as subdirectory.
         The path must be absolute!
         Default paths are
         /home/[user]/sos-berlin.com/jobscheduler for Unix
         C:\ProgramData\sos-berlin.com\jobscheduler for Windows -->
    <UserPathPanelElement>/home/joc/jobscheduler</UserPathPanelElement>

</com.izforge.izpack.panels.UserPathPanel>
<com.izforge.izpack.panels.PacksPanel id="package">

    <!-- SELECT THE PACKS WHICH YOU WANT INSTALL -->

    <!-- Package: JobScheduler
         JobScheduler Basic Installation
         THIS PACK IS REQUIRED. IT MUST BE TRUE -->
    <pack index="0" name="Job Scheduler" selected="true"/>

    <!-- Package: Database Support
         Job history and log files can be stored in a database. Database support is
         available for MySQL, PostgreSQL, Oracle, SQL Server, DB2.
         THIS PACK IS REQUIRED. IT MUST BE TRUE -->
    <pack index="2" name="Database Support" selected="true"/>

    <!-- Package: Housekeeping Jobs
         Housekeeping Jobs are automatically launched by the Job Scheduler, e.g. to send
         buffered logs by mail, to remove temporary files or to restart the JobScheduler. -->
    <pack index="5" name="Housekeeping Jobs" selected="true"/>

</com.izforge.izpack.panels.PacksPanel>
<com.izforge.izpack.panels.UserInputPanel id="network">
    <userInput>
        <!-- Network Configuration -->

        <!-- Enter the name or ip address of the host on which the JobScheduler is operated -->
        <entry key="schedulerHost" value="localhost"/>

        <!-- Enter the port for TCP communication -->
        <entry key="schedulerPort" value="4444"/>

        <!-- Enter the port for HTTP communication -->
        <entry key="schedulerHTTPPort" value="40444"/>

        <!-- To enter a JobScheduler ID is required.
             The IDs of multiple instances of the JobScheduler must be unique per server.
             The JobScheduler ID expands the above installation paths as subdirectory.
             Please omit special characters like: / \ : ; * ? ! $ % & " < > ( ) | ^ -->
        <entry key="schedulerId" value="schedulerId_XXXX"/>

        <!-- It is recommended to enable TCP access for the host where the JobScheduler will install,
             optionally enter additional host names or ip addresses. To enable all hosts in your
             network to access the JobScheduler enter '0.0.0.0'. -->
        <entry key="schedulerAllowedHost" value="0.0.0.0"/>

        <!-- Choose (yes or no) wether the JobScheduler should be started at the end of the installation -->
        <entry key="launchScheduler" value="yes"/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="cluster">
    <userInput>
        <!-- Cluster Configuration -->

        <!-- The JobScheduler can be installed independent of other possibly JobSchedulers,
             as a primary JobScheduler in a backup system or as a backup JobScheduler.
             Use '' for a standalone, '-exclusive' for a primary
             or '-exclusive -backup' for a backup JobScheduler.
             A database is required for a backup system. All JobSchedulers in a backup system
             must have the same JobScheduler ID and the same database.
             Further you can set '-distributed-orders' for a load balancing cluster.
             For more information see
             http://www.sos-berlin.com/doc/de/scheduler.doc/backupscheduler.xml
             http://www.sos-berlin.com/doc/de/scheduler.doc/distributed_orders.xml -->
        <entry key="clusterOptions" value=""/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="smtp">
    <userInput>
        <!-- Mail Recipients Configuration / SMTP Authentication -->

        <!-- Enter the ip address or host name and port (default: 25) of your SMTP server -->
        <entry key="mailServer" value=""/>
        <entry key="mailPort" value="25"/>

        <!-- Configure the SMTP authentication if necessary. -->
        <entry key="smtpAccount" value=""/>
        <entry key="smtpPass" value=""/>

        <!-- Enter the addresses of recipients to which mails with log files are automatically
             forwarded. Separate multiple recipients by commas -->

        <!-- Account from which mails are sent -->
        <entry key="mailFrom" value=""/>

        <!-- Recipients of mails -->
        <entry key="mailTo" value=""/>

        <!-- Recipients of carbon copies: -->
        <entry key="mailCc" value=""/>

        <!-- Recipients of blind carbon copies -->
        <entry key="mailBcc" value=""/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="email">
    <userInput>
        <!-- Mail Configuration / Event Handler -->

        <!-- Choose in which cases mails with log files are automatically forwarded. -->
        <entry key="mailOnError" value="no"/>
        <entry key="mailOnWarning" value="no"/>
        <entry key="mailOnSuccess" value="no"/>

        <!-- The Housekeeping package is required for configure JobScheduler as event handler
             Choose this option if you intend to use JobScheduler Events and
             - this JobScheduler instance is the only instance which processes Events
             - this JobScheduler instance is a supervisor for other JobSchedulers which submit Events -->
        <entry key="jobEvents" value="off"/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="database">
    <userInput>
        <!-- JobScheduler Database Configuration -->

        <!-- Choose the database management system. Supported values are 'mysql' for MySQL,
             'oracle' for Oracle, 'mssql' for MS SQL Server, 'pgsql' for PostgreSQL,
             'db2' for DB2 and 'sybase' for Sybase. -->
        <entry key="databaseDbms" value="mysql"/>

        <!-- You can choose between 'on' or 'off' to create the database tables.
             If you have modified the initial data of an already existing installation,
             then the modifications will be undone. Data added remains unchanged.
             This entry should be only 'off', when you sure, that all tables are already created. -->
        <entry key="databaseCreate" value="on"/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="dbconnection">
    <userInput>
        <!-- JobScheduler Database Configuration -->

        <!-- Enter the name or ip address of the database host -->
        <entry key="databaseHost" value="the host of RDS"/>

        <!-- Enter the port number for the database instance. Default ports are for MySQL 3306,
             Oracle 1521, MS SQL Server 1433, postgreSQL 5432, DB2 50000, Sybase 5000. -->
        <entry key="databasePort" value="3306"/>

        <!-- Enter the schema -->
        <entry key="databaseSchema" value="jobscheduler_data"/>

        <!-- Enter the user name for database access -->
        <entry key="databaseUser" value="databaseUser"/>

        <!-- Enter the password for database access -->
        <entry key="databasePassword" value="databasePassword"/>

        <!-- You have to provide the MySQL, MS SQL Server, Sybase or DB2 JDBC driver respectively if you selected
             corresponding DBMS type. For license reasons MySQL, Sybase and MS SQL Server JDBC Drivers are
             not provided. Alternatively you can use the mariadb JDBC Driver for MySQL and
             the jTDS JDBC Driver for MS SQL Server and Sybase which is provided. -->

        <!-- You can choose between 'yes' or 'no' for using the jTDS JDBC Driver
             This entry affects only MS SQL Server or Sybase -->
        <entry key="connectorJTDS" value="yes"/>

        <!-- You can choose between 'yes' or 'no' for using the mariadb JDBC Driver
             This entry affects only MySQL -->
        <entry key="connectorMaria" value="yes"/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="jdbc">
    <userInput>
        <!-- JobScheduler Database Configuration -->

        <!-- Configuration for JDBC Driver
             This entry is only necessary if you selected a DBMS type such as MySQL,
             MS SQL Server, Sybase ot DB2 in the previous <userInput> element. -->

        <!-- You have to provide the MySQL, MS SQL Server, Sybase or DB2 JDBC driver respectively if you selected
             corresponding DBMS type. For license reasons MySQL and MS SQL Server JDBC Drivers are
             not provided. Specify the JDBC Driver source (e.g. mysql-connector-java-*.jar for MySQL,
             sqljdbc.jar for MS SQL Server, jconn3.jar for Sybase). Alternatively you can use the mariadb
             JDBC Driver for MySQL and the jTDS JDBC Driver for MS SQL Server and Sybase which is provided. -->

        <!-- Select the path to JDBC Driver -->
        <entry key="connector" value="/usr/share/java/mariadb-connector-java.jar"/>

        <!-- Only for DB2: Select the path to DB2 license file for JDBC Driver -->
        <entry key="connectorLicense" value=""/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="reportingDatabase">
    <userInput>
        <!-- Reporting Database Configuration
             NOT SUPPORTED FOR SYBASE AND DB2 -->

        <!-- Set 'yes' if the JobScheduler and the Reporting database are the same.
             If 'yes' then further Reporting database variables are ignored. -->
        <entry key="sameDbConnection" value="yes"/>

        <!-- Choose the database management system. Supported values are 'mysql' for MySQL,
             'oracle' for Oracle, 'mssql' for MS SQL Server, 'pgsql' for PostgreSQL. -->
        <entry key="reporting.databaseDbms" value="mysql"/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="reportingDbconnection">
    <userInput>
        <!-- Reporting Database Configuration
             NOT SUPPORTED FOR SYBASE AND DB2 -->

        <!-- Enter the name or ip address of the database host -->
        <entry key="reporting.databaseHost" value="qnet-jobscheduler.c58hqrvwigfw.ap-northeast-1.rds.amazonaws.com"/>

        <!-- Enter the port number for the database instance. Default ports are for MySQL 3306,
             Oracle 1521, MS SQL Server 1433, postgreSQL 5432. -->
        <entry key="reporting.databasePort" value="3306"/>

        <!-- Enter the schema -->
        <entry key="reporting.databaseSchema" value="jobscheduler_data"/>

        <!-- Enter the user name for database access -->
        <entry key="reporting.databaseUser" value="reporting.databaseUser"/>

        <!-- Enter the password for database access -->
        <entry key="reporting.databasePassword" value="reporting.databasePassword"/>

        <!-- You have to provide the MySQL or MS SQL Server JDBC driver respectively if you selected
             corresponding DBMS type. For license reasons MySQL and MS SQL Server JDBC Drivers
             are not provided. Alternatively you can use the mariadb JDBC Driver for MySQL and the
             jTDS JDBC Driver for MS SQL Server which is provided. -->

        <!-- You can choose between 'yes' or 'no' for using the jTDS JDBC Driver
             This entry affects only MS SQL Server -->
        <entry key="reporting.connectorJTDS" value="yes"/>

        <!-- You can choose between 'yes' or 'no' for using the mariadb JDBC Driver
             This entry affects only MySQL -->
        <entry key="reporting.connectorMaria" value="yes"/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="reportingJdbc">
    <userInput>
        <!-- Reporting Database Configuration
             NOT SUPPORTED FOR SYBASE AND DB2 -->

        <!-- Configuration for JDBC Driver
             This entry is only necessary if the package 'Database Support' is chosen and you
             selected a DBMS type MySQL or MS SQL Server in the previous
             <userInput> element. -->

        <!-- You have to provide the MySQL or MS SQL Server JDBC driver respectively if you selected
             corresponding DBMS type. For license reasons MySQL and MS SQL Server JDBC Drivers are
             not provided. Specify the JDBC Driver source (e.g. mysql-connector-java-*.jar for MySQL,
             sqljdbc.jar for MS SQL Server). Alternatively you can use the mariadb JDBC Driver for
             MySQL and the jTDS JDBC Driver for MS SQL Server which is provided. -->

        <!-- Select the path to JDBC Driver -->
        <entry key="reporting.connector" value="/usr/share/java/mariadb-connector-java.jar"/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="end">
    <userInput/>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.InstallPanel id="install"/>
<com.izforge.izpack.panels.ProcessPanel id="process"/>
<com.izforge.izpack.panels.FinishPanel id="finish"/>
```
  1. setup.sh を実行します

    ./setup.sh jobscheduler_install.xml
    

JOC インストール

  1. JobScheduler と同様に JOC をダウンロードします。

    スクリーンショット 2017-06-08 0.35.42.png

  2. joc_install.xml を修正します。

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    
    <!-- SELECT THE INSTALLATION PATH
         It must be absolute!
         For example:
         /opt/sos-berlin.com/joc on Linux
         C:\Program Files\sos-berlin.com\joc on Windows -->
    <installpath>/opt/sos-berlin.com/joc</installpath>

</com.izforge.izpack.panels.TargetPanel>
<com.izforge.izpack.panels.UserInputPanel id="jetty">
    <userInput>

        <!-- JOC requires a servlet container such as Jetty.
             If a servlet container already installed then you can use it.
             Otherwise a Jetty will be installed in addition if withJettyInstall=yes.
             You need root permissions to install JOC with Jetty. -->
        <entry key="withJettyInstall" value="yes"/>
        <entry key="jettyPort" value="4446"/>
        <!-- Only necessary for Windows -->
        <entry key="jettyStopPort" value="40446"/>
        <!-- Only necessary for Unix (root permissions required) -->
        <entry key="withJocInstallAsDaemon" value="yes"/>
        <!-- Path to Jetty base directory
             For example:
             /homer/[user]/sos-berlin.com/joc on Linux
             C:\ProgramData\sos-berlin.com\joc on Windows -->
        <entry key="jettyBaseDir" value="/home/joc/jetty"/>

        <!-- Java options for Jetty. -->
        <!-- Initial memory pool (-Xms) in MB -->
        <entry key="jettyOptionXms" value="128"/>
        <!-- Maximum memory pool (-Xmx) in MB -->
        <entry key="jettyOptionXmx" value="512"/>
        <!-- Thread stack size (-Xss) in KB -->
        <entry key="jettyOptionXss" value="4000"/>
        <!-- Further Java options -->
        <entry key="jettyOptions" value=""/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="reportingDatabase">
    <userInput>
        <!-- Reporting Database Configuration -->

        <!-- Choose the database management system. Supported values are 'mysql' for MySQL,
             'oracle' for Oracle, 'mssql' for MS SQL Server, 'pgsql' for PostgreSQL. -->
        <entry key="reporting.databaseDbms" value="mysql"/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="reportingDbconnection">
    <userInput>
        <!-- Reporting Database Configuration -->

        <!-- Enter the name or ip address of the database host -->
        <entry key="reporting.databaseHost" value="qnet-jobscheduler.c58hqrvwigfw.ap-northeast-1.rds.amazonaws.com"/>

        <!-- Enter the port number for the database instance. Default ports are for MySQL 3306,
             Oracle 1521, MS SQL Server 1433, postgreSQL 5432. -->
        <entry key="reporting.databasePort" value="3306"/>

        <!-- Enter the schema -->
        <entry key="reporting.databaseSchema" value="jobscheduler_data"/>

        <!-- Enter the user name for database access -->
        <entry key="reporting.databaseUser" value="qnet_admin"/>

        <!-- Enter the password for database access -->
        <entry key="reporting.databasePassword" value="7sYne7aFEsFSK7xh"/>

        <!-- You have to provide the MySQL or MS SQL Server JDBC driver respectively if you selected
             corresponding DBMS type. For license reasons MySQL and MS SQL Server JDBC Drivers are
             not provided. Alternatively you can use the mariadb JDBC Driver for MySQL and
             the jTDS JDBC Driver for MS SQL Server which is provided. -->

        <!-- You can choose between 'yes' or 'no' for using the jTDS JDBC Driver
             This entry affects only MS SQL Server -->
        <entry key="reporting.connectorJTDS" value="yes"/>

        <!-- You can choose between 'yes' or 'no' for using the mariadb JDBC Driver
             This entry affects only MySQL -->
        <entry key="reporting.connectorMaria" value="yes"/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="reportingJdbc">
    <userInput>
        <!-- Reporting Database Configuration -->

        <!-- Configuration for JDBC Driver
             This entry is only necessary if you selected a DBMS type such as MySQL and
             MS SQL Server in the previous <userInput> element. -->

        <!-- You have to provide the MySQL or MS SQL Server JDBC driver respectively if you selected
             corresponding DBMS type. For license reasons MySQL and MS SQL Server JDBC Drivers are
             not provided. Specify the JDBC Driver source (e.g. mysql-connector-java-*.jar for MySQL,
             sqljdbc.jar for MS SQL Server). Alternatively you can use the mariadb
             JDBC Driver for MySQL and the jTDS JDBC Driver for MS SQL Server which is provided. -->

        <!-- Select the path to JDBC Driver -->
        <entry key="reporting.connector" value="/usr/share/java/mariadb-connector-java.jar"/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="database">
    <userInput>
        <!-- JobScheduler Database Configuration -->

        <!-- Set 'yes' if the Reporting and the JobScheduler database are the same.
             If 'yes' then further JobScheduler database variables are ignored. -->
        <entry key="sameDbConnection" value="yes"/>

        <!-- Choose the database management system. Supported values are 'mysql' for MySQL,
             'oracle' for Oracle, 'mssql' for MS SQL Server, 'pgsql' for PostgreSQL,
             'db2' for DB2 and 'sybase' for Sybase. -->
        <entry key="databaseDbms" value=""/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="dbconnection">
    <userInput>
        <!-- JobScheduler Database Configuration -->

        <!-- Enter the name or ip address of the database host -->
        <entry key="databaseHost" value="qnet-jobscheduler.c58hqrvwigfw.ap-northeast-1.rds.amazonaws.com"/>

        <!-- Enter the port number for the database instance. Default ports are for MySQL 3306,
             Oracle 1521, MS SQL Server 1433, postgreSQL 5432, DB2 50000, Sybase 5000. -->
        <entry key="databasePort" value="3306"/>

        <!-- Enter the schema -->
        <entry key="databaseSchema" value="jobscheduler_data"/>

        <!-- Enter the user name for database access -->
        <entry key="databaseUser" value="qnet_admin"/>

        <!-- Enter the password for database access -->
        <entry key="databasePassword" value="7sYne7aFEsFSK7xh"/>

        <!-- You have to provide the MySQL, MS SQL Server, Sybase or DB2 JDBC driver respectively if you selected
             corresponding DBMS type. For license reasons MySQL, Sybase and MS SQL Server JDBC Drivers are
             not provided. Alternatively you can use the mariadb JDBC Driver for MySQL and
             the jTDS JDBC Driver for MS SQL Server and Sybase which is provided. -->

        <!-- You can choose between 'yes' or 'no' for using the jTDS JDBC Driver
             This entry affects only MS SQL Server or Sybase -->
        <entry key="connectorJTDS" value="yes"/>

        <!-- You can choose between 'yes' or 'no' for using the mariadb JDBC Driver
             This entry affects only MySQL -->
        <entry key="connectorMaria" value="yes"/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="jdbc">
    <userInput>
        <!-- JobScheduler Database Configuration -->

        <!-- Configuration for JDBC Driver
             This entry is only necessary if you selected a DBMS type such as MySQL,
             MS SQL Server, Sybase ot DB2 in the previous <userInput> element. -->

        <!-- You have to provide the MySQL, MS SQL Server, Sybase or DB2 JDBC driver respectively if you selected
             corresponding DBMS type. For license reasons MySQL and MS SQL Server JDBC Drivers are
             not provided. Specify the JDBC Driver source (e.g. mysql-connector-java-*.jar for MySQL,
             sqljdbc.jar for MS SQL Server, jconn3.jar for Sybase). Alternatively you can use the mariadb
             JDBC Driver for MySQL and the jTDS JDBC Driver for MS SQL Server and Sybase which is provided. -->

        <!-- Select the path to JDBC Driver -->
        <entry key="connector" value="/usr/share/java/mariadb-connector-java.jar"/>

        <!-- Only for DB2: Select the path to DB2 license file for JDBC Driver -->
        <entry key="connectorLicense" value=""/>

    </userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel id="end">
    <userInput/>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.InstallPanel id="install"/>
<com.izforge.izpack.panels.ProcessPanel id="process"/>
<com.izforge.izpack.panels.FinishPanel id="finish"/>
```
  1. setup.sh を実行します

    ./setup.sh joc_install.xml
    
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?