Cortex - Server Clustering Documentation

Network Services:
• Windows – “Cortex Clustering”
• RHES – “Cortex-Clustering” in /etc/init.d/cortexd
• PHP Daemon utilizes TCP port 2400
• Network streams are encrypted

Clustering two servers:
1. Browse to the “Clustering” page in Cortex
2. Enter the main IP address and Cortex admin password of the remote server.
3. Click link

Clustering three or more servers:
1. Have the initial two servers clustered.
2. Log into any of the two clustered servers, or one of the new servers
3. Add the IP address and password information accordingly
4. Click link
5. Repeat

Process of Clustering:
For this write-up let’s say a customer has four servers, and would like them clustered together. The first step to do, of course, is log into one of the servers as admin. After logging in, browse to the “Clustering” page. On this page you can administer the server cluster, such as adding and removing servers to/from a cluster. There will always be one server that will appear for “Localhost” for the local machine. On the form at the bottom of the page, enter in the main IP address of the server you wish to add to the cluster and the Cortex, not server, admin password. When you have both fields entered correctly, click the “Link” icon. Below is the actual process which is completed when two servers are clustered, the local machine is A and remote server is B.

1. A sends authentication request to B.
2. B authenticates A to send commands.
3. If A is linked to other servers it will gather an array of information and send it to B. A will also send a command to tell B to create a link to A.
4. B will create a link with A and send back an array of information containing any other servers B is linked to. B will also loop through the array which was sent to it and link to the other servers in the cluster.
5. A will process the B’s cluster information, if any, and link to those machines.

Each time a server is linked it will go through the above process. However, servers which are linked as a result of the array of existing links will not do any further processing (will not send back it’s cluster information). Through this process we can effectively combine clusters of servers fast and efficiently.

Removing a server from the cluster:
1. Log into any machine which is linked to the server you wish to remove.
2. Browse to the “Clustering” page.
3. Click the Unlink icon to remove the server from the cluster.

When removing a server from the cluster, you will want to make sure that you do not log into that server and unlink the other servers as it will deconstruct the existing cluster. Unlinking a server will effectively remove that server from the entire cluster, it will not simply unlink it from one server.

Linking users:
1. Log into any machine in an existing cluster.
2. Browse to the “Users” page.
3. Expand the user you wish to create a link for.
4. Click on the “Link” icon.
5. Select the server for the user you wish to create a link to.
6. Click next
7. Select the user to create a link to.
8. Click next

One thing to note about linked users is that the Admin user is automatically linked together when a server is added to the cluster, think of it as a global user. A user link allows that user to control instances on separate machines with one instance of Cortex. Linking users also behaves like adding a server to the cluster. The local machine will send out an array of remote users which the user is linked to, and the remote server will link to those users on the remote servers as well.

Removing a user link:
1. Log into any machine in the cluster.
2. Browse to the “Users” page.
3. Expand the user you wish to remove a link for.
4. Click the delete icon next to the link you wish to remove in the “Linked to” list.
5. Confirm the removal of the link

Removing a link between users behaves differently than removing a server from a cluster. When removing a link, it is simply removing the one reference from server A to server B, not removing the other references to that user throughout the cluster.

Adding a user to the cluster:
1. Log into any machine in the cluster
2. Browse to the “Users” page.
3. Click the Add icon on the server you wish to add a user to
4. Fill out the information accordingly.
5. For the Creation Mode option, select “Create across cluster”
6. Click Add
7. Resolve any conflicts that appear

Adding a user to the cluster is relatively simple, when the option to create across the cluster is given, the local server will add the user locally then it will add that user to every server in the cluster. If the user already exists on a remote server it will create a conflict. All conflicts will be resolved on a single page which lists an option-per-server to “Merge” with that user (Create a link), or leave that user separate from the global user you’re attempting to create. During this process links are created between all users that have been created and all users which have been marked to be merged.

Expanding a user across the cluster:
1. Log into any machine in the cluster
2. Browse to the “Users” page.
3. Expand the details for the user you wish to modify
4. Click the Edit icon.
5. For the User Type, select “Expand across cluster.”
6. Click Save.
7. Resolve any conflicts that appear

Expanding a user across the cluster is very similar to adding a global user, and actually uses the exact same function. The only difference is that the user is not created locally, but rather uses the existing user’s user ID and other information to create users on the remote servers.

Set a user to local only:
1. Log into any machine in the cluster
2. Browse to the “Users” page.
3. Expand the details for the user you wish to modify.
4. Click the Edit icon.
5. For the User Type, select “Local server only.”
6. Click save.

Setting a user to be local-only will remove any links from that user to other users in the cluster. It will not remove links from the remote users to other remote users.

Engine Administration:
1. Log into any machine in the cluster
2. Browse to the “Engines” page.
3. Select the actions for a single engine you wish to have executed on your cluster.
4. Click next

Instance Administration:
1. Log into any machine in the cluster
2. Browse to the “Instances” page.
3. Click the “Add” icon in the upper right corner of the user’s block.
4. Follow the steps accordingly.

Adding an instance is the same as before server clustering, except you can select which server to place the instance on. If you have users on your servers which are not linked together they will display as “User”@”Host”, clicking the Add icon for one of these users will assume you wish to add it to the server that the user exists on and does not prompt for you to select a server.

On the instances page, instances which are assigned to remote users which are linked to a local user are displayed under that local user’s instance block. Sub users will see the same effect as they log into their account. They can have an account on 5 servers, instances on 5 servers, but administer them all from one server if the users are linked.

Instance Transferring:
1. Log into any machine in the cluster.
2. Browse to the “Instances” page.
3. Click the “Edit Config” icon for the instance you wish to transfer.
4. Under “Network Configuration” select the server to transfer to from the Change server form. Click next.
5. Select the new IP Address for the instance. Click next.
6. Select the new Port for the instance. Click next.
7. If required, change the name of the instance, else leave as-is. Click next.

Transferring instances will move absolutely every file in the instances directory that was modified by the end-user. Cortex runs a complex scan across the directory to assure the fastest transfer possible. All files are then collected into a ZIP archive and transferred to the remote server. Transferring is not os-dependant.