pbsproはpostgreSQLを使用する
そのテーブル構成を見てみた
まずPBSPro向けに作ったpostgresの概要を確認. psコマンドで探してみると
postgres 3877 1 0 2018 ? 00:08:51 /usr/bin/postgres -D /var/lib/pbs/datastore -p 15007なプロセスを発見。どうやらport番号 15007 でpostgresは動いているみたい。
っで、psqlでアクセス
[root@ad ~]# psql -U postgres -p 15007
ユーザ postgres のパスワード:
psql (9.2.23)
"help" でヘルプを表示します.
postgres=#「\l」でデータベースを一覧すると
postgres=# \l
データベース一覧
名前 | 所有者 | エンコーディング | 照合順序 | Ctype(変換演算子) | アクセス権
---------------+----------+------------------+-------------+-------------------+-----------------------
pbs_datastore | postgres | SQL_ASCII | ja_JP.UTF-8 | ja_JP.UTF-8 |
postgres | postgres | SQL_ASCII | ja_JP.UTF-8 | ja_JP.UTF-8 |
template0 | postgres | SQL_ASCII | ja_JP.UTF-8 | ja_JP.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | SQL_ASCII | ja_JP.UTF-8 | ja_JP.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 行)
postgres=#とあり、「pbs_datastore」がPBSProのデータベースのようである。
現在いるデータベースは「select current_database();」で表示可能で、
postgres=# select current_database();
current_database
------------------
postgres
(1 行)
postgres=#ここから「pbs_datastore」に移るには、「\c pbs_datastore」と実行する
postgres=# \c pbs_datastore
データベース "pbs_datastore" にユーザ"postgres"として接続しました。
pbs_datastore=#っで、テーブルを「\d」コマンドで一覧してみる
pbs_datastore=# \d
リレーションがありません。
pbs_datastore=#と残念な結果.
どうやらスキーマが異なるようで、スキーマ一覧を「\dn」コマンドで表示すると
pbs_datastore=# \dn
スキーマ一覧
名前 | 所有者
--------+----------
pbs | postgres
public | postgres
(2 行)
pbs_datastore=#と2つあるみたい。今デフォルトとしてるスキーマは、「select current_schema();」で得られる
pbs_datastore=# select current_schema();
current_schema
----------------
public
(1 行)
pbs_datastore=#なるのど、publicなスキーマには何もないようである
なので、もう一つのスキーマに「SET search_path = pbs;」で乗り移ってみてみる。
pbs_datastore=# SET search_path = pbs;
SET
pbs_datastore=# select current_schema();
current_schema
----------------
pbs
(1 行)
pbs_datastore=# \d
リレーションの一覧
スキーマ | 名前 | 型 | 所有者
----------+----------------+------------+----------
pbs | info | テーブル | postgres
pbs | job | テーブル | postgres
pbs | job_attr | テーブル | postgres
pbs | job_scr | テーブル | postgres
pbs | mominfo_time | テーブル | postgres
pbs | node | テーブル | postgres
pbs | node_attr | テーブル | postgres
pbs | queue | テーブル | postgres
pbs | queue_attr | テーブル | postgres
pbs | resv | テーブル | postgres
pbs | resv_attr | テーブル | postgres
pbs | scheduler | テーブル | postgres
pbs | scheduler_attr | テーブル | postgres
pbs | server | テーブル | postgres
pbs | server_attr | テーブル | postgres
pbs | subjob_track | テーブル | postgres
pbs | svr_id_seq | シーケンス | postgres
(17 行)
pbs_datastore=#どうやら「pbs」スキーマにPBSPro関係のテーブルが収められている。
っが、別に「SET search_path = pbs;」で移らずとも、「pbs.*」で事足りる.
ここでは「pbs」スキーマに乗り換えずに、そのままでテーブル確認をしています。
pbs_datastore=# \dt pbs.*
リレーションの一覧
スキーマ | 名前 | 型 | 所有者
----------+----------------+----------+----------
pbs | info | テーブル | postgres
pbs | job | テーブル | postgres
pbs | job_attr | テーブル | postgres
pbs | job_scr | テーブル | postgres
pbs | mominfo_time | テーブル | postgres
pbs | node | テーブル | postgres
pbs | node_attr | テーブル | postgres
pbs | queue | テーブル | postgres
pbs | queue_attr | テーブル | postgres
pbs | resv | テーブル | postgres
pbs | resv_attr | テーブル | postgres
pbs | scheduler | テーブル | postgres
pbs | scheduler_attr | テーブル | postgres
pbs | server | テーブル | postgres
pbs | server_attr | テーブル | postgres
pbs | subjob_track | テーブル | postgres
(16 行)
pbs_datastore=#pbs_datastore=# select * from pbs.info;
pbs_schema_version
--------------------
1.2.0
(1 行)
pbs_datastore=#pbs.jobテーブルに収まる。終了すると消える
*多分そう思える項目のみ記載
pbs_datastore=# \d pbs.job
テーブル "pbs.job"
列 | 型 | 修飾語
-------------+-----------------------------+----------
ji_jobid | text | not null jobID、「c.119」とか
ji_sv_name | text | not null
ji_state | integer | not null [4]は実行中,[9]は終了,[1]は未実行かな?
ji_substate | integer | not null [42]は計算中,[92]は無事完了?,[91]はqdelで終了
ji_svrflags | integer | not null
:
ji_stime | bigint | 計算開始のepoch時間
:
ji_queue | text | not null 使用したqueue名
ji_destin | text | queueに対して割り当てられたマシン名
:
ji_savetm | timestamp without time zone | not null logファイルの最新更新時間?
ji_creattm | timestamp without time zone | not null ジョブ作成時間
インデックス:
"ji_jobid_idx" btree (ji_jobid)
"job_rank_idx" btree (ji_qrank)
pbs_datastore=#発行したジョブの詳細リクエスト情報
outputに書かれるようなデータっぽい
pbs_datastore=# \d pbs.job_attr;
テーブル "pbs.job_attr"
列 | 型 | 修飾語
---------------+---------+----------
ji_jobid | text | not null jobID、「c.119」とか
attr_name | text | not null Error_Path,mtime,Job_Name,Job_Owner,queue,server, どか
attr_resource | text | attr_name:Resource_Listの時のncpus,nodect,nodes,place,select
attr_name:resources_usedの時のcpupercent,cput,mem,ncpus,vmem,walltime
attr_value | text | attr_name/attr_resourceの値
attr_flags | integer | not null
インデックス:
"job_attr_idx" btree (ji_jobid, attr_name, attr_resource)
pbs_datastore=#流しているジョブの中身(script)
pbs_datastore=# \d pbs.job_scr
テーブル "pbs.job_scr"
列 | 型 | 修飾語
----------+------+----------
ji_jobid | text | not null
script | text |
インデックス:
"job_src_idx" btree (ji_jobid)
pbs_datastore=#pbs_datastore=# \d pbs.node
テーブル "pbs.node"
列 | 型 | 修飾語
-------------+-----------------------------+----------
nd_name | text | not null ノード名
mom_modtime | bigint |
nd_hostname | text | not null ノードのホスト名
nd_state | integer | not null 状態: [0]がjob-busy?
nd_ntype | integer | not null
nd_pque | text | 属しているqueue名
nd_index | integer | not null
nd_savetm | timestamp without time zone | not null logの最終更新日
nd_creattm | timestamp without time zone | not null ノードの追加日
インデックス:
"pbsnode_pk" PRIMARY KEY, btree (nd_name)
"nd_idx_cr" btree (nd_creattm)
参照元:
TABLE "pbs.node_attr" CONSTRAINT "node_attr_fk" FOREIGN KEY (nd_name) REFERENCES pbs.node(nd_name) ON DELETE CASCADE
pbs_datastore=#計算ノードの詳細
pbs_datastore=# \d pbs.node_attr
テーブル "pbs.node_attr"
列 | 型 | 修飾語
---------------+---------+----------
nd_name | text | not null ノード名
attr_name | text | not null [Mom],[Port],[pbs_version],[resource_available],[queue],[pcpus]とか
attr_resource | text | resource_availableで[ngpus]
attr_value | text | 値 [pbs_version]には14.1.2とか
attr_flags | integer | not null 4
インデックス:
"node_attr_idx" btree (nd_name, attr_name)
外部キー制約:
"node_attr_fk" FOREIGN KEY (nd_name) REFERENCES pbs.node(nd_name) ON DELETE CASCADE
pbs_datastore=#pbs_datastore-# \d pbs.queue
テーブル "pbs.queue"
列 | 型 | 修飾語
------------+-----------------------------+----------
qu_name | text | not null
qu_sv_name | text | not null
qu_type | integer | not null
qu_ctime | timestamp without time zone | not null
qu_mtime | timestamp without time zone | not null
インデックス:
"queue_pk" PRIMARY KEY, btree (qu_name)
"que_idx_cr" btree (qu_ctime)
外部キー制約:
"que_svr_fk" FOREIGN KEY (qu_sv_name) REFERENCES pbs.server(sv_name)
参照元:
TABLE "pbs.queue_attr" CONSTRAINT "queue_attr_fk" FOREIGN KEY (qu_name) REFERENCES pbs.queue(qu_name) ON DELETE CASCADE
pbs_datastore-#queueの詳細情報
pbs_datastore=# \d pbs.queue_attr;
テーブル "pbs.queue_attr"
列 | 型 | 修飾語
---------------+---------+----------
qu_name | text | not null
attr_name | text | not null
attr_resource | text |
attr_value | text |
attr_flags | integer | not null
インデックス:
"queue_attr_idx" btree (qu_name, attr_name)
外部キー制約:
"queue_attr_fk" FOREIGN KEY (qu_name) REFERENCES pbs.queue(qu_name) ON DELETE CASCADE
pbs_datastore=#[resv]は何を意味しているか分からん...
[pbs.scheduler]はジョブスケジューラーのジョブ投入優先順位に絡むかと思うが、
なにも手入れをしてなければ、ほとんと情報はない。基本の「Last In, First Out」で進めているので.
[pbs.server]には現在までの発行ID数とかが見れる
[pbs.server_attr]には各種パラメーターが入っている。