Help, zimbra error after Public IP Address changed

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
User avatar
porokh
Posts: 17
Joined: Tue May 14, 2019 10:02 am
Location: Ukraine
ZCS/ZD Version: 8.8.15 RHEL7 FOSS

Re: Help, zimbra error after Public IP Address changed

Post by porokh »

Hello!

Did you check LDAP config files (/opt/zimbra/conf/ldap-*.cf)?
Each of it starts with "server_host = ldap://server.address:389", normally it might be symbolic name, but look like in your case it is numerical old IP.
User avatar
porokh
Posts: 17
Joined: Tue May 14, 2019 10:02 am
Location: Ukraine
ZCS/ZD Version: 8.8.15 RHEL7 FOSS

Re: Help, zimbra error after Public IP Address changed

Post by porokh »

ingenetic wrote:i already check, all LDAP config file in /opt/zimbra/conf/ldap_*.cf
for server_host = ldap://mail.myzimbra.com:389 <== all using domain name , no ip address
It's strange enough why ldap still trying to connect to old IP, and why there are numeric IP (not domain name) in the error message. I have no idea why this happens; as a workaround you may try to write "server_host = ldap://103.20.xx.xx:389" in the all of /opt/zimbra/conf/ldap_*.cf files.
User avatar
porokh
Posts: 17
Joined: Tue May 14, 2019 10:02 am
Location: Ukraine
ZCS/ZD Version: 8.8.15 RHEL7 FOSS

Re: Help, zimbra error after Public IP Address changed

Post by porokh »

ingenetic wrote:is there any effect with the NIC / lan card? do i have to change the NIC / lan card?

please help me guys ..

Thank you.
No, you have not to change anything else -- just tell your Zimbra's LDAP: "please do not use domain name and resolve it via DNS, but connect directly to this IP".
User avatar
GEOptic
Posts: 6
Joined: Mon Sep 09, 2019 3:36 pm
ZCS/ZD Version: 8.8.15

Re: Help, zimbra error after Public IP Address changed

Post by GEOptic »

Just a quick ideas ...

You restarted named after modifying the zone?
Do you have a reverse pointer as well? That you updated?
Do you have DNS cache that could play with you?
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 889
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Help, zimbra error after Public IP Address changed

Post by JDunphy »

What returns from this command?

Code: Select all

% grep -i hosts /etc/nsswitch.conf 
#hosts:     db files nisplus nis dns
hosts:      files dns
I like to use /etc/hosts before I resolve via dns. That allows me to test new machines fairly easily when I am bringing up new instances to test patches as I only change /etc/hosts with the new ip ... provided ifconfig eth0 or other confirms that you have assigned the ip address to an interface.

HTH,

Jim
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 889
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Help, zimbra error after Public IP Address changed

Post by JDunphy »

Can you investigate this and see if this helps shine a light on what is going on.

Code: Select all

# su - zimbra
% source /opt/zimbra/bin/zmshutil
% zmsetvars
% env |egrep -i '(url|host)' |grep ldap
If these looks sane compared to what your /etc/hosts file looks like and what ifconfig eth0 is returning, you might try and run the command by hand.
Note: observe this comment if you find multiple entries, they will use the first.

Code: Select all

    # Our ldap url should be the first in the list in localconfig
    bind_url=$ldap_bind_url
    if [ x"$bind_url" = "x" ]; then
        bind_url=$(echo "${ldap_url}" | awk '{print $1}')
Anyway... Substitute ldap_bind_url for mail.example.com from above or bind_url depending on what you think is correct.

Code: Select all

# su - zimbra
% source /opt/zimbra/bin/zmshutil
% zmsetvars
% sudo /opt/zimbra/libexec/zmslapd -l LOCAL0 -u zimbra -h "mail.example.com ldapi:///" -F /opt/zimbra/data/ldap/config
I am looking at /opt/zimbra/bin/ldap and seeing what is happening on startup. That bind error is usually

1) something is already listening at that ip + port
2) you don't have the interface configured with the ip address you want to bind that ip address to

