Sun N1 Grid Engine 6.1 インストールガイド

第 3 章 インストールの自動化

この章では、Grid Engine ソフトウェアのソフトウェアインストール手順を自動化する方法について説明します。

自動インストールの概要

sge-root/inst_sge ユーティリティーを使用して、N1 Grid Engine のマスターホスト、実行ホスト、シャドウホスト、および Berkeley DB スプールサーバーホストのインストールとアンインストールを行えます。また、N1 Grid Engine の構成およびアカウンティングデータを自動的にバックアップすることもできます。第 2 章「N1 Grid Engine ソフトウェアの対話型インストール」で説明したコマンドの代わりに、inst_sge ユーティリティーを対話モードで使用できます。


注 –

Berkeley DB スプールサーバーホストを使用しても、高可用性は得られません。また、Berkeley DB スプールサーバーには認証メカニズムがなく、完全に信頼できるユーザーのみの閉じたネットワークだけで使用できます。


インストールおよびバックアップ手順を簡単に自動化するには、sge-root/util/install_modules ディレクトリにある構成テンプレートを使用します。

自動インストールでは、ユーザーが操作を行う必要はありません。インストール中に、端末にメッセージが表示されることはありません。インストールが終了すると、インストールのログファイルの場所を示すメッセージが表示されます。インストールのログファイル名は、install_hostname_timestamp .log の形式になります。通常、インストール中のエラーに関する情報はこのファイルにあります。重大なエラーが発生した場合、インストールスクリプトがログファイルをスプールディレクトリに移動できないことがあります。この場合、ログファイルは /tmp ディレクトリに格納されます。

特別な考慮事項

自動インストールを実行する最初の手順は、構成ファイルの設定です。構成ファイルのテンプレートは sge-rootT/util/install_modules ディレクトリにあります。自動インストールを計画するときは、次のことを考慮してください。


注 –

マスターホストで自動インストールを開始すると、クラスタ全体を 1 つのコマンドでインストールできます。自動インストールスクリプトは rsh または ssh でリモートホストにアクセスし、インストールをリモートで開始します。この手順には、各ホストから読み取り可能な、正しく構成された構成ファイルが必要です。そのファイルは、それぞれのホストにインストールするか、NFS で共有します。


inst_sge ユーティリティーと構成テンプレートの使用

システムのインストールを自動化するには、inst_sge ユーティリティーを構成ファイルと組み合わせて使用します。


注 –

Windows を実行するホストに、自動インストール手順を使用してリモートインストールを行うことはできません。Windows を実行しているホストでは、自動インストール手順を直接実行する必要があります。


Procedureマスターホストのインストールを自動化する方法

始める前に

「インストールの計画」の説明に従って、計画を完了しておく必要があります。

