Page 1 of 1

Zend Server on AWS not leaving cluster properly

Posted: Fri Mar 10, 2017 8:32 am
by noisemc
I am running CloudFormation stack with schedule based autoscaling. New instance is launched at 7am and terminated at 8pm.

Every time instance gets terminated I get an error in GUI "Server status is not up to date. Verify that the Zend Server daemon is running on this server." with that terminated server IP.
I have to remove it manually because if in the future autoscale group launches a new instance with IP that has already been used in the past and terminated, this new instance cannot join the cluster because that IP is there in warning state.

I tried to track it down, even created my own AMI (yum update to 8.5.7) and tried playing with /etc/init.d/zs-unreg
I noticed this script has a lock file created in /var/lock/subsys/zs-unreg and it also has a symlink in /etc/rc.d/rc0.d/K00zs-unreg but it was not registered with chkconfig

I tried to add it with chkconfig by running chkconfig zs-unreg --level 06 on and it told me that zs-unreg was not compatibile with chkconfig so I added a header:
# chkconfig: 345 96 06

I was able to register it with chkconfig zs-unreg --level 06 on after adding the header however when terminating the instance it still hasn't left the cluster before termination.

Has anyone been able to fix this?
We're running AMI ID zs8-rhel7-pro-php5.6-140-0fb02024-34a3-4dc1-a978-fc1add00d719-ami-ee320384.3 (ami-73122119)


Re: Zend Server on AWS not leaving cluster properly

Posted: Wed Mar 22, 2017 10:28 am
by dima_z_zend

This behavior is not the expected one. To help you solve the problem in a best way for you I would suggest you open ticket at


Re: Zend Server on AWS not leaving cluster properly

Posted: Wed Mar 22, 2017 12:40 pm
by noisemc
Thanks Dima,
I opened a ticked and in the meanwhile I am playing with systemd

Code: Select all

Description=ZS Unreg

ExecStop=/usr/local/zend/bin/php /root/zs-init/shutdown.php

It works with the single instance but stil doesn't work with CloudFormation after I created and used my own AMI based on Zend One