= How to Install Quattor with SCDB = [[TracNav]] [[TOC(inline)]] ''Note : the installation process described below is as generic as possible, but does also contains a set of commands that have been tested only on Scientific Linux version 4. They may need to be modified for other plateforms.'' == Web Server Installation == The Quattor server needs to run a Web server to serve profiles, kickstart configuration files and execute the CGI script at end of installation to change PXE boot to local disk. In addition, it is recommended (but not necessary) to use this Web server for serving RPMs. Web server installation requires nothing specific, just the configuration of a document root with enough space if you plan to serve RPMs and the configuration of CGIs. This Web server can be shared with other usages and you can use a specific virtual host instead of a dedicated server. Apache is the recommended Web server (installation instructions here refer to Apache) and it can be installed from the OS distribution. Note that for subversion http mode, Apache version 2 or above is needed. === Apache Recommended Settings === SCDB has no strong requirement concerning Apache configuration. It generally uses 3 distinct URLs for 3 different purposes : * Profiles : machine profiles are served by one specific URL shared by all machines. The files there are XML files produces by the PAN compiler when executing `ant deploy`. * Kickstart configuration files : this URL is used to store the Kickstart configuration file for each machines. These files are produced by `aii-shellfe --configure`. * RPM packages : RPMs are grouped in repositories, each repository has its own URL. This is a common setting to have one common parent URL for all repositories but this is not at all a requirement. Recommended setting for these 3 areas are : * Restrict access to profile and Kickstart configuration to IP adresses (or subnets) matching Quattor clients, as these files may contain sensitive information like encrypted passwords or MySQL passwords (cleartext). * Configure all these areas to ignore any `index.html` file and auto-indexing. This is particularly important for RPM repositories URLs, as presence of an `index.html` will prevent SCDB tools to get the list of RPMs in the repository. Recommended settings for these areas are : {{{ Options Indexes DirectoryIndex VeryUnlikelyDirectoryIndex.none AllowOverride None }}} == Subversion Server == There is no need for a Subversion server dedicated to Quattor. SCDB is just one repository from the Subversion point of view. If you already run a Subversion server, you can skip the installation part and go directly to the configuration part. === Subversion installation === There are many possible installation options for a Subversion server. The best is to install it as Apache module, anyway. There is no requirement for the Subversion server to run on a Linux machine, even if it is the installation option documented here. You can even choose to use a Subversion server outside of your site, if you think the network connection is good enough. If you need to install a Subversion server, the easiest is to install Apache and then retrieve the RPMs for Subversion from [http://subversion.tigris.org/project_packages.html Subversion site]. Don't forget to install the Apache module which is in a separate RPM. After installing, you have to configure the Subversion server. Look at Quattor installation guide on [http://quattor.org Quattor] web site. Quick setup: {{{ # Create SVN repository mkdir -p /var/svn/quattor svnadmin create /var/svn/quattor # Fetch the quattor specific post-commit hook wget --no-check-certificate "https://trac.lal.in2p3.fr/Quattor/browser/trunk/src/hooks/post-commit?format=raw" -O /var/svn/quattor/hooks/post-commit # Quattor deployment scripts (used by post-commit svn hook) mkdir -p /root/quattor/scripts wget --no-check-certificate "https://trac.lal.in2p3.fr/Quattor/browser/trunk/src/hooks/build-tag.pl?format=raw" -O /root/quattor/scripts/build-tag.pl }}} The {{{post-commit}}} file have to be edited. In particular, check for: {{{QUATTORSRV}}}, {{{DEPLOYSCRIPT}}}, {{{MAILER/SVNLOOK/SSH}}} and {{{NOTIFY}}} variables (everything should be self-explaining). ''Note to Michel: toutes les variables à modifier devraient être groupées au début du fichier.'' Also in {{{post-commit}}}, beware of the regular expression used to match a tag: it may be wrong for you, tune it as needed. One should also edit {{{build-tag.pl}}} file, look for {{{JAVA_HOME}}}, {{{$repo}}} and {{{$cache}}}. The SVN repository have to be accessed by {{{http(s):}}} method (not {{{file:}}}), this imply installation and configuration of {{{mod_dav_svn}}} for Apache. The SVN repository should belong to the identity that run the web server: {{{ chown -R apache:apache /var/svn/quattor }}} === Apache for subversion and package service === Files {{{/etc/httpd/conf.d/subversion.conf}}} and {{{/etc/httpd/conf.d/ssl.conf}}} (if using ssl) have to be edited and configured. In {{{/etc/http/conf/httpd.conf}}}, you may have to add the following lines to avoid a bug in the http interface of the rpm client. {{{ BrowserMatch "rpm/.*" nokeepalive force-response-1.0 }}} === Repository configuration === For Quattor, you need to create a repository with the standard structure inside it (or inside a branch) : * `trunk` : where you make the changes to your running configuration * `tags` : used by SCDB administration tool to do deployment * `branches` : for alternative developments For example: {{{ mkdir toto cd toto mkdir scdb mkdir scdb/trunk mkdir scdb/tags mkdir scdb/branches svn import . https://svn.server.tld/svn/quattor --message 'Initial repository layout' }}} Then, initial checkout will be: {{{ svn checkout https://svn.server.tld/svn/quattor/scdb }}} == DHCP and TFTPD installation == Install DHCPD and TFTPD server from OS distribution. Do a basic configuration of DHCPD server (name servers...). Template for dhcp configuration can be found in aii-server package, under {{{/usr/share/doc/aii-1.0.44/eg/dhcpd.conf}}}. Template for tftpd configuration (by xinetd at {{{/etc/xinetd.d/tftp}}}) can be found in aii-server package, under {{{/usr/share/doc/aii-1.0.44/eg/tftp.example}}}. Note that prefered location for quattor tftp installation is {{{/osinstall/nbp}}}, but it should work under {{{/tftpboot}}} as well. == Quattor Server == In addition to the base system installation, you need to install the following RPMs on a Quattor server where you want to use SCDB : * Java VM > 1.5.0 * Subversion client (preferably > 1.4) * cdb-sync * ncm-template * aii-server All but Java and SVN client can be download from http://quattorsrv.lal.in2p3.fr/packages/quattor/sl. Always use the last version, unless explicitly mentionned. You can also use APT or YUM from http://quattorsw.web.cern.ch/quattorsw/software/quattor. == SCDB Initialization == To start with SCDB, you first need to install a [http://subversion.tigris.org Subversion] server, an open source product. The http based repository access '''must''' be used for quattor, the standalone access wont work (limitation of the build script). After you have a Subversion server installed, you need to : * Create a Subversion repository that will be used for SCDB, if it doesn't exist yet, and associate this repository with a URL (this can involve modifying Apache configuration). There is no need to use a dedicated repository. E.g. : `http://svn.example.org/Quattor`. * Create a branch in this repository where SCDB will be stored, if the repository is not dedicated to SCDB. E.g. : `http://svn.example.org/Quattor/CDB`. * In this branch, create 2 branches `trunk` and `tags` (`tags` is managed by SCDB tools, all the actions you'll do later will be done in `trunk`. You can also create other branches for your conveniences (like `branches` but they are not used by standard tools). * Choose the QWG templates version that suit your needs and import [source:SCDB/tags/pro SCDB base] and QWG templates in directory that will become you working area. See [wiki:Download/QWGTemplates QWG download] for detailed instructions. The easiest is to download and use [source:templates/trunk/tools/check-compile.sh check-compile.sh] (use option `-h` to get the list of available options). For example, assuming you want to create a `cdb` sub-directory of your current directory and download QWG templates gLite-3.0.2-10 : {{{ check-compile.sh -d cdb /templates/tags/gLite-3.0.2-10 }}} * Change current directory to the working area, for example : {{{ cd cdb }}} * Checkout SCDB trunk (empty) in your SCDB working directory : {{{ svn co http://svn.example.org/Quattor/CDB/trunk . }}} * Configure the repository to ignore some files produced when compiling, using the following command : {{{ cat > /tmp/ignore <