Controlling Your Cluster
The openMosix team have provided a number of ways of controlling your cluster, both from the command line, as well as through GUI based tools in X.
From the command line, the main monitoring and control tools are:
- mosmon – which shows you the load on each of the nodes, their speed, memory usage, etc. Pressing 'h' will bring up the help with the different options;
- mosctl - which is a very powerful command that allows you to control how your system behaves in the cluster, some of the interesting options are:
- mosctl block – this stops other people's processes being run on your system (a bit selfish don't you think ;))
- mosctl -block – the opposite of the above
- mosctl lstay – this stops your local processes migrating to other nodes for processing
- mosctl nolstay – the opposite of the above
- mosctl setspeed <number> - which sets the max processing speed to contribute. 10000 is a benchmark of a Pentium 3 1Ghz.
- mosctl whois <node number> - this tells you the IP address of a particular node
- mosctl expel – this expels any current remote processes and blocks new ones from coming in
- mosctl bring – this brings back any of your own local processes that have migrated to other nodes
- mosctl status <node number> - which shows you whether the node is up and whether it is 'blocking' processes, 'staying' them, etc.
- mosrun - allows you to run a process controlling which nodes it should run on
- mps - this is just like 'ps' to show you the process listing, but it also shows which node a process is running on
- migrate - this command allows you to manually migrate a process to any node you like, the syntax for using it is 'migrate <pid> <node #>'. You can also use 'migrate <pid> balance' to load balance a process automatically.
- dsh - Distributed Shell. This allows you to run a command on all the nodes simultaneously. For example ‘ dsh -a reboot ' will reboot all the nodes.
From the GUI, you can just start 'openmosixview'. This allows you to view and manage all the nodes in your cluster. It also shows you the load balancing efficiency of the cluster in near-real-time. You can also see what is the total speed and RAM that your cluster is providing you:
We should note that all cluster nodes that are online are represented with the green colour, while all offline cluster with the red colour.
One of the neatest things about 'openmosixview' is the GUI for controlling process migration.
It depicts your current node at the center, and other nodes in the cluster around it. The ring around your node represents the processes running on your local box. If you hover over any of them you can see the process name and PID. Whenever one of your processes migrates to another node, you will see it detach and appear on a new node with a line linking it to your system!
You can also manually control the migration. You can drag and drop your processes onto other nodes, even selecting multiple processes and then dragging them to another node is easy. If you double click on a process running on a remote node, it will come back home and execute locally.
You can also open the openMosix process monitor which shows you which process is running on which node.
There is also a history analyzer to show you the load over a period of time. This allows you to see how your cluster was being used at any given point in time:
As you can see, the GUI tools are very powerful, they provide you with a large amount of the functionality that the command line tools do. If, however, you want to make your own scripts, the command line tools are much more versatile. Managing a cluster can be a lot of fun, modify the options and play around with the GUI to tweak and optimize your raw processing power!!