March 2024  |  01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

PBSPro 状態監視用コマンドの出力フォーマット

JUGEMテーマ:コンピュータ

 

PBSProで便利なったことのひとつに、状態監視用コマンド(qstat, pbsnodes)の出力フォーマット指定があるのでここにメモしておく。

 

http://community.pbspro.org/t/in-the-development-of-the-cluster-management-system-we-use-pbspro-as-a-tool-for-job-management-how-to-get-the-job-information-in-real-time-through-the-database-or-command-line-query/1219

 

コマンドオプションとして "-F json" を追加するだけ。

 

使用例:

qstat -f -F json
pbsnodes -av -F json

PBSPro バージョン19 ではジョブ名に注意

JUGEMテーマ:コンピュータ

 

PBSProでジョブを依頼するときは、スクリプトファイルを作って、qsub コマンドに指定して実行してたのが、バージョン19にしてからエラーが出るようになってしまった。

 

$ qsub username%313.sh

qsub: illegal -N value

usage: qsub [-a date_time] [-A account_string] [-c interval]

    [-C directive_prefix] [-e path] [-f ] [-h ] [-I [-X]] [-j oe|eo] [-J X-Y[:Z]]

    [-k keep] [-l resource_list] [-m mail_options] [-M user_list]

    [-N jobname] [-o path] [-p priority] [-P project] [-q queue] [-r y|n]

    [-R o|e|oe] [-S path] [-u user_list] [-W otherattributes=value...]

    [-S path] [-u user_list] [-W otherattributes=value...]

    [-v variable_list] [-V ] [-z] [script | -- command [arg1 ...]]

        qsub --version

 

この、エラーメッセージの '-N value' ってなにかと、`man qsub` で調べてみると、説明は次のとおり。

 

       -N name Sets job's name to name.  Sets job's Job_Name attribute to name. 

               Format: string, up to 236 characters in length.
               It must consist of an alphabetic or numeric character followed by printable, non-white-space characters.
               Default:  if a script is used to submit the job, the job's name is the name of the script. 
               If no script is used, the job's name is "STDIN".

 

ジョブ名を指定しなければ、デフォルトでスクリプトファイル名になるようだが、236文字まで可能な文字列長さの制限にはかかりようもない。また、条件となる文字コード(alphabetic or numeric character followed by printable, non-white-space characters)にも、ひかかからないはずだが、しかし、なぜかと思いつつ疑わしい特殊文字の '%' を '_' にしてみたところ実行できるようになった。

 

このコマンドラインは、次のとおり。

 

$ qsub -N username_313 username%313.sh

 

 

PBSPro バージョン 18 から 19 への更新 (CentOS7)

JUGEMテーマ:コンピュータ

 

PBSPro 18.1.3 から 19.1.2 への更新に失敗し、調べていたら postgresql-contrib パッケージが必要という投稿を見つけた。

また、 PBSPro 18.1.4 もリリースされていたので、一旦 18.1.4 にしてから 19.1.2 に更新してみることにした。

 

PBSPro 18.1.4 の CentOS7用のRPMパッケージアーカイブ名がタイポで pbspro_1.8.4.centos7.zip になっていることに注意。

(rpm パッケージ名は間違いなく pbspro-server-18.1.4-0.x86_64.rpm)

 

# wget https://github.com/PBSPro/pbspro/releases/download/v18.1.4/pbspro_1.8.4.centos7.zip

# unzip pbspro_1.8.4.centos7.zip

# cd pbspro_1.8.4.centos7

# rpm -Uvh pbspro-server-18.1.4-0.x86_64.rpm

 

これで問題なく更新できた。

 

# systemctl restart pbs

 

で、PBSデータベースを更新し、pbs_server は起動した。

 

次に、PBSPro 18.1.4 から19.1.2 への更新を行う。

念のため、 PBSPro 19.1.2 のインストールの前に postgresql-contrib をインストールしておく。

 

# yum install postgresql-contrib

...

# rpm -Uvh pbspro-server-19.1.2-0.x86_64.rpm

...

# systemctl restart pbs

...

 

無事、datastore のpbsデータベースが更新され、サービスが起動された。

pbs サービスの状態を確認すると、以下のとおり。

 

