TECHZEN Zenoss User Community ARCHIVE  

How to get Multiple Zopes in Zenoss 4.2.x

Subject: How to get Multiple Zopes in Zenoss 4.2.x
Author: [Not Specified]
Posted: 2014-12-30 12:20

Hi Zenoss Users,

I have been trying to figure out for awhile a way to get multiple zope process to run on one zenoss master server. I have many users of zenoss and zope is always the bottleneck. I got this working in my test environment and plan to promote these changes to production in the new year. Right now I GSLB to two varnish server then back to zenoss (zope). This will allow me to split to load further to two different zope processes.

I was able to figure this out looking at a patch hackman238 created (but did not work on zenoss core 4.2.x)
https://github.com/Hackman238/Random/blob/master/multiplezope.patch

Also consider tuning zope, especially the python-check-interval

If people are interested I can create a formal patch but I want to test this further under a production load.

You will need to create new directories under /opt/zenoss/var/ called zope plus the zope instance starting with 1. Create the amount of directories depending on the number of zope processes you will spin up. In this example I am going to start 2 zope processes.

[zenoss@a-tst-zen01 bin]$ ls -lsa /opt/zenoss/var/ | grep zope
4 drwxr-xr-x 2 zenoss zenoss 4096 Dec 30 12:51 zope1
4 drwxr-xr-x 2 zenoss zenoss 4096 Dec 30 12:51 zope2

[zenoss@a-tst-zen01 bin]$ ls -lsa /opt/zenoss/var/zope*
/opt/zenoss/var/zope1:
total 20
4 drwxr-xr-x 2 zenoss zenoss 4096 Dec 30 12:51 .
4 drwxr-xr-x 9 zenoss zenoss 4096 Dec 30 13:01 ..
4 -rw-r--r-- 1 zenoss zenoss 4 Dec 30 12:51 Z2.lock
4 -rw-r--r-- 1 zenoss zenoss 4 Dec 30 12:51 Z2.pid
4 -rw-rw-r-- 1 zenoss zenoss 82 Dec 29 13:39 zope.conf
0 srwx------ 1 zenoss zenoss 0 Dec 30 12:51 zopectlsock

/opt/zenoss/var/zope2:
total 20
4 drwxr-xr-x 2 zenoss zenoss 4096 Dec 30 12:51 .
4 drwxr-xr-x 9 zenoss zenoss 4096 Dec 30 13:01 ..
4 -rw-r--r-- 1 zenoss zenoss 4 Dec 30 12:51 Z2.lock
4 -rw-r--r-- 1 zenoss zenoss 4 Dec 30 12:51 Z2.pid
4 -rw-rw-r-- 1 zenoss zenoss 82 Dec 29 13:39 zope.conf
0 srwx------ 1 zenoss zenoss 0 Dec 30 12:51 zopectlsock

Also create a zope.conf under these new directories per zope instance

[zenoss@a-tst-zen01 bin]$ cat /opt/zenoss/var/zope*/zope.conf
%include /opt/zenoss/etc/zope.conf
clienthome /opt/zenoss/var/zope1
port-base 100
%include /opt/zenoss/etc/zope.conf
clienthome /opt/zenoss/var/zope2
port-base 101

per comments in the /opt/zenoss/etc/zope.conf
# Directives: port-base
#
# Description:
# Offset applied to the port numbers used for ZServer
# configurations. For example, if the http-server port is 8080 and
# the port-base is 1000, the HTTP server will listen on port 9080.
# This makes it easy to change the complete set of ports used by a
# Zope server process

Edit two files in /opt/zenoss/bin, zopectl and runzope

[zenoss@a-tst-zen01 ~]$ cd /opt/zenoss/bin/
[zenoss@a-tst-zen01 bin]$ cat zopectl
#!/bin/sh
PYTHON="/opt/zenoss/bin/python"
INSTANCE_HOME="/opt/zenoss"
export INSTANCE_HOME PYTHON

ZDCTL="/opt/zenoss/zopehome/zopectl"

ZOPES=2

for i in $(seq 1 $ZOPES); do
##Setup enviornment to start zope
clienthome="$INSTANCE_HOME/var/zope$i"
cfg="$clienthome/zope.conf"
CONFIG_FILE=$cfg
export CONFIG_FILE
##Start Zope
"$PYTHON" "$ZDCTL" -C "$cfg" "$@"
done

[zenoss@a-tst-zen01 bin]$ cat runzope
#!/bin/sh
CONFIG_FILE="${CONFIG_FILE:-/opt/zenoss/etc/zope.conf}"
ZOPE_RUN="/opt/zenoss/zopehome/runzope"
exec "$ZOPE_RUN" -C "$CONFIG_FILE" "$@"

