systemdによる管理を有効にするためのTimesTenインスタンスの変更

この例では、systemdを構成せずにmyinstance_2 TimesTenインスタンスを作成したことを前提としています。myinstance_2インスタンスをsystemd用に構成するように変更するためのプロセスを順を追って説明します。次に、systemdがTimesTenデーモンを自動的に管理するために必要なステップを実行します。

  1. -systemdオプションを指定して$TIMESTEN_HOME/bin/ttInstanceModifyユーティリティを実行します。TimesTenは、TimesTenデーモンを停止し、systemd用に構成するようにインスタンスを変更します。
    % $TIMESTEN_HOME/bin/ttInstanceModify -systemd
    Configuring TimesTen daemon with systemd.
    Stopping TimesTen daemon.....
    TimesTen Daemon (PID: 29038, port: 6640) stopped.
    The startup script is located here :
            '/scratch/ttuser2/myinstance_2/startup/myinstance_2.service'
    
    Run the 'setuproot' script :
            /scratch/ttuser2/myinstance_2/bin/setuproot -install -systemd
    This will move the TimesTen startup script into its appropriate location.
    
    Please manage the TimesTen daemon with systemd
    
  2. rootユーザーとして、$TIMESTEN_HOME/bin/setuproot -install -systemdスクリプトを実行します。
    # $TIMESTEN_HOME/bin/setuproot -install -systemd
    Would you like to install the TimesTen daemon startup scripts into /lib/systemd/system? [ yes ]
    Copying /scratch/ttuser2/myinstance_2/startup/tt_myinstance_2.service to /lib/systemd/system/tt_myinstance_2.service
    
    Successfully installed the following scripts :
    /lib/systemd/system/tt_myinstance_2.service
    Created symlink from /etc/systemd/system/multi-user.target.wants/tt_myinstance_2.service to /lib/systemd/system/tt_myinstance_2.service.
    Created symlink from /etc/systemd/system/tt_myinstance_2.service to /lib/systemd/system/tt_myinstance_2.service.
    
    Use 'systemctl [start|stop] tt_myinstance_2.service' to manage the service
    
  3. rootユーザーとして、systemdのsystemctl startコマンドを実行して、TimesTenサービス(この例ではtt_myinstance_2.service)を開始します。
     # systemctl start tt_myinstance_2.service
  4. systemdのsystemctl statusコマンドを実行して、インスタンスのTimesTenデーモンがsystemdによって自動的に管理されていることを確認します。
    % systemctl status tt_myinstance_2.service
    ● tt_myinstance_2.service - TimesTen Service
       Loaded: loaded (/lib/systemd/system/tt_myinstance_2.service; enabled; vendor preset: disabled)
       Active: active (running) since Wed 2021-08-18 05:55:00 PDT; 39s ago
      Process: 30976 ExecStart=/scratch/ttuser2/myinstance_2/bin/ttDaemonAdmin -start -force -systemd (code=exited, status=0/SUCCESS)
     Main PID: 30984 (timestend)
       Memory: 53.3M
       CGroup: /system.slice/tt_myinstance_2.service
               ├─30984 /scratch/ttuser2/myinstance_2/install/bin/timestend -init...
               ├─30988 installation_dir/tt22.1.1.29.0/bin/timestensubd -ve...
               ├─30989 installation_dir/tt22.1.1.29.0/bin/timestensubd -ve...
               └─30991 installation_dir/tt22.1.1.29.0/bin/ttcserver -verbo...
  5. TimesTenのttStatusユーティリティを実行して、インスタンスのTimesTenデーモンがsystemdによって自動的に管理されていることを確認します。
    $TIMESTEN_HOME/bin/ttStatus
    TimesTen status report as of Wed Aug 18 12:59:15 2021
    
    Daemon pid 30984 port 6640 instance myinstance_2
    TimesTen server pid 30991 started on port 6641
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    Accessible by group g900
    TimesTen daemon is managed by systemd
    End of report
    
systemdを使用するようにTimesTenインスタンスを正常に変更しました。TimesTenデーモンはsystemdによって自動的に管理されます。