Installation Help
From Zentific Wiki
Contents |
[edit] Overview
The Zentific architecture is comprised of six main parts:
Recommended setup:
LibZXR, ZRPC, and Zensched are all installed on a single server.
This is connected over local network to both a secure database server and a web server.
Separate dom0 nodes running ZPOLL are located somewhere in network contact with the ZRPC server.
All components (except for the interface) can be configured and compiled by running "./bootstrap.sh" after checking them out from svn (svn co http://svn.zentific.com/trunk/MODULENAME).
Then run "make install".
Installation directory defaults to '/opt/zentific' to avoid collisions.
[edit] Dependencies
[edit] CentOS/rpm-based
[edit] base
yum -yy groupinstall "Development Tools"
[edit] zrpc
yum -yy install libxml2 openssl glib2 zlib pam mysql libxml2-devel openssl-devel glib2-devel zlib-devel pam-devel mysql-devel re2c
- If re2c is not present on your distribution, you can obtain it by adding the EPEL repository
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
- If json-glib is available:
yum -yy install json-glib json-glib-devel
[edit] zensched
yum -yy install glib2 mysql zlib python glib2-devel mysql-devel zlib-devel python-devel
[edit] zpoll
yum -yy install xen xen-devel
[edit] Debian-based
[edit] base
apt-get -y install build-essential subversion autoconf libtool ssh
[edit] zrpc
apt-get -y install libxml2 libssl libglib2.0 libpam0g libmysqlclient15 libxml2-dev libssl-dev libglib2.0-dev libpam0g-dev libmysqlclient15-dev re2c
- Optional:
apt-get -y install libjson-glib-1.0-0 libjson-glib-1.0-0-dev
[edit] zensched
apt-get -y install libglib2.0 libmysqlclient15 zlib1g libglib2.0-dev libmysqlclient15-dev zlib1g-dev (python2.5 python2.5-dev OR python2.6 python2.6-dev OR python2.7 python2.7-dev)
[edit] zpoll
apt-get -y install libxen libxen-dev
[edit] Suse-based
[edit] base
zypper install -y -t pattern devel_C_C++ -t package subversion
[edit] zrpc
zypper install -y libxml2 libopenssl glib2 libxml2-devel libopenssl-devel glib2-devel pam libmysqlclient pam-devel libmysqlclient-devel re2c
- Optional:
zypper install -y json-glib json-glib-devel
[edit] zensched
zypper install -y glib2 libmysqlclient zlib python glib2-devel libmysqlclient-devel zlib-devel python-devel
[edit] zpoll
zypper install -y xen xen-devel
[edit] Preparation
Check the dependency table above and install the correct packages for your distribution. Then on the machine which will be your zentific backend, run the following:
mkdir zentific && cd zentific for x in libzxr libzshare zrpc zensched ; do svn co http://svn.zentific.com/trunk/$x && cd $x && (./bootstrap.sh || break) && (sudo make install || break) && cd .. ; done sudo mkdir /var/run/zentific
[edit] MYSQL
This section covers the configuration of a mysql database for use with Zentific.
[edit] Installation
See http://dev.mysql.com/doc/refman/5.1/en/installing.html for more information on this topic.
[edit] Create the database
In your mysql shell, run the following to create the database and user (replace $password with a password):
CREATE DATABASE zentific; GRANT ALL ON zentific.* TO 'zentific'@'localhost' IDENTIFIED BY '$password';
[edit] Import the schema
In zentific/zrpc, run the following:
mysql -p zentific < zentific.sql
[edit] Configure the database module
Edit your database information in /opt/zentific/db/zrpcdb.conf, then execute:
/opt/zentific/utils/zrpcdb_init
[edit] ZRPC
[edit] Create system directories
Run:
sudo mkdir /var/run/zentific
[edit] Configure ZRPC
Edit your distro-specific zrpc config files in /etc (they exist if we support your distro!), or edit /opt/zentific/zrpc.conf if we do not.
[edit] Verify listen address
If you will be connecting to zrpc from a machine that is not localhost, you MUST change the HOST line from 127.0.0.1 to 0.0.0.0!
[edit] Open necessary ports
TODO: documentation
[edit] Test
To verify that your configuration was successful, run:
/opt/zentific/bin/zrpc -X
If there are no errors, you can safely press ctrl+C to close the process.
[edit] Run
Start zrpc with:
/etc/init.d/zrpc start
or if your distro is unsupported you can run:
/opt/zentific/bin/zrpc
[edit] Hosting
[edit] APACHE
[edit] TODO: DOCUMENTATION
Apache is the preferred method used to host the Zentific web interface to make it accessible to users.
- have the web interface set up somewhere (/zentific works fine)
- include a ProxyPass line like this (using the IP of the computer running the ZRPC server):
ProxyRequests Off
<Location /rpc/>
ProxyPass http://xxx.xxx.xxx.xxx:4444/
ProxyPassReverse http://localhost/
</Location>
- It is recommended that mod_deflate (or, for other http servers/old versions of apache, mod_gzip) be enabled for the /rpc location
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
DeflateCompressionLevel 9
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
ProxyRequests Off
<Location /rpc/>
SetOutputFilter DEFLATE
ProxyPass http://xxx.xxx.xxx.xxx:4444/
ProxyPassReverse http://localhost/
</Location>
[edit] SELF HOSTING
Alternatively, if a web server supporting reverse proxy features (like Apache, nginx, lighttpd) is not available or desired, zrpc is able to host web interface resources itself. This is known as self-hosting mode. To enable it, set the following in zrpc.conf, and the interface will show up on the port that zrpc is using.
SELF_HOST="1" WEB_ROOT="/path/to/WebUI-2.0.0_interface"
For example, http://zentific.domain.com:4444/ or http://zentific.domain.com/ (if zrpc is bound to port 80).
At this time, it is recommended that Apache or similar be utilized in place of self-hosting mode, despite the added complexity and depenency it implies.
[edit] LightHTTPD
Add the following to /etc/lighttpd/conf-enabled/10-proxy.conf
proxy.server = ( "/rpc/" => ( "" => ( "host" => "127.0.0.1", "port" => 4444 )))
[edit] WEB INTERFACE
The Zentific web interface connects to ZRPC and provides a GUI to interact with all configured nodes and virtual machines.
[edit] Code Check-out
svn co http://svn.zentific.com/trunk/WebUI-2.0.0 /opt/zentific/www
[edit] Configuration
Edit /opt/zentific/www/javascript/configuration.js:
SERVER:'the ip/domain of the zrpc server', RPC_METHOD:'xmlrpc', RPC_PATH:'/rpc/', POLL_INTERVAL: 5000
- If json-glib was previously installed in #Dependencies, RPC_METHOD can be set to 'json'.
[edit] Create ZPOLL User
Create a "Node" type user in the Users tab with node permissions and a secure password. This is the user which ZPOLL will run as.
[edit] FIXME: DOCUMENTATION
[edit] FIXME: SCREENSHOTS
[edit] ZENSCHED
Zensched is the scheduler daemon which coordinates and manages jobs for Zentific.
[edit] Remote Setup of Dom0 Nodes
To configure Zensched, you will need to run two scripts which have been installed in /opt/zentific/utils.
[edit] dom0.sh
Copy dom0.sh to all dom0 (privileged domain) nodes, then run it as root on those nodes:
sudo ./dom0.sh
You will be asked for a temporary password which you WILL need to reuse. The script will then pause while it waits for the next step.
[edit] backend.sh
On the system (or VM) where you have just installed ZRPC and Zensched, run:
/opt/zentific/utils/backend.sh [ip address of dom0]
Repeat the running of backend.sh for every dom0 node which will be managed by Zentific. These scripts will set up the necessary config for Zentific's ssh usage.
[edit] Start Zensched
Start zensched with:
/etc/init.d/zensched start
or with:
/opt/zentific/bin/zensched
[edit] ZPOLL
ZPOLL is the statistics gathering daemon which runs on a dom0 node and reports back to ZRPC.
[edit] Installation
[edit] Dependencies
See #Dependencies
[edit] Check-out and build code
On a dom0 that you previously ran dom0.sh from, svn check-out and build zpoll and zshare:
mkdir zentific && cd zentific for x in libzshare zpoll; do svn co http://svn.zentific.com/trunk/$x && cd $x && (./bootstrap.sh || break) && (sudo make install || break) && cd .. ; done sudo mkdir /var/run/zentific
[edit] Configuration
Edit the ZPOLL config file in your distribution's /etc/ directory for services, then edit /opt/zentific/zpoll.conf.
You will need to match the connection settings in /opt/zentific/zpoll.conf to match what you previously set in your zrpc config.
[edit] Start ZPOLL
Once your zpoll install is configured, you can start it with
/etc/init.d/zpoll start
or if your distro is unsupported, try
/opt/zentific/bin/zpoll
[edit] Enable the Node
On its first run, zpoll will register the node that it is running on with the zrpc backend. By default, nodes are added in a disabled state.
Enabling a node from the web interface can be done easily by clicking Nodes on the left, then clicking Node Check-in.
[edit] FIXME: SCREENSHOT HERE
[edit] ZENSTATD (optional)
Zenstatd is a daemon which runs inside a Xen VM and reports more detailed statistics to be passed back to ZRPC.
[edit] Code Check-out
Ensuring that the proper BASE packages have been installed from #Dependencies, run:
mkdir zentific && cd zentific for x in libzshare zenstatd; do svn co http://svn.zentific.com/trunk/$x && cd $x && (./bootstrap.sh || break) && (sudo make install || break) && cd .. ; done sudo mkdir /var/run/zentific
[edit] Configuration
The file /opt/zentific/zenstatd.conf controls the settings, configure it as necessary.
[edit] Start Zenstatd:
/etc/init.d/zenstatd start
or
/opt/zentific/bin/zenstatd
[edit] Troubleshooting
Connect to irc.freenode.net and join #zentific for help with any issues.
