On June 23rd Zend announced the release of Zend Server Cluster Manager. Which means what, exactly.
PHP is designed using a shared-nothing architecture. What that means is that nothing is shared. What that really means is that each individual PHP request is isolated from every other PHP request. That's great! It makes for a very stable, very easy to use architecture. But what happens when you go beyond one server?
Not much, in actuality. How about a hundred? Same thing (yes, that is to some degree a hyperbolous statement). You might need to worry about scaling your database now, but the PHP side of things will continue to chug along.
But what about management? Managing a hundred servers is quite different from managing one. Heck, managing three servers is different from managing one. As a side note, you should never have two servers. If you have the budget for two you have the budget for three. Why three? Because when you take one down for maintenance you still have redundancy. If you only have two you do not.
One of the primary ways that Zend Server (not Zend Server Cluster Manager) benefits you is in the monitoring of your PHP application. Checking for long running requests, excessive memory usage, PHP errors and the like, storing that information so you can either replay them in the testing environment or, with Code Tracing, seeing the individual function calls with timing and memory usage. Additionally, you have the ability to use the Job Queue to run tasks asynchronously. You have the ability to manage your configuration via an easy to use GUI. You have the ability to run Session Clustering.
But you don't have the ability to look at your Zend Server servers as a holistic environment. That is what Zend Server Cluster Manager does for you.
- Centralized settings
- Centralized Monitoring (including notification of unauthorized configuration changes)
- Centralized Session Clustering management
- Centralized everything
Got a hundred servers? Need to make a change to php.ini? Piece of cake. Need to add a server and have sessions automatically distributed to the rest of the cluster? Piece of cake. Need to aggregate monitoring data from those hundred servers? Piece of cake.
Setting up Zend Server Cluster Manager is really easy. First, make sure that you have the Zend repository settings in your configuration. In my case I'm using Yum.
name=Zend Server - noarch
After that "yum install zend-server-cluster-manager". The next thing you need to do is make sure that a MySQL server is available somewhere. This MySQL server needs to be accessible to the individual Zend Server nodes so simply doing [email protected] won't be sufficient. Have a non-standard user and make a good password. Keep the server behind a firewall, but make it available to the nodes.
After you have installed Zend Server Cluster Manager you need to go to the GUI page which is on http://(server):10081/. There you will agree to the terms and conditions and enter in the GUI password. After the first two pages you will come upon a page that asks you for two different licenses. The first license key is for the cluster manager itself. The second is the license key that the cluster manager will use on all of the nodes. After you have entered the license keys you will be asked to enter in the database information. It will not accept the localhost as the database. It must be an outward facing network address so the nodes can connect.
After you've done that you are ready to start adding nodes. You can actually add existing Zend Server instances (which is kinda how it works anyway), but make sure that you have updated them to the most current revision first. I didn't do that and submitted a bug report 3 days before the launch because a bunch of things were broken. Hilarity did not ensue.
Adding a new server to the cluster is relatively easy. In the Cluster Setup window click on the "Add Server" button. Enter in the information. Done. When setting up an individual node you will need to at least go through the setup in the GUI once (again, server:10081). You can enter in the license key if you want, but the only thing that's needed on the node is the password so that ZSCM can authenticate against it. Once a server is part of a cluster you cannot manage it except through the ZSCM GUI. Well, I take that back. You can manage it by making changes locally via the CLI, but then ZSCM will throw a warning stating that a server is out of sync. It won't remove it or anything like that, just tell you about it.