LoginSignup
1
0

More than 1 year has passed since last update.

Wazi: OpenShift上でのメインフレーム開発環境構築 - (3)イメージ・ストレージ・サーバーの構成

Last updated at Posted at 2021-04-17

はじめに

Wazi環境構築のログです。今回はイメージ・ストレージ・サーバーの構成について。

関連記事

Wazi: OpenShift上でのメインフレーム開発環境構築 - (1)事前準備
Wazi: OpenShift上でのメインフレーム開発環境構築 - (2)ライセンス・サーバーの構成
Wazi: OpenShift上でのメインフレーム開発環境構築 - (3)イメージ・ストレージ・サーバーの構成
Wazi: OpenShift上でのメインフレーム開発環境構築 - (4)OpenShiftクラスターの構成
Wazi: OpenShift上でのメインフレーム開発環境構築 - (5)Sandboxインスタンスの作成
Wazi: OpenShift上でのメインフレーム開発環境構築 - (6)Sandboxインスタンスの確認
Wazi: OpenShift上でのメインフレーム開発環境構築 - (7)Sandboxインスタンスへの接続
Wazi: OpenShift上でのメインフレーム開発環境構築 - (8)Sandboxのカスタマイズ
Wazi: OpenShift上でのメインフレーム開発環境構築 - (9)Wazi Developer for Workspacesの作成

全体像

image.png
今回は図の矢印部分のイメージ・ストレージ・サーバーの構成です。
イメージ・ストレージ・サーバーはOpenShift上にも構成することが可能ですが、ここでは仮想サーバー上に構成することにします(ライセンス・サーバーと相乗り)。

イメージ・ストレージ・サーバーのセットアップ

参考: Installing an SFTP server
イメージ・ストレージ・サーバーの実体はsftpサーバーです。Sandboxのインスタンスを作成する際に、元となるz/OS DASDイメージファイルをsftpサーバーからコピーすることになるので、そのための準備をしておきます。

sftpサーバー(sshd)

sftpはsshを利用したファイル転送プロトコルなので、OSパッケージとしてはsshサーバーがあればOKです。

[TOMOTAG@iseip20201222-1106-alphabet-1 ~]$ sudo yum list installed | grep openssh-server
openssh-server.x86_64               7.4p1-21.el7             installed
[TOMOTAG@iseip20201222-1106-alphabet-1 ~]$ systemctl status sshd
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-12-28 02:48:17 CST; 20h ago
     Docs: man:sshd(8)
           man:sshd_config(5)
 Main PID: 956 (sshd)
   CGroup: /system.slice/sshd.service
           mq956 /usr/sbin/sshd -D

Dec 28 02:48:17 iseip20201222-1106-alphabet-1.jp-ise.com systemd[1]: Starting OpenSSH server daemon...
Dec 28 02:48:17 iseip20201222-1106-alphabet-1.jp-ise.com sshd[956]: Server listening on 0.0.0.0 port 22.
Dec 28 02:48:17 iseip20201222-1106-alphabet-1.jp-ise.com sshd[956]: Server listening on :: port 22.
Dec 28 02:48:17 iseip20201222-1106-alphabet-1.jp-ise.com systemd[1]: Started OpenSSH server daemon.
...

sftp用構成

sftpで使用するディレクトリとして/mnt/sftpを作成します。

[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt]$ sudo mkdir sftp

[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt]$ ls -la
total 32
drwxr-xr-x.  5 root root  4096 Dec 28 23:35 .
drwxr-xr-x+ 19 root root  4096 Dec 28 19:53 ..
drwxrwxrwx.  4 root root  4096 Dec 28 18:58 Inst_Image
drwx------.  2 root root 16384 Dec 28 18:24 lost+found
drwxr-xr-x.  2 root root  4096 Dec 28 23:35 sftp

sftp用のユーザー"ftpuser1"とグループ"ftpusers"を作成し、パスワードを設定しておきます。

[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp]$ sudo groupadd ftpusers
[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp]$ sudo  useradd -g ftpusers -d /ftpuser1 -s /sbin/nologin ftpuser1

[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp]$ sudo id ftpuser1
uid=1010(ftpuser1) gid=1011(ftpusers) groups=1011(ftpusers)

[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp]$ sudo passwd ftpuser1
Changing password for user ftpuser1.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

sftpのルートディレクトリとして/mnt/sftp/ftpuser1を作成します。

[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp]$ sudo mkdir ftpuser1
[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp]$ sudo chown ftpuser1:ftpusers ftpuser1
[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp]$ ls -la
total 12
drwxr-xr-x. 3 root     root     4096 Dec 28 23:41 .
drwxr-xr-x. 5 root     root     4096 Dec 28 23:35 ..
drwxr-xr-x. 2 ftpuser1 ftpusers 4096 Dec 28 23:41 ftpuser1