また、rsh または ssh コマンドをパスワードなしで使用して、各リモートホストに接続できなければいけません。ネットワーク上でこのようなアクセスが許可されていない場合、このインストール方法は使用できません。

  1. 構成テンプレート sge-root/util/install_modules/inst_template.conf のコピーを作成します。


    # cd sge-root/util/install_modules
    # cp inst_template.conf my_configuration.conf
    
  2. 「インストールの計画」で作成したワークシートの値を使用して、構成テンプレートを編集します。

    構成ファイルテンプレートには豊富なコメントが含まれており、適切な情報の場所を調べることに役に立ちます。「構成ファイルのテンプレート」を参照してください。

  3. N1 Grid Engine のマスターホストにするシステムに root でログインします。

  4. sge-root ディレクトリを作成します。

    sge-root ディレクトリは、N1 Grid Engine ソフトウェアの階層のルートディレクトリです。

  5. sge-root ディレクトリに移動し、インストールを開始します。


    # cd sge-root
    # ./inst_sge -m -auto full-path-to-configuration-file
    

    -m オプションによってマスターホストのインストールが開始され、ローカルマシンにマスターデーモンがインストールされます。また、-auto オプションにより、構成ファイルの指定どおりにリモートホストが設定されます。


    注 –

    マスターホストはリモートインストールできません。マスターホストは、必ずローカルでインストールする必要があります。


    データの損失やインストール済みクラスタの破壊を防ぐため、構成済みの SGE_CELL ディレクトリまたは構成済みの Berkeley DB スプールディレクトリがすでに存在する場合は、自動インストールが終了します。インストールが終了した場合は、その理由が画面にスクリプトで表示されます。

    sge-root/default/spool/qmaster ディレクトリにマスターインストールのログファイルが作成されます。ファイル名は install_ hostname_date_time.log の形式になります。


    ヒント –

    1 つのコマンドで複数のインストールを行う場合は、オプションを組み合わせることができます。たとえば、次のコマンドではローカルマシンにマスターデーモンがインストールされ、構成ファイルに構成されたすべての実行ホストがインストールされます。


    ./inst_sge -m -x -auto full-path-to-configuration-file
    

    インストールの完了が通知されるまで待ちます。

    自動インストールが正常に終了すると、次のようなメッセージが表示されます。


    Install log can be found in: /opt/n1ge61/spool/install_myhost_30mar2007_090152.log

    インストールのログファイルには、インストール中に生成されたすべてのスクリプトメッセージやエラーメッセージが格納されます。qmaster_spooling_dir ディレクトリが存在する場合、ログファイルはそのディレクトリにあります。ディレクトリが存在しない場合、ログファイルは /tmp ディレクトリにあります。

注意事項

実行ホストのスプールディレクトリにローカルディレクトリを指定しない場合は、 EXECD_SPOOL_DIR_LOCAL="" と設定してください。二重引用符 ("") の間には空白文字を挿入しません。

構成ファイルによるその他のインストールの自動化

マスターホストのインストール以外にも、同様の手順でさまざまな自動インストールを実行できます。inst_sge コマンドの実際の形式は少し異なり、適用される構成ファイルのセクションも異なります。この節では、いくつかの例を示します。

構成ファイルのテンプレート

構成ファイルのテンプレートは sge-root/util/install_modules ディレクトリにあります。


例 3–1 構成ファイルの例

#-------------------------------------------------
# SGE default configuration file
#-------------------------------------------------

# Use always fully qualified pathnames, please

# SGE_ROOT Path, this is basic information
#(mandatory for qmaster and execd installation)
SGE_ROOT="/opt/n1ge61"

# SGE_QMASTER_PORT is used by qmaster for communication
# Please enter the port in this way: 1300
# Please do not this: 1300/tcp
#(mandatory for qmaster installation)
SGE_QMASTER_PORT="6444"

# SGE_EXECD_PORT is used by execd for communication
# Please enter the port in this way: 1300
# Please do not this: 1300/tcp
#(mandatory for qmaster installation)
SGE_EXECD_PORT="6445"

# CELL_NAME, will be a dir in SGE_ROOT, contains the common dir
# Please enter only the name of the cell. No path, please
#(mandatory for qmaster and execd installation)
CELL_NAME="default"

# ADMIN_USER, if you want to use a different admin user than the owner,
# of SGE_ROOT, you have to enter the user name, here
# Leaving this blank, the owner of the SGE_ROOT dir will be used as 
admin user
ADMIN_USER=""

# The dir, where qmaster spools this parts, which are not spooled by DB
#(mandatory for qmaster installation)
QMASTER_SPOOL_DIR="/opt/n1ge61/default/spool/qmaster"

# The dir, where the execd spools (active jobs)
# This entry is needed, even if your are going to use
# berkeley db spooling. Only cluster configuration and jobs will
# be spooled in the database. The execution daemon still needs a spool
# directory  
#(mandatory for qmaster installation)
EXECD_SPOOL_DIR="/opt/n1ge61/default/spool"

# For monitoring and accounting of jobs, every job will get
# unique GID. So you have to enter a free GID Range, which
# is assigned to each job running on a machine.
# If you want to run 100 Jobs at the same time on one host you
# have to enter a GID-Range like that: 16000-16100
#(mandatory for qmaster installation) 
GID_RANGE="20000-20100"

