Directory Server を管理するDSCCを切り替える方法
背景
Directory Serverの管理業務はWebベースのGUIである、DSCC(Directory Service Control Center)で行なうことが可能です。しかしながら、DSCC自身に障害が発生してしまった場合にはWebでの管理ができなくなってしまいます。
そのような場合に、別のDSCCからDirectory Serverの管理を行なえるようにする方法をここで解説します。
前提条件
- Directory Server, DSCCはインストールされている。
- 通常は DSCC A からDirectory Serverの管理を行なっている。
- DSCC A に障害が発生した場合に、DSCC B からDirectory Serverの管理を行なえるようにする。
切り替え手順(シナリオ)(DSCC A から DSCC Bへ)
通常時の状態
- 以下の図のような状態です。
- DSCC A からDirectory Serverが管理できる状態になっています。
- Directory Server側の設定情報(nsslapd-pluginarg0: ldap://sw-06:3998/cn=dscc の部分がADSインスタンス(DSCCの構成・設定情報を格納しているDirectoryServerインスタンス)に関する設定情報です。)
bash-3.00# vi /var/opt/SUNWdsee/dsins1/config/dse.ldif dn: cn=Pass Through Authentication,cn=plugins,cn=config objectClass: top objectClass: nsSlapdPlugin objectClass: ds-signedPlugin objectClass: extensibleObject cn: Pass Through Authentication nsslapd-pluginPath: /opt/SUNWdsee/ds6/lib/passthru-plugin.so nsslapd-pluginInitfunc: passthruauth_init nsslapd-pluginType: preoperation nsslapd-pluginarg0: ldap://sw-06:3998/cn=dscc nsslapd-pluginEnabled: on modifiersName: cn=directory manager modifyTimestamp: 20090212102345Z nsslapd-pluginId: passthruauth nsslapd-pluginVersion: 6.3 nsslapd-pluginVendor: Sun Microsystems, Inc. nsslapd-pluginDescription: pass through authentication plugin
DSCC A 停止(障害時にDSCCが停止してしまったという状態にします。)
- 以下の図のような状態になります。
- Sun Java Web Console を停止する。
bash-3.00# /usr/sbin/smcwebserver status Sun Java(TM) Web Console is running bash-3.00# /usr/sbin/smcwebserver stop Shutting down Sun Java(TM) Web Console Version 3.0.3 ... The console is stopped bash-3.00#
- ADSインスタンス(DSCCの構成・設定情報を格納しているDirectoryServerインスタンス)を停止する。
bash-3.00# /opt/SUNWdsee/ds6/bin/dsadm stop /var/opt/SUNWdsee/dscc6/dcc/ads サーバーが停止しました bash-3.00#
スタンバイ側のDSCC(DSCC B)を起動する。
- 以下の図のような状態になります。
- ADSインスタンス(DSCCの構成・設定情報を格納しているDirectoryServerインスタンス)を起動する。
bash-3.00# /DSEE631/ds6/bin/dsadm start /DSEE631/var/dscc6/dcc/ads/ Directory Server インスタンス '/DSEE631/var/dscc6/dcc/ads' が起動されました: pid=29132 bash-3.00#
- Tomcat5.5 を起動する。(DSCC BはTomcat上にデプロイされています。)
bash-3.00# pwd /Tomcat55/apache-tomcat-5.5.27 bash-3.00# cd bin/ bash-3.00# ./startup.sh Using CATALINA_BASE: /Tomcat55/apache-tomcat-5.5.27 Using CATALINA_HOME: /Tomcat55/apache-tomcat-5.5.27 Using CATALINA_TMPDIR: /Tomcat55/apache-tomcat-5.5.27/temp Using JRE_HOME: /usr/jdk/jdk1.5.0_12/ bash-3.00#
スタンバイ側のDSCC(DSCC B)にDirectory Serverインスタンスを登録する。
- 以下の図のような状態になります。
- スタンバイ側のDSCC(DSCC B)にログインします。
- この時点では、Directory Serverインスタンスを登録していませんので、その他のサーバの操作 から 既存のサーバを登録 を選択します。
- 登録する Directory Serverインスタンスの情報を入力して 次へ をクリックします。
- Directory Serverが起動しているサーバのユーザ情報を入力します。
- Directory Serverにアクセスして管理するためのユーザDNとパスワードを入力します。
- 入力した情報を確認して 完了 をクリックします。
設定を有効にするために、Directory Serverが再起動されます。
- 登録作業中の画面。
- 登録作業が完了しました。閉じる をクリックして画面を閉じます。
ここで、画面が文字化けしていますが、これは画面をキャプチャする際にサーバ側の文字コードをCにしていたためのものですので気にしないで下さい。
- Directory Serverが正常に登録されて、管理できるようになりました。
この登録作業で、ADSインスタンス(DSCCの構成・設定情報を格納しているDirectoryServerインスタンス)にDirectory Serverを管理するための管理情報が登録されます。また、Directory Server側のPass Through Authenticationの設定も変更されます。
Directory Serverのアクセスログbash-3.00# vi /var/opt/SUNWdsee/dsins1/logs/access [23/Apr/2009:16:08:39 +0900] conn=48 op=-1 msgId=-1 - fd=22 slot=22 LDAP connection from 1 0.14.11.8:47311 to 10.14.11.6 [23/Apr/2009:16:08:39 +0900] conn=48 op=0 msgId=1 - BIND dn="cn=Directory Manager" method= 128 version=3 [23/Apr/2009:16:08:39 +0900] conn=48 op=0 msgId=1 - RESULT err=0 tag=97 nentries=0 etime=0 .000580 dn="cn=directory manager" [23/Apr/2009:16:08:40 +0900] conn=48 op=6
変更された設定情報 (nsslapd-pluginarg0: ldap://sw-08:3998/cn=dscc)が変更された部分です。
dn: cn=Pass Through Authentication,cn=plugins,cn=config objectClass: top objectClass: nsSlapdPlugin objectClass: ds-signedPlugin objectClass: extensibleObject cn: Pass Through Authentication nsslapd-pluginPath: /opt/SUNWdsee/ds6/lib/passthru-plugin.so nsslapd-pluginInitfunc: passthruauth_init nsslapd-pluginType: preoperation nsslapd-pluginarg0: ldap://sw-08:3998/cn=dscc nsslapd-pluginEnabled: on modifiersName: cn=directory manager modifyTimestamp: 20090423070840Z nsslapd-pluginId: passthruauth nsslapd-pluginVersion: 6.3 nsslapd-pluginVendor: Sun Microsystems, Inc. nsslapd-pluginDescription: pass through authentication plugin
切り替え手順(シナリオ)(DSCC B から DSCC Aへ)
DSCC B 停止(DSCC Aが障害から普及して、再度DSCC AでDirectory Serverを管理するためにDSCC Bを停止します。)
- 以下の図のような状態になります。
- Tomcat5.5 の停止
bash-3.00# /Tomcat55/apache-tomcat-5.5.27/bin/shutdown.sh Using CATALINA_BASE: /Tomcat55/apache-tomcat-5.5.27 Using CATALINA_HOME: /Tomcat55/apache-tomcat-5.5.27 Using CATALINA_TMPDIR: /Tomcat55/apache-tomcat-5.5.27/temp Using JRE_HOME: /usr/jdk/jdk1.5.0_12/ bash-3.00#
- ADSインスタンス(DSCCの構成・設定情報を格納しているDirectoryServerインスタンス)を停止する。
bash-3.00# /DSEE631/ds6/bin/dsadm stop /DSEE631/var/dscc6/dcc/ads/ Directory Server instance '/DSEE631/var/dscc6/dcc/ads' stopped bash-3.00#
障害から復旧したDSCC(DSCC A)を起動する。
- 以下の図のような状態になります。
- ADSインスタンス(DSCCの構成・設定情報を格納しているDirectoryServerインスタンス)を起動する。
bash-3.00# /opt/SUNWdsee/ds6/bin/dsadm start /var/opt/SUNWdsee/dscc6/dcc/ads/ サーバーが起動しました: pid=/var/opt/SUNWdsee/dscc6/dcc/ads bash-3.00#
- Sun Java Web Console を停止する。
bash-3.00# /usr/sbin/smcwebserver start Starting Sun Java(TM) Web Console Version 3.0.3 ... The console is running bash-3.00#
障害から復旧したDSCC(DSCC A)でDirectory Serverを管理できるようにする。
- 以下の図のような状態になります。
- 障害から復旧したDSCC(DSCC A)にログイする。
- ADSインスタンス(DSCCの構成・設定情報を格納しているDirectoryServerインスタンス)にDirectory Serverを管理するための情報は登録されているので、画面上に表示はされます。しかし、Directory Server側の設定情報がスタンバイ側のDSCC(DSCC B)になってるためエラーが表示されています。サーバー カラムの sw-06:389 をクリックして詳細画面にすすみます。
- この画面でもサーバに接続できない状態であることがわかります。(警告 などのエラーが表示されています。) 障害から復旧したDSCC(DSCC A)からDirectory Serverを管理できるようにするために アクセスを有効にする ボタンをクリックします。
- Directory Serverの再起動が発生するという確認メッセージが表示されるので、OK をクリックします。
- Directory Manager のDNとパスワードを入力して、OK をクリックします。
- 設定作業中です。設定が完了したら 閉じる をクリックして画面を閉じます。
- 設定作業が完了して、障害から復旧したDSCC(DSCC A)から、Directory Serverが管理できるようになりました。
この設定作業で、Directory Server側のPass Through Authenticationの設定が変更されます。
Directory Serverのアクセスログ[23/Apr/2009:16:28:49 +0900] conn=79 op=6 msgId=7 - MOD dn="cn=Pass Through Authentication ,cn=plugins,cn=config" [23/Apr/2009:16:28:49 +0900] conn=79 op=6 msgId=7 - RESULT err=0 tag=103 nentries=0 etime= 0.082450, [23/Apr/2009:16:28:49 +
変更された設定情報 (nsslapd-pluginarg0: ldap://sw-06:3998/cn=dscc の部分が一番最初の状態にもどっていることがわかります。)
dn: cn=Pass Through Authentication,cn=plugins,cn=config objectClass: top objectClass: nsSlapdPlugin objectClass: ds-signedPlugin objectClass: extensibleObject cn: Pass Through Authentication nsslapd-pluginPath: /opt/SUNWdsee/ds6/lib/passthru-plugin.so nsslapd-pluginInitfunc: passthruauth_init nsslapd-pluginType: preoperation nsslapd-pluginarg0: ldap://sw-06:3998/cn=dscc nsslapd-pluginEnabled: on modifiersName: cn=directory manager modifyTimestamp: 20090423072849Z nsslapd-pluginId: passthruauth nsslapd-pluginVersion: 6.3 nsslapd-pluginVendor: Sun Microsystems, Inc. nsslapd-pluginDescription: pass through authentication plugin