SSHの構成ファイル"sshd_config"を編集して、このftpuser1についての設定を行います。

/etc/ssh/sshd_config
...
Match User ftpuser1
        PasswordAuthentication yes
        ForceCommand internal-sftp
        ChrootDirectory /mnt/sftp
        PermitTunnel no
        AllowAgentForwarding no
        AllowTcpForwarding no
        X11Forwarding no

※Sandbox作成時はOpenShiftのOperatorを使用することになりますが、この時sftpへのアクセスはユーザーID/パスワードでの認証に限られるようです(公開鍵による認証は不可)。今回の仮想サーバーの環境はsshはPasswordAuthentidation noに設定してパスワード認証を無効化していましたが、このftp用のに関してはPasswordAuthentication yesに設定しています。合わせてこのユーザーはsftp専用とするために、ForceCommand internal-sftpなどを設定しています。

sshd再起動

[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp]$ sudo systemctl restart sshd

Windows PCからSSL/VPN経由でsftpできることを確認。

c:\y\temp>sftp ftpuser1@xxxxx
The authenticity of host 'xxxxx (xxxxx)' can't be established.
ECDSA key fingerprint is SHA256:WLiyVkG/vtxAF5/5O7WAv2uh5V+TkeH2RGoqfH6UDWY.
Are you sure you want to continue connecting (yes/no)?
Warning: Permanently added 'xxxxx' (ECDSA) to the list of known hosts.
ftpuser1@xxxxx's password:
Connected to ftpuser1@xxxxx.
sftp> pwd
Remote working directory: /ftpuser1
sftp> put test.txt
Uploading test.txt to /ftpuser1/test.txt
test.txt                                                                              100%   17     0.1KB/s   00:00

ADCDの配置

参考: Configuring Extended ADCD
ZD&Tと同様に、Waziでも出来合いのz/OSイメージ(各ミドルウェアや開発環境などが構成されたもの)を含むDASDイメージが提供されています。これはADCD(Application Developer Controlled Distribution)と呼ばれています。このADCD関連のファイルをsftpサーバーに配置します。

ftp用のディレクトリ下に、adcd/zos24_2020may/volumesというディレクトリを作成します。

[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp/ftpuser1]$ sudo mkdir adcd
[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp/ftpuser1]$ cd adcd
[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp/ftpuser1/adcd]$ sudo mkdir zos24_2020may
[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp/ftpuser1/adcd]$ cd zos24_2020may/
[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp/ftpuser1/adcd/zos24_2020may]$ sudo mkdir volumes

ここにADCD関連ファイルを配置します(メタデータファイル、圧縮された状態のDASDイメージファイル、devicemapファイルなど)。トータルでファイルサイズが46GBくらいあるので、ICOS経由で転送するのがよいです。
ファイル配置後の構造としては以下のようになります。

[TOMOTAG@iseip20201222-1106-alphabet-1 /mnt/sftp/ftpuser1]$ tree . --charset C
.
`-- adcd
    `-- zos24_2020may
        |-- ADCDTOOLS.XML
        `-- volumes
            |-- B4BLZ1.gz
            |-- B4C541.gz
            |-- B4C551.gz
            |-- B4CFG1.gz
            |-- B4DBAR.gz
            |-- B4DBB1.gz
            |-- B4DBB2.gz
            |-- B4DBC1.gz
            |-- B4DBC2.gz
            |-- B4DIS1.gz
            |-- B4DIS2.gz
            |-- B4DIS3.gz
            |-- B4IME1.gz
            |-- B4IMF1.gz
            |-- B4INM1.gz
            |-- B4KAN1.gz
            |-- B4PAGA.gz
            |-- B4PAGB.gz
            |-- B4PAGC.gz
            |-- B4PRD1.gz
            |-- B4PRD2.gz
            |-- B4PRD3.gz
            |-- B4PRD4.gz
            |-- B4RES1.ZPD
            |-- B4RES2.gz
            |-- B4SYS1.gz
            |-- B4USR1.gz
            |-- B4USS1.gz
            |-- B4USS2.gz
            |-- B4W901.gz
            |-- B4W902.gz
            |-- B4ZCX1.gz
            |-- B4ZWE1.gz
            |-- devmap.txt
            |-- inventory.txt
            `-- SARES1.ZPD

3 directories, 37 files

ネットワーク構成

sftp(ssh)のポート番号(デフォルト:22)に対してOpenShiftクラスター上のサービスからアクセスできるようにネットワーク構成をしておく必要があります(firewalの設定を行っている場合など)。

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