# LANG=C systemctl status pbs
* pbs.service - Portable Batch System
   Loaded: loaded (/opt/pbs/libexec/pbs_init.d; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2019-09-10 23:51:52 JST; 1h 15min ago
     Docs: man:pbs(8)
  Process: 1094 ExecStart=/opt/pbs/libexec/pbs_init.d start (code=exited, status=0/SUCCESS)
    Tasks: 12
   Memory: 22.5M
   CGroup: /system.slice/pbs.service
           |-1215 /opt/pbs/sbin/pbs_comm
           |-1245 /opt/pbs/sbin/pbs_mom
           |-1257 /opt/pbs/sbin/pbs_sched
           |-1461 /opt/pbs/sbin/pbs_ds_monitor monitor
           |-1492 /usr/bin/postgres -D /var/spool/pbs/datastore -p 15007
           |-1500 postgres: logger process   
           |-1502 postgres: checkpointer process   
           |-1503 postgres: writer process   
           |-1504 postgres: wal writer process   
           |-1505 postgres: autovacuum launcher process   
           |-1506 postgres: stats collector process   
           |-1516 postgres: postgres pbs_datastore 192.168.1.172(38764) idle
           `-1517 /opt/pbs/sbin/pbs_server.bin

Sep 10 23:51:47 edison7.localdomain pbs_init.d[1094]: PBS sched
Sep 10 23:51:47 edison7.localdomain su[1299]: (to postgres) root on none
Sep 10 23:51:47 edison7.localdomain su[1331]: (to postgres) root on none
Sep 10 23:51:47 edison7.localdomain su[1391]: (to postgres) root on none
Sep 10 23:51:47 edison7.localdomain su[1423]: (to postgres) root on none
Sep 10 23:51:47 edison7.localdomain su[1462]: (to postgres) root on none
Sep 10 23:51:51 edison7.localdomain pbs_init.d[1094]: Connecting to PBS datas...
Sep 10 23:51:51 edison7.localdomain pbs_init.d[1094]: Licenses valid for 1000...
Sep 10 23:51:51 edison7.localdomain pbs_init.d[1094]: PBS server
Sep 10 23:51:52 edison7.localdomain systemd[1]: Started Portable Batch System.
Hint: Some lines were ellipsized, use -l to show in full.

 

PBSPro 18.1.3から19.1.2 に更新でエラー

JUGEMテーマ:コンピュータ

 

CentOS7 に PBSPro 18 は rpm から簡単にインストールできるようになった。

PBSProの新しいバージョン 19がリリースされているので、久々に PBSProのバージョンアップをすることにした。

PBSPro 18は更新も問題なくでき、手元の実験用サーバは、PBSPro 18.1.3 になっていた。

Githubのリリースを見ると( https://github.com/PBSPro/pbspro/releases )、PBSPro 19.1.2 がリリースされていたので、そのCentOS7用のRPMアーカイブをダウンロードし、pbspro-server をインストールしてみた。

 

# wget https://github.com/PBSPro/pbspro/releases/download/v19.1.2/pbspro_19.1.2.centos_7.zip

# unzip pbspro_19.1.2.centos_7.zip

# cd pbspro_19.1.2.centos_7

 

# rpm -Uvh pbspro-server-19.1.2-0.x86_64.rpm
Preparing...                          [  176.663318] random: crng init done0%)
################################# [100%]
Updating / installing...
   1:pbspro-server-19.1.2-0

...


*** PBS Installation Summary
***
*** Postinstall script called as follows:
*** /opt/pbs/libexec/pbs_postinstall server 19.1.2 /opt/pbs /var/spool/pbs postgres
***
*** Existing configuration file found: /etc/pbs.conf

 

ところが、pbs サービスをリスタートしてみると、dataservice (PBSのデータベース)の更新を行おうとして、失敗したようで、pbs_server は走らなくなってしまった。


# /etc/init.d/pbs restart
Restarting PBS
Stopping PBS
Shutting server down with qterm.
PBS server - was pid: 1514
PBS mom - was pid: 1230
PBS sched - was pid: 1251
PBS comm - was pid: 1191
Waiting for shutdown to complete
Starting PBS
PBS Home directory /var/spool/pbs needs updating.
Running /opt/pbs/libexec/pbs_habitat to update it.
***
NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index "jobid_pk" for table "job"
ERROR:  could not open extension control file "/usr/share/pgsql/extension/hstore.control": No such file or directory
ERROR:  type "public.hstore" does not exist
LINE 1: ALTER TABLE pbs.job ADD attributes public.hstore DEFAULT '':...
                                           ^
ERROR:  function hstore(text[], text[]) does not exist
LINE 2: SELECT hstore(array_agg(attr.key ), array_agg(attr.value))
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
ERROR:  column "attributes" does not exist
LINE 1: UPDATE pbs.job SET attributes='' WHERE attributes IS NULL;
                                               ^
ERROR:  column "attributes" of relation "job" does not exist
ERROR:  type "public.hstore" does not exist
LINE 1: ALTER TABLE pbs.node ADD attributes public.hstore DEFAULT ''...
                                            ^
ERROR:  function hstore(text[], text[]) does not exist
LINE 2: SELECT hstore(array_agg(attr.key ), array_agg(attr.value))
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
ERROR:  column "attributes" does not exist
LINE 1: UPDATE pbs.node SET attributes='' WHERE attributes IS NULL;
                                                ^
ERROR:  column "attributes" of relation "node" does not exist
ERROR:  type "public.hstore" does not exist
LINE 1: ALTER TABLE pbs.queue ADD attributes public.hstore DEFAULT '...
                                             ^
ERROR:  function hstore(text[], text[]) does not exist
LINE 2: SELECT hstore(array_agg(attr.key ), array_agg(attr.value))
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
ERROR:  column "attributes" does not exist
LINE 1: UPDATE pbs.queue SET attributes='' WHERE attributes IS NULL;
                                                 ^
ERROR:  column "attributes" of relation "queue" does not exist
ERROR:  type "public.hstore" does not exist
LINE 1: ALTER TABLE pbs.resv ADD attributes public.hstore DEFAULT ''...
                                            ^
ERROR:  function hstore(text[], text[]) does not exist
LINE 2: SELECT hstore(array_agg(attr.key ), array_agg(attr.value))
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
ERROR:  column "attributes" does not exist
LINE 1: UPDATE pbs.resv SET attributes='' WHERE attributes IS NULL;
                                                ^
ERROR:  column "attributes" of relation "resv" does not exist
ERROR:  type "public.hstore" does not exist
LINE 1: ALTER TABLE pbs.scheduler ADD attributes public.hstore DEFAU...
                                                 ^
ERROR:  function hstore(text[], text[]) does not exist
LINE 2: SELECT hstore(array_agg(attr.key ), array_agg(attr.value))
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
ERROR:  column "attributes" does not exist
LINE 1: UPDATE pbs.scheduler SET attributes='' WHERE attributes IS N...
                                                     ^
ERROR:  column "attributes" of relation "scheduler" does not exist
ERROR:  type "public.hstore" does not exist
LINE 1: ALTER TABLE pbs.server ADD attributes public.hstore DEFAULT ...
                                              ^
ERROR:  function hstore(text[], text[]) does not exist
LINE 2: SELECT hstore(array_agg(attr.key ), array_agg(attr.value))
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
ERROR:  column "attributes" does not exist
LINE 1: UPDATE pbs.server SET attributes='' WHERE attributes IS NULL...
                                                  ^
ERROR:  column "attributes" of relation "server" does not exist
Connecting to PBS dataservice...connected to PBS dataservice@edison7
Server@edison7: Server@edison7, Failed to initialize PBS dataservice:[Prepare of statement insert_job failed: ERROR:  column "attributes" of relation "job" does not exist
LINE 1: ...ji_4ash,ji_credtype,ji_qrank,ji_savetm,ji_creattm,attributes...
                                                             ^]
Connection refused
qmgr: cannot connect to server
Connection refused
qterm: could not connect to server  (111)
*** End of /opt/pbs/libexec/pbs_habitat
Home directory /var/spool/pbs updated.
PBS comm
/opt/pbs/sbin/pbs_comm ready (pid=4015), Proxy Name:edison7:17001, Threads:4
PBS mom
Creating usage database for fairshare.
PBS sched
Connecting to PBS dataservice...connected to PBS dataservice@edison7
Server@edison7: Server@edison7, Failed to initialize PBS dataservice:[Prepare of statement insert_job failed: ERROR:  column "attributes" of relation "job" does not exist
LINE 1: ...ji_4ash,ji_credtype,ji_qrank,ji_savetm,ji_creattm,attributes...
                                                             ^]
pbs_server startup failed, exit 255 aborting.
#

 

一旦インストールした PBSを削除して、最初からやり直し。今度は yum コマンドを使ってやってみた。

 

# rpm -e pbspro-server

...

# yum install pbspro-server-19.1.2-0.x86_64.rpm

...

 

相変わらずエラー、PBSProのインスタンス /var/spool/pbs/ ディレクトリを削除してやり直してもエラーとなり、諦めモードに。

 

 

PBSPro for CentOS7.4

久しぶりにPBSProのダウンロードサイトを覗いてみると、PBSProのCentOS7用のパッケージが更新されていた。
当初のパッケージでは、libical.so.0 の依存関係が解決できず、CentOS 7.3以降では使えなくなっていたため、RPMSを展開して、rpmbuild で再構築する必要があった。これをするなら、githubのリポジトリからソースを持ってきて構築しても手間はかわらない。
その後、OpenSUSEのダウンロードサイトのCentOS7用リポジトリを設定し yum でインストールすることで解決していた。できれば、yum リポジトリのほうを更新して欲しいところだ。
さておき、新しいRPMパッケージのインストールだけでも確認しておくことにした。

JUGEMテーマ:コンピュータ

これまでの流れ:
» read more
12>|next>>
pagetop