# If SGE is compiled with -spool-dynamic, you have to enter here, which
# spooling method should be used. (classic or berkeleydb)
#(mandatory for qmaster installation)
SPOOLING_METHOD="berkeleydb"

# Name of the Server, where the Spooling DB is running on
# if spooling methode is berkeleydb, it must be "none", when
# using no spooling server and it must containe the servername
# if a server should be used. In case of "classic" spooling,
# can be left out
DB_SPOOLING_SERVER="none"

# The dir, where the DB spools
# If berkeley db spooling is used, it must contain the path to
# the spooling db. Please enter the full path. (eg. /tmp/data/spooldb)
# Remember, this directory must be local on the qmaster host or on the
# Berkeley DB Server host. No NSF mount, please
DB_SPOOLING_DIR="/opt/n1ge61/default/spooldb"

# A List of Host which should become admin hosts
# If you do not enter any host here, you have to add all of your hosts
# by hand, after the installation. The autoinstallation works without
# any entry
ADMIN_HOST_LIST="host1"

# A List of Host which should become submit hosts
# If you do not enter any host here, you have to add all of your hosts
# by hand, after the installation. The autoinstallation works without
# any entry
SUBMIT_HOST_LIST="host1"

# A List of Host which should become exec hosts
# If you do not enter any host here, you have to add all of your hosts
# by hand, after the installation. The autoinstallation works without
# any entry
# (mandatory for execution host installation)
EXEC_HOST_LIST="host1"

# The dir, where the execd spools (local configuration)
# If you want configure your execution daemons to spool in
# a local directory, you have to enter this directory here.
# If you do not want to configure a local execution host spool directory
# please leave this empty
EXECD_SPOOL_DIR_LOCAL=""

# If true, the domainnames will be ignored, during the hostname resolving
# if false, the fully qualified domain name will be used for name resolving
HOSTNAME_RESOLVING="true"

# Shell, which should be used for remote installation (rsh/ssh)
# This is only supported, if your hosts and rshd/sshd is configured,
# not to ask for a password, or promting any message.
SHELL_NAME="rsh"

# Enter your default domain, if you are using /etc/hosts or NIS configuration
DEFAULT_DOMAIN="none"

# If a job stops, fails, finnish, you can send a mail to this adress
ADMIN_MAIL="my.name@sun.com"

# If true, the rc scripts (sgemaster, sgeexecd, sgebdb) will be added,
# to start automatically during boottime
ADD_TO_RC="true"

#If this is "true" the file permissions of executables will be set to 755
#and of ordenary file to 644.  
SET_FILE_PERMS="true"

# This option is not implemented, yet.
# When a exechost should be uninstalled, the running jobs will be rescheduled
RESCHEDULE_JOBS="wait"

# Enter a one of the three distributed scheduler tuning configuration sets
# (1=normal, 2=high, 3=max)
SCHEDD_CONF="1"

# The name of the shadow host. This host must have read/write permission
# to the qmaster spool directory
# If you want to setup a shadow host, you must enter the servername
# (mandatory for shadowhost installation)
SHADOW_HOST="hostname"

# Remove this execution hosts in automatic mode
# (mandatory for unistallation of executions hosts)
EXEC_HOST_LIST_RM="host2 host3 host4"

# This is a Windows specific part of the auto isntallation template
# If you going to install windows executions hosts, you have to enable the
# windows support. To do this, please set the WINDOWS_SUPPORT variable
# to "true". ("false" is disabled)
# (mandatory for qmaster installation, by default WINDOWS_SUPPORT is
# disabled)
WINDOWS_SUPPORT="false"

# Enabling the WINDOWS_SUPPORT, recommends the following parameter.
# The WIN_ADMIN_NAME will be added to the list of SGE managers.
# Without adding the WIN_ADMIN_NAME the execution host installation
# won't install correctly.
# WIN_ADMIN_NAME is set to "Administrator" which is default on most
# Windows systems. In some cases the WIN_ADMIN_NAME can be prefixed with
# the windows domain name (eg. DOMAIN+Administrator)
# (mandatory for qmaster installation)
WIN_ADMIN_NAME="Administrator"

