- - PR -
LDAPクライアントとしての設定で、マスターとスレーブを登録したい
1
投稿者 | 投稿内容 |
---|---|
|
投稿日時: 2005-07-27 15:06
RedHatLinux9を2台使って
CD付属のopenldap2.0.27-8で 片方をLDAPのマスターサーバー、 もう片方をLDAPのスレーブサーバーとしています。 マスターもスレーブも /etc/ldap.confと/etc/openldap/ldap.confには マスター側を参照に行く設定にしていて、問題なく動いています。 (スレーブ側を参照に行く設定でも、きちんと認証できる事は確認しています) こういった場合で マスターに何か障害があった場合に 自動的にスレーブ側を参照に行くようにしたいのですが ただ単にldap.confにスレーブ側の設定を追加で記述すればいいのでしょうか? 一応スレーブ側の設定として host、binddn、bindpw を追加したのですが マスターを止めても切り替わらないので、 やり方が違うんでしょうか。 ldap.confは以下のように記述しました。 +++/etc/ldap.conf++++++++++++++++++++ host 192.168.0.10 base dc=test,dc=net binddn cn=Master,dc=test,dc=net bindpw secret host 192.168.0.11 // binddn cn=Slave,dc=test,dc=net //この3行を追加しました bindpw terces // ssl no pam_password md5 +++++++++++++++++++++++++++++++++++++ +++/etc/openldap/ldap.conf+++++++++++ HOST 192.168.0.10 HOST 192.168.0.11 //ここを追加しました BASE dc=test,dc=test +++++++++++++++++++++++++++++++++++++ これだと 192.168.0.11のスレーブのサーバー側を参照してしまいます。 WEBで、LDAPのスレーブサーバーの立ち上げ方は見つかるのですが、 クライアントの設定が見つかりませんでしたので こちらで質問させていただきます。 よろしくお願いします。 [ メッセージ編集済み 編集者: gozoo 編集日時 2005-07-27 15:54 ] [ メッセージ編集済み 編集者: gozoo 編集日時 2005-07-27 15:55 ] [ メッセージ編集済み 編集者: gozoo 編集日時 2005-08-01 17:01 ] |
|
投稿日時: 2005-07-27 16:21
2.0系であれば、まだURIオプションがなかったと思いますので
一つのHOSTオプションに複数記述する形になると思います。 なので2台とも同じBINDDNでBIND出来る必要があるかもしれません。 http://www5f.biglobe.ne.jp/~inachi/openldap/man/man5/ldap.conf.5.html |
|
投稿日時: 2005-07-27 18:40
/etc/ldap.confに以下のように記述しすれば良いと思います。
+++/etc/ldap.conf++++++++++++++++++++ host 192.168.0.10 192.168.0.11 base dc=test,dc=net binddn cn=Manager,dc=test,dc=net //Managerか、proxyユーザなどの代理ユーザ bindpw secret また、/etc/openldap/ldap.confには、私はBASEだけ記述して動いています。 |
|
投稿日時: 2005-08-01 11:27
返信が遅くなり申し訳ありません。
anights様 回答ありがとうございます。 openldapはいじりはじめたばかりでよくわかっていないのですが 同じbinddnという事は マスターサーバーとスレーブサーバーに 同じrootdnを設定するということでよろしいのでしょうか? ao2to様 回答ありがとうございます。 >//Managerか、proxyユーザなどの代理ユーザ ここがよくわかっていないのですが 代理ユーザーはslapd.confに rootdnとは別に追加で記述するということですよね? マスター、スレーブサーバーのslapd.confは以下のように記述しています。 +++マスターサーバー+++++++++++++++++++++ replogfile /var/lib/ldap/master-slapd.replog access to attribute=userPassword by dn="cn=Master,dc=test,dc=net" write by self write by anonymous auth by * none access to * by dn="cn=Master,dc=test,dc=net" write by self write by users read by anonymous auth database ldbm suffix "dc=test,dc=net" rootdn "cn=Master,dc=test,dc=net" rootpw secret directory /var/lib/ldap index objectClass,uid,uidNumber,gidNumber,memberUid eq index cn,mail,surname,givenname eq,subinitial replica host="192.168.0.11:389" binddn="cn=Slave,dc=test,dc=net" bindmethod=simple credentials=secret ++++++++++++++++++++++++++++++++++++++++ +++スレーブサーバー+++++++++++++++++++++ access to attribute=userPassword by dn="cn=Slave,dc=test,dc=net" write by dn="cn=Master,dc=test,dc=net" write by self write by anonymous auth by * none access to * by dn="cn=Slave,dc=test,dc=net" write by dn="cn=Master,dc=test,dc=net" write by self write by users read by anonymous auth database ldbm suffix "dc=test,dc=net" rootdn "cn=Slave,dc=test,dc=net" rootpw secret directory /var/lib/ldap index objectClass,uid,uidNumber,gidNumber,memberUid eq index cn,mail,surname,givenname eq,subinitial updatedn "cn=Slave,dc=test,dc=net" updateref "ldap://192.168.0.10" ++++++++++++++++++++++++++++++++++++++++ |
|
投稿日時: 2005-08-01 12:24
gozoo様
MasterとSlaveの2ユーザに書き込み権限を与えていますが、これは意味がないと思います。 #管理者権限は1ユーザでよいという意味。 こんな感じでよいと思います。 +++マスターサーバー+++++++++++++++++++++ replogfile /var/lib/ldap/master-slapd.replog access to attribute=userPassword by dn="cn=Master,dc=test,dc=net" write by dn="cn=proxyuser,dc==test,dc=net" read by self write by anonymous auth by * none access to * by dn="cn=Master,dc=test,dc=net" write by dn="cn=proxyuser,dc==test,dc=net" read by self write by users read by anonymous auth database ldbm suffix "dc=test,dc=net" rootdn "cn=Master,dc=test,dc=net" rootpw secret directory /var/lib/ldap index objectClass,uid,uidNumber,gidNumber,memberUid eq index cn,mail,surname,givenname eq,subinitial replica host="192.168.0.11:389" binddn="cn=Master,dc=test,dc=net" bindmethod=simple credentials=secret ++++++++++++++++++++++++++++++++++++++++ +++スレーブサーバー+++++++++++++++++++++ access to attribute=userPassword by dn="cn=Master,dc=test,dc=net" write by dn="cn=proxyuser,dc==test,dc=net" read by self write by anonymous auth by * none access to * by dn="cn=Master,dc=test,dc=net" write by dn="cn=proxyuser,dc==test,dc=net" read by self write by users read by anonymous auth database ldbm suffix "dc=test,dc=net" rootdn "cn=Master,dc=test,dc=net" rootpw secret directory /var/lib/ldap index objectClass,uid,uidNumber,gidNumber,memberUid eq index cn,mail,surname,givenname eq,subinitial updatedn "cn=Master,dc=test,dc=net" updateref "ldap://192.168.0.10" ++++++++++++++++++++++++++++++++++++++++ +++/etc/ldap.conf++++++++++++++++++++ host 192.168.0.10 192.168.0.11 base dc=test,dc=net binddn cn=proxyuser,dc=test,dc=net bindpw secret : +++++++++++++++++++++++++++++++++++++ proxyuserの考え方は、クライアントからのアクセス時は、write権限のない ユーザでアクセスし、LDAPデータベースのwrite権限(管理者権限)は1ユーザが 良いという考え方です。 |
|
投稿日時: 2005-08-01 14:43
ao2to様
proxyuserを設定しますと LDAPデータベースにアクセスできませんでした。 proxyuser用のパスワードを設定する必要があるのでしょうか。 それともOpenLDAP2.0では対応していないということなのでしょうか。 よろしくお願いします。 |
|
投稿日時: 2005-08-01 15:03
gozoo様
proxyuserを使用する場合は、MasterやSlaveと同様にLDIFファイルを作成し、ldapaddする必要があります。 また、/etc/ldap.confのbindpwは、proxyuserのパスワードを設定する必要がありますし、 slapd.confの属性へのアクセス権の設定も適切に行う必要があります。 --------- access to attribute=userPassword by dn="cn=Master,dc=test,dc=net" write by dn="cn=proxyuser,dc==test,dc=net" read by self write by anonymous auth by * none |
|
投稿日時: 2005-08-01 16:15
++proxyuser.ldif++++++++++++++++++++++++++
dn: cn=proxyuser,dc=test,dc=net cn: proxyuser sn: proxyuser objectClass: top objectClass: person userPassword: secret ++++++++++++++++++++++++++++++++++++++++++ 上記内容のldifファイルを作り ldapaddすることで 切り替わることができました。 無事解決です。 ありがとうございました。 |
1