additional info: nisMapEntry: multiple values provided

Latest response

Hi All,

I created a OPENLDAP server on RHEL 7.2, created another NFS server on RHEL 7.2 and created a NFS client on RHEL 7.
I'm having user home dir and application a/c home dir on the NFS server those are 2 different exports.
But when I login to the NFS client machine, I want both the user home dir and application a/c home dir to be mounted under /home on the NFS client.
I'm able to achieve this requirement by creating local mount using autofs as below on the NFS client.
[root@r7ldnclient ~]# cat /etc/auto.home
* -rw c7gluster1.ajrhel7.net:/home/& \
c7gluster1.ajrhel7.net:/exports/apphome/&

But instead of local AUTOFS on the NFS client, I want to create a LDAP nisMapEntry both for user home dir and application home dir.

OPENLDAP SERVER on RHEL 7.2 : I created as below

/home, auto.master, ajrhel7.net

dn: cn=/home,nisMapName=auto.master,dc=ajrhel7,dc=net
objectClass: nisObject
cn: /home
nisMapName: auto.master
nisMapEntry: auto.home

auto.home, ajrhel7.net

dn: nisMapName=auto.home,dc=ajrhel7,dc=net
objectClass: top
objectClass: nisMap
nisMapName: auto.home

/, auto.home, ajrhel7.net

dn: cn=/,nisMapName=auto.home,dc=ajrhel7,dc=net
objectClass: nisObject
cn: /
nisMapName: auto.home
nisMapEntry: -fstype=nfs,rw c7gluster1.ajrhel7.net:/home/&

My NFS Server is exporting user home dir & application home dir as below

[root@c7gluster1 home]# exportfs -v
/exports/apphome
192.168.7.0/24(rw,wdelay,root_squash,no_subtree_check,sec=sys,rw,secure,root_squash,no_all_squash)
/home 192.168.7.0/24(rw,wdelay,root_squash,no_subtree_check,sec=sys,rw,secure,root_squash,no_all_squash)

But I want LDAP nisMapEntry for application home dir to be mounted on the same mount point i.e /home just like the user home home get mounted

[root@ajc7master ldif]# cat autofs-appmap.ldif
dn: cn=/,nisMapName=auto.home,dc=ajrhel7,dc=net
objectClass: nisObject
cn: /
nisMapName: auto.home
nisMapEntry: -fstype=nfs,rw c7gluster1.ajrhel7.net:/home/&
nisMapEntry: -fstype=nfs,rw c7gluster1.ajrhel7.net:/exports/apphome/&
[root@ajc7master ldif]#

Error :

[root@ajc7master ldif]# ldapadd -D "cn=ajroot,dc=ajrhel7,dc=net" -x -W -f autofs-appmap.ldif
Enter LDAP Password:
adding new entry "cn=/,nisMapName=auto.home,dc=ajrhel7,dc=net"
ldap_add: Constraint violation (19)
additional info: nisMapEntry: multiple values provided

So please suggest how do I create nisMapEntry for 2 exports to be mounted on the same mount point

Responses

You could combine both instances of nisMapEntry for /home:

nisMapEntry: fstype=nfs,rw /apphome c7gluster1.ajrhel7.net:/exports/apphome / c7gluster1.ajrhel7.net:/home/&

Hi Siem, Thank you for your guidance, but I was unable to fix with the above syntax, probably am doing something wrong. However I got it working by creating individual ldap map for the app user a/c as below

below are the user a/c map in ldap radan, people, ajrhel7.net

dn: uid=radan,ou=people,dc=ajrhel7,dc=net uid: radan homeDirectory: /home/radan

nykusr, people, ajrhel7.net

dn: uid=nykusr,ou=people,dc=ajrhel7,dc=net uid: nykusr homeDirectory: /home/nykusr

below are the application a/c map in ldap naapp, people, ajrhel7.net

dn: uid=naapp,ou=people,dc=ajrhel7,dc=net uid: naapp homeDirectory: /home/naapp

euapp, people, ajrhel7.net

dn: uid=euapp,ou=people,dc=ajrhel7,dc=net uid: euapp homeDirectory: /home/euapp

below is the auto.home map to automount the user home dir *, auto.home, ajrhel7.net

dn: cn=*,nisMapName=auto.home,dc=ajrhel7,dc=net objectClass: nisObject cn: * nisMapName: auto.home nisMapEntry: -fstype=nfs,rw c7gluster1.ajrhel7.net:/home/&

below is the auto.home map to mount the application a/c home dir euapp, auto.home, ajrhel7.net

dn: cn=euapp,nisMapName=auto.home,dc=ajrhel7,dc=net objectClass: nisObject cn: euapp nisMapName: auto.home nisMapEntry: -rw c7gluster1.ajrhel7.net:/exports/apphome/euapp

naapp, auto.home, ajrhel7.net

dn: cn=naapp,nisMapName=auto.home,dc=ajrhel7,dc=net objectClass: nisObject cn: naapp nisMapName: auto.home nisMapEntry: -rw c7gluster1.ajrhel7.net:/exports/apphome/naapp

on the ldap-nfs client machine I was able to mount both the user home dir and application home dir under /home as and when the user login.

[root@r7nycnode ~]# [root@r7nycnode ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 3.1G 1.2G 2.0G 38% / c7gluster1.ajrhel7.net:/home/radan 1017M 33M 985M 4% /home/radan c7gluster1.ajrhel7.net:/home/nykusr 1017M 33M 985M 4% /home/nykusr c7gluster1.ajrhel7.net:/exports/apphome/naapp 1017M 33M 985M 4% /home/naapp c7gluster1.ajrhel7.net:/exports/apphome/euapp 1017M 33M 985M 4% /home/euapp

I would love to minimize the number of map but above is the solution I have as of now.

Thank you for your advise. Cheers

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.