# This parameter set the number of parallel installation processes.
# The prevent a system overload, or exeeding the number of open file
# descriptors the user can limit the number of parallel install processes.
# eg. set PAR_EXECD_INST_COUNT="20", maximum 20 parallel execd are installed.
PAR_EXECD_INST_COUNT="20"

セキュリティー強化 (CSP) による自動インストール

自動インストールでは、第 4 章「拡張セキュリティー機能のインストール」に説明のある Certificate Security Protocol (CSP) モードもサポートされています。CSP セキュリティーモードを使用するには、テンプレートファイルの CSP パラメータを指定する必要があります。パラメータは次のようになります。


# This section is used for csp installation mode.
# CSP_RECREATE recreates the certs on each installation, if true.
# In case of false, the certs will be created, if not existing.
# Existing certs won't be overwritten. (mandatory for csp install)
CSP_RECREATE="true"

# The created certs won't be copied, if this option is set to false
# If true, the script tries to copy the generated certs. This
# requires passwordless ssh/rsh access for user root to the
# execution hosts
CSP_COPY_CERTS="false"

# csp information, your country code (only 2 characters)
# (mandatory for csp install)
CSP_COUNTRY_CODE="DE"

# your state (mandatory for csp install)
CSP_STATE="Germany"

# your location, eg. the building (mandatory for csp install)
CSP_LOCATION="Building"

# your organisation (mandatory for csp install)
CSP_ORGA="Organisation"

# your organisation unit (mandatory for csp install)
CSP_ORGA_UNIT="Organisation_unit"

# your email (mandatory for csp install)
CSP_MAIL_ADDRESS="name@yourdomain.com"

インストールを開始するには、次のコマンドを入力します。


inst_sge -m -csp -auto template-file-name

注 –

証明書はインストール時に作成されます。この証明書を、インストールされたクラスタの各ホストにコピーしてください。コピーはインストール手順中に行われますが、インストール手順で証明書をコピーするためのアクセス権が得られるよう、次の手順を実行する必要があります。

  1. 各ホストで rsh/rcp または ssh/scp を使用します。

  2. root ユーザーがパスワードなしで、各ホストに ssh または rsh でアクセスできるようにします。


自動アンインストール

ホストを自動的にアンインストールすることもできます。


注 –

マスターホストをアンインストールする前に、すべてのコンピューティングホストをアンインストールしてください。マスターホストを先にアンインストールした場合は、すべての実行ホストを手動でアンインストールする必要があります。


正しい環境で作業を行うため、次の手順に進む前に必ず $SGE_ROOT/$SGE_CELL/common/settings.csh ファイルを読み込んでください。

実行ホストのアンインストール

実行ホストのアンインストール時に、対象ホストのすべての構成情報が削除されます。アンインストール手順では、実行ホストの正常な停止が行われます。最初に、アンインストール対象ホストのキューインスタンスが無効にされ、新しいジョブが開始されなくなります。次に、実行中の各ジョブに対して次の操作が順に行われます。ジョブのチェックポイント作成、ジョブの再スケジューリング、ジョブの再スケジューリングの強制実行。これでキューインスタンスが空になるので、実行デーモンがシャットダウンされ、構成、グローバルスプールディレクトリ、またはローカルスプールディレクトリが削除されます。

構成ファイルテンプレートには、自動的にアンインストール可能なホストを識別するためのセクションがあります。次のセクションを確認してください。


# Remove this execution hosts in automatic mode 
EXEC_HOST_LIST_RM="host1 host2 host3 host4"

EXEC_HOST_LIST_RM リストにある各ホストが、クラスタから自動的に削除されます。

実行ホストの自動アンインストールを開始するには、次のコマンドを入力します。


% ./inst_sge -ux -auto full-path-to-configuration-file