Start!

[zenoss@a-tst-zen01 bin]$ zopectl start
.
daemon process started, pid=9937
.
daemon process started, pid=9942

[zenoss@a-tst-zen01 bin]$ tail -12 ../log/event.log
------
2014-12-30T13:14:28 INFO ZServer HTTP server started at Tue Dec 30 13:14:28 2014
Hostname: 0.0.0.0
Port: 8180
------
2014-12-30T13:14:29 INFO ZServer HTTP server started at Tue Dec 30 13:14:29 2014
Hostname: 0.0.0.0
Port: 8181
------
2014-12-30T13:14:32 INFO Zope Ready to handle requests
------
2014-12-30T13:14:33 INFO Zope Ready to handle requests

[zenoss@a-tst-zen01 bin]$ netstat -an | grep 818
tcp 0 0 0.0.0.0:8180 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8181 0.0.0.0:* LISTEN

[zenoss@a-tst-zen01 bin]$ ps -ef | grep zope
zenoss 10078 1 0 13:14 00:00:00 /opt/zenoss/bin/python /opt/zenoss/lib/python/zdaemon/zdrun.py -S /opt/zenoss/lib/python/Zope2/Startup/zopeschema.xml -b 10 -s /opt/zenoss/var/zope1/zopectlsock -x 0,2 -z /opt/zenoss /opt/zenoss/bin/runzope
zenoss 10080 10078 2 13:14 00:00:04 /opt/zenoss/bin/python /opt/zenoss/zopehome/runzope -C /opt/zenoss/var/zope1/zope.conf
zenoss 10083 1 0 13:14 00:00:00 /opt/zenoss/bin/python /opt/zenoss/lib/python/zdaemon/zdrun.py -S /opt/zenoss/lib/python/Zope2/Startup/zopeschema.xml -b 10 -s /opt/zenoss/var/zope2/zopectlsock -x 0,2 -z /opt/zenoss /opt/zenoss/bin/runzope
zenoss 10104 10083 2 13:14 00:00:04 /opt/zenoss/bin/python /opt/zenoss/zopehome/runzope -C /opt/zenoss/var/zope2/zope.conf
zenoss 10325 8591 0 13:17 pts/0 00:00:00 grep zope



Subject: you get better performance
Author: [Not Specified]
Posted: 2015-01-02 02:10

you get better performance now Do you have some stats



Subject: hi,
Author: Andrew Kirch
Posted: 2015-01-05 09:03

hi,

This is a feature in the commercial product, so I don't recommend a formal patch. What I would recommend is attempting to package this as a ZenPack, and releasing it that way.

Andrew Kirch

akirch@gvit.com

Need Zenoss support, consulting or custom development Look no further. Email or PM me!

Ready for Distributed Topology (collectors) for Zenoss 5 Coming May 1st from GoVanguard



Subject: I just promoted this to
Author: [Not Specified]
Posted: 2015-01-08 14:11

I just promoted this to production. I will write back about performance after a week or so. I am only running two zopes now want plan on adding a 3rd soon.

Not sure if I will have time create zenpack plus I like what I see from new Zenoss so maybe we upgrade sooner than later :-)



Subject: RE: I just promoted this to
Author: rahul r
Posted: 2017-06-21 20:18

Hi 
I followed your post and implemented dual zope in my environment zenoss 4.2.5.
In my case 3 zope process are running with default port no 8080, 8180 and 8181 but as in your case I can see in your post only 2 zope process are running.
Is there any problem if 3 daemons are running in my instance. actually i configured dual zope only.
And should the zope be stopped before configuring dualzope ??
Now the issue is we have experienced a few crashes .It hasn't completely crashed but is taking extremely long to load any pages.

Can you please provide me solution

------------------------------
rahul r
system admin
verizon
hyderabad KY
313874684
------------------------------


Subject: Kenhen93, can it get better
Author: [Not Specified]
Posted: 2015-01-19 10:10

Kenhen93, can it get better web GUI performance



Subject: Yes, I have had this setup in
Author: [Not Specified]
Posted: 2015-02-04 08:01

Yes, I have had this setup in production for about a month now and zope is not having anymore issues. I have not had anyone complain they cannot reach zenoss



Subject: Kenhen: please write a howto
Author: Andrew Kirch
Posted: 2015-02-04 11:08

Kenhen: please write a howto and post it on our wiki: http://wiki.zenoss.org

Andrew Kirch

akirch@gvit.com

Need Zenoss support, consulting or custom development Look no further. Email or PM me!

Ready for Distributed Topology (collectors) for Zenoss 5 Coming May 1st from GoVanguard



< Previous
Zenping not started
  Next
SNMPv3 on Cisco devices
>