I'll look at this some more tomorrow to see if I have missed anything in your posting.

Jim
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 889
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Help, zimbra error after Public IP Address changed

Post by JDunphy »

ingenetic wrote:Hi jim ,

i'm sorry , because i'm not too expert on linux , so 'ive just run your first command suggested .
here the result :

then i check the result from other zimbra machine ( the 3rd of my zimbra machine )
the result same with zimbra which successfully changed the ip address.

the different thing is on:
ldap_bind_url= ( blank )
ldap_bind_url is blank

but in one machine ( that the ldap service failed ,not running ) thereis ip address :

ldap_bind_url=ldap://115.85.xxx.xxx:389 <-- as seen on error .

Failed to start slapd. Attempting debug start to determine error.
6063fa7b daemon: bind(7) failed errno=99 (Cannot assign requested address)
6063fa7b slap_open_listener: failed on ldap://115.85.xxx.xxx:389 ( old ip )

please advice , how to solve the problem.

Regards,
You are expert enough. :-) If that 115.85.xxx.xxx:389 is the old ip address than do this:

Code: Select all

# su - zimbra
% zmlocalconfig | grep -i ldap_bind_url
% zmlocalconfig -e ldap_bind_url=""
% zmlocalconfig ldap_bind_url
Given you showed:

Code: Select all

ldap_master_url=ldap://mail.myzimbra.com:389
ldap_url=ldap://mail.myzimbra.com:389
Because /etc/hosts being is checked first according to your (/etc/nsswitch.conf) before dns resolution, make sure that your "mail.myzimbra.com" is in your /etc/hosts file with the correct ip address. You can restart ldap.

JIm

Ref: https://hazaq.me/zimbra/2018/02/02/Zimb ... ssues.html
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 889
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Help, zimbra error after Public IP Address changed

Post by JDunphy »

ingenetic wrote:Hi Jim,

if i wanna try to changing the zimbra ip address again on that machine, when i have to write the command below ?

Code: Select all

# su - zimbra
% zmlocalconfig | grep -i ldap_bind_url
% zmlocalconfig -e ldap_bind_url=""
% zmlocalconfig ldap_bind_url
after i change the ip address of nic , edit etc/hosts. resolv.conf, and etc ? or before i change the ip address of my zimbra machine . i mean , is it while the zimbra machine still using the old ip ?

please advice.

Thanks n regards,
You should be able to do this incrementally so you can revert back. The 1st command will provide the current settings so you can cut/paste that back should you need to. The 2nd command will reset it to null and the 3rd command will verify to you that you changed it to null.

So here could be one scenario for you.

1) if you do it first before changing the old ip address, it should still work. Make the change and the verify that the old ip address still works with your setup when ldap_bind_url is null like your other machines you have running.

2) Next you can change the ip address, update /etc/hosts like you did for the other servers and make any changes to DNS, etc and it should still work as in step 1 but with a different ip address

My assumptions is that previously - ldap://115.85.xxx.xxx:389 for this server was the same ip address as: mail.myzimbra.com in your /etc/hosts.

Your reversal strategy is change back the ip, etc and put ldap_bind_url to that hard coded ip address as you had previously.

Why does it work this way?... if you remember I showed you this in my second post which was from /opt/zimbra/bin/ldap that is responsible for starting ldap.

Code: Select all

bind_url=$ldap_bind_url
    if [ x"$bind_url" = "x" ]; then
        bind_url=$(echo "${ldap_url}" | awk '{print $1}')
    fi
sudo /opt/zimbra/libexec/zmslapd -l LOCAL0 \
                -u zimbra -h "${bind_url} ldapi:///" -F /opt/zimbra/data/ldap/config
So if ldap_bind_url is null then we use the ldap_url variable which you showed as: ldap_url=ldap://mail.myzimbra.com:389 above.

The goal here is to use the value from /etc/hosts to set the ip address for ldap so it isn't hardcoded as an ip address like you have now for this one server but similar to the other servers that you have been able to switch the ip address.

If this doesn't make sense, let me know as you know your environment better than I do.

Jim
Post Reply