マスターホストのアンインストール

マスターホストのアンインストールでは、すべての N1 Grid Engine 構成ファイルが削除されます。アンインストール手順の完了後に残るのは、バイナリファイルだけです。アンインストール後も構成情報が必要な場合は、マスターホストのバックアップを行ってください。マスターホストのアンインストールでは、対話型モードと自動モードの両方がサポートされています。

マスターホストの自動アンインストールを開始するには、次のコマンドを入力します。


% ./inst_sge -um -auto full-path-to-configuration-file

このコマンドでは対話型モードと同じ手順が実行されますが、すべての手順でユーザーに確認メッセージが表示されず、端末出力はまったく行われません。一度アンインストール手順を開始すると、停止できません。

シャドウホストのアンインストール

シャドウホストの自動アンインストールを開始するには、次のコマンドを入力します。


% ./inst_sge -usm -auto full-path-to-configuration-file

シャドウホストのアンインストール

シャドウホストの自動アンインストールを開始するには、次のコマンドを入力します。


% ./inst_sge -usm -auto full-path-to-configuration-file

自動バックアップ

自動バックアップ手順では、対話型バックアップ手順とほぼ同様に構成データとアカウンティングデータがバックアップされます。無人バックアップまたは定期的なバックアップをスケジュールする場合は、自動バックアップ手順を cron ジョブとして実行できます。自動バックアップには構成ファイルが必要で、そのテンプレートは sge_root/ util/install_modules/backup_template.conf ファイルにあります。

構成ファイルテンプレート内には、実際の環境でどの値を使用すべきかを示したコメントがあります。

自動バックアップの開始

構成ファイルの設定後、次のコマンドを入力すると自動バックアップが開始されます。


% ./inst_sge -bup -auto full-path-to-configuration-file

既存のバックアップファイルを上書きしないよう、構成ファイルで指定されたバックアップディレクトリ名に、日付と時刻の組み合わせが追加されます。


例 3–2 バックアップ構成ファイル


#--------------------------------------------------- 
# Autobackup Configuration File Template 
#--------------------------------------------------- 
# Please, enter your SGE_ROOT here (mandatory) 
SGE_ROOT="/opt/gridengine" 
# Please, enter your SGE_CELL here (mandatory) 
SGE_CELL="default" 
# Please, enter your Backup Directory here 
# After backup you will find your backup files here (mandatory) 
# The autobackup will add a time /date combination to this dirname 
# to prevent an overwriting! 
BACKUP_DIR="/opt/backups/ge_backup" 
# Please, enter true to get a tar/gz package 
# and false to copy the files only (mandatory) 
TAR="true" 
# Please, enter the backup file name here. (mandatory) 
BACKUP_FILE="backup.tar"

自動インストールおよびアンインストールのトラブルシューティング

自動インストールで、次のエラーが発生することがあります。

問題点: sge_cell ディレクトリが存在していると、以前のインストールを上書きしないようインストールが終了される。

解決策:そのディレクトリを削除するか、名前を変更してください。

問題点: Berkeley データベースのスプーリングディレクトリが存在していると、以前のインストールを上書きしないようインストールが終了される。

解決策:インストールするには、そのディレクトリを削除するか、名前を変更する必要があります。ADMINUSER には、Berkeley データベースのスプーリングディレクトリのある場所への書き込み権が必要です。ADMINUSER が Berkeley データベースのスプーリングディレクトリの所有者になります。

問題点: 実行ホストのインストールに成功したように見えても、実行デーモンが起動しないか、読み込み値が表示されない。

解決策:ユーザー root が、パスワードなしでのほかのホストへの rsh または ssh 接続が許可されていることを確認してください。

ユーザー root がパスワードの確認なしでほかのホストに rsh または ssh 接続することがネットワークで許可されていない場合は、自動インストールをリモート実行できません。その場合は、ホストにログインし、次のコマンドを使用して自動インストールを各ホストでローカル起動してください。


% ./inst_sge -x -noremote -auto /tmp/install_config_file.conf