{"id":404,"date":"2017-02-15T14:05:39","date_gmt":"2017-02-15T03:05:39","guid":{"rendered":"https:\/\/icicimov.com\/blog\/?p=404"},"modified":"2017-02-23T18:09:01","modified_gmt":"2017-02-23T07:09:01","slug":"openattic-2-node-cluster-setup","status":"publish","type":"post","link":"https:\/\/icicimov.com\/blog\/?p=404","title":{"rendered":"OpenATTIC 2-node cluster setup"},"content":{"rendered":"<p>[serialposts]<\/p>\n<p><a href=\"http:\/\/openattic.org\">OpenATTIC<\/a> is an opensource converged storage that I think has a great potential to become a unified SDS for virtualization platforms. It offers features like CIFS, NFS, iSCSI and CEPH storage backends, mirrored volumes via DRBD and support for LVM, ZFS, XFS and Btrfs just to mention some.<\/p>\n<p>Test setup is on two identical Ubuntu-14-04 VM&#8217;s, <code>oattic01<\/code> and <code>oattic02<\/code>.<\/p>\n<pre><code>root@oattic01:~# lsb_release -a\nNo LSB modules are available.\nDistributor ID: Ubuntu\nDescription:    Ubuntu 14.04.5 LTS\nRelease:    14.04\nCodename:   trusty\n<\/code><\/pre>\n<p>Since I want to run a cluster of two nodes I need to configure Highly Available PostgreSQL DB first for OpenATTIC (oA for short) to store its configuration into. This is going to be the first part of the setup and the second part will be the installation and setup of the oA it self.<\/p>\n<p>Packages for <code>version 1.2.1<\/code> downloaded from OpenATTIC official site and ready for install, I want to test most of the modules available hence have downloaded all\/most of the deb packages available:<\/p>\n<pre><code>root@oattic01:~# ls -1 openattic* | sort\nopenattic_1.2.1-1_all.deb\nopenattic-base_1.2.1-1_all.deb\nopenattic-module-apt_1.2.1-1_all.deb\nopenattic-module-btrfs_1.2.1-1_all.deb\nopenattic-module-cron_1.2.1-1_all.deb\nopenattic-module-drbd_1.2.1-1_all.deb\nopenattic-module-ftp_1.2.1-1_all.deb\nopenattic-module-http_1.2.1-1_all.deb\nopenattic-module-ipmi_1.2.1-1_all.deb\nopenattic-module-lio_1.2.1-1_all.deb\nopenattic-module-lvm_1.2.1-1_all.deb\nopenattic-module-mailaliases_1.2.1-1_all.deb\nopenattic-module-mdraid_1.2.1-1_all.deb\nopenattic-module-nagios_1.2.1-1_all.deb\nopenattic-module-nfs_1.2.1-1_all.deb\nopenattic-module-samba_1.2.1-1_all.deb\nopenattic-module-zfs_1.2.1-1_all.deb\nopenattic-pgsql_1.2.1-1_all.deb\n<\/code><\/pre>\n<p>To find some package dependencies before we install we can run:<\/p>\n<pre><code>root@oattic02:~# for i in openattic-module-*.deb; do dpkg -I $i | grep -i depends 2&gt; \/dev\/null; done\n Depends: python-apt, openattic-base\n Depends: openattic-base, btrfs-tools\n Depends: cron, openattic-base\n Depends: openattic-module-lvm, drbd8-utils\n Depends: openattic-base, openattic-module-samba, proftpd-basic (&gt;= 1.3.3), proftpd-mod-winbind\n Depends: openattic-base, apache2\n Depends: ipmitool, openattic-base\n Depends: openattic-base, python-rtslib (&gt;&gt; 2.1-2), lio-utils\n Depends: openattic-base, lvm2, parted, openattic-module-cron, file, udisks\n Depends: openattic-base, mail-transport-agent\n Depends: openattic-base, mdadm\n Depends: python (&gt;= 2.6), python-imaging, python-numpy, openattic-base, bc, adduser, nagios3-core, nagios-plugins-standard, nagios-plugins-basic, pnp4nagios-bin, rrdtool\n Depends: openattic-base, nfs-kernel-server\n Depends: openattic-base, samba, samba-common-bin, winbind, libnss-winbind, krb5-user | heimdal-clients, libpam-krb5\n Depends: openattic-base, debian-zfs | ubuntu-zfs\n  checksums. It depends on zfsonlinux, the native Linux port of ZFS.\n<\/code><\/pre>\n<p>So first installed the following packages:<\/p>\n<pre><code>root@oattic01:~# aptitude install nagios3-core nfs-kernel-server postfix php-xml-rpc2 \\\nntp vlan ifenslave-2.6 lvm2 udisks python-dbus python-gobject python-m2crypto python-rtslib \\\npython-numpy python-netifaces python-netaddr btrfs-tools ipmitool ubuntu-zfs pnp4nagios-bin \\\npython-pyudev libapache2-mod-wsgi drbd8-utils lio-utils mdadm samba winbind libnss-winbind \\\ndbconfig-common postgresql\n<\/code><\/pre>\n<p>after which I installed the OpenATTIC packages:<\/p>\n<pre><code>root@oattic01:~# dpkg -i openattic*.deb\nSelecting previously unselected package openattic.\n(Reading database ... 146951 files and directories currently installed.)\nPreparing to unpack openattic_1.2.1-1_all.deb ...\nUnpacking openattic (1.2.1-1) ...\nSelecting previously unselected package openattic-base.\nPreparing to unpack openattic-base_1.2.1-1_all.deb ...\nopenattic:x:105:112::\/var\/lib\/openattic:\/bin\/bash\nThe user `www-data' is already a member of `openattic'.\nThe user `openattic' is already a member of `www-data'.\nUnpacking openattic-base (1.2.1-1) ...\nSelecting previously unselected package openattic-module-apt.\nPreparing to unpack openattic-module-apt_1.2.1-1_all.deb ...\nUnpacking openattic-module-apt (1.2.1-1) ...\nSelecting previously unselected package openattic-module-btrfs.\nPreparing to unpack openattic-module-btrfs_1.2.1-1_all.deb ...\nUnpacking openattic-module-btrfs (1.2.1-1) ...\nSelecting previously unselected package openattic-module-cron.\nPreparing to unpack openattic-module-cron_1.2.1-1_all.deb ...\nUnpacking openattic-module-cron (1.2.1-1) ...\nSelecting previously unselected package openattic-module-drbd.\nPreparing to unpack openattic-module-drbd_1.2.1-1_all.deb ...\nUnpacking openattic-module-drbd (1.2.1-1) ...\nSelecting previously unselected package openattic-module-ftp.\nPreparing to unpack openattic-module-ftp_1.2.1-1_all.deb ...\nUnpacking openattic-module-ftp (1.2.1-1) ...\nSelecting previously unselected package openattic-module-http.\nPreparing to unpack openattic-module-http_1.2.1-1_all.deb ...\nUnpacking openattic-module-http (1.2.1-1) ...\nSelecting previously unselected package openattic-module-ipmi.\nPreparing to unpack openattic-module-ipmi_1.2.1-1_all.deb ...\nUnpacking openattic-module-ipmi (1.2.1-1) ...\nSelecting previously unselected package openattic-module-lio.\nPreparing to unpack openattic-module-lio_1.2.1-1_all.deb ...\nUnpacking openattic-module-lio (1.2.1-1) ...\nSelecting previously unselected package openattic-module-lvm.\nPreparing to unpack openattic-module-lvm_1.2.1-1_all.deb ...\nUnpacking openattic-module-lvm (1.2.1-1) ...\nSelecting previously unselected package openattic-module-mailaliases.\nPreparing to unpack openattic-module-mailaliases_1.2.1-1_all.deb ...\nUnpacking openattic-module-mailaliases (1.2.1-1) ...\nSelecting previously unselected package openattic-module-mdraid.\nPreparing to unpack openattic-module-mdraid_1.2.1-1_all.deb ...\nUnpacking openattic-module-mdraid (1.2.1-1) ...\nSelecting previously unselected package openattic-module-nagios.\nPreparing to unpack openattic-module-nagios_1.2.1-1_all.deb ...\nUnpacking openattic-module-nagios (1.2.1-1) ...\nSelecting previously unselected package openattic-module-nfs.\nPreparing to unpack openattic-module-nfs_1.2.1-1_all.deb ...\nUnpacking openattic-module-nfs (1.2.1-1) ...\nSelecting previously unselected package openattic-module-samba.\nPreparing to unpack openattic-module-samba_1.2.1-1_all.deb ...\nUnpacking openattic-module-samba (1.2.1-1) ...\nSelecting previously unselected package openattic-module-zfs.\nPreparing to unpack openattic-module-zfs_1.2.1-1_all.deb ...\nUnpacking openattic-module-zfs (1.2.1-1) ...\nSelecting previously unselected package openattic-pgsql.\nPreparing to unpack openattic-pgsql_1.2.1-1_all.deb ...\nUnpacking openattic-pgsql (1.2.1-1) ...\nSetting up openattic-pgsql (1.2.1-1) ...\ndbconfig-common: writing config to \/etc\/dbconfig-common\/openattic-pgsql.conf\ncreating postgres user openatticpgsql:  already exists.\nresetting password:  success.\ncreating database openatticpgsql: already exists.\ndbconfig-common: flushing administrative password\nSetting up openattic-base (1.2.1-1) ...\n * Reloading web server apache2 * \nProcessing triggers for ureadahead (0.100.0-16) ...\nSetting up openattic-module-cron (1.2.1-1) ...\nSetting up openattic-module-http (1.2.1-1) ...\n * Reloading web server apache2 * \nSetting up openattic-module-ipmi (1.2.1-1) ...\nSetting up openattic-module-lio (1.2.1-1) ...\nSetting up openattic-module-lvm (1.2.1-1) ...\nSetting up openattic-module-mailaliases (1.2.1-1) ...\nSetting up openattic-module-mdraid (1.2.1-1) ...\nSetting up openattic-module-nagios (1.2.1-1) ...\nSetting up openattic-module-nfs (1.2.1-1) ...\n * Exporting directories for NFS kernel daemon...                                                                                                                                                            [ OK ] \n * Starting NFS kernel daemon                                                                                                                                                                                [ OK ] \nSetting up openattic-module-samba (1.2.1-1) ...\nSetting up openattic-module-zfs (1.2.1-1) ...\nSetting up openattic-module-apt (1.2.1-1) ...\nSetting up openattic-module-btrfs (1.2.1-1) ...\nSetting up openattic-module-drbd (1.2.1-1) ...\nSetting up openattic-module-ftp (1.2.1-1) ...\nSetting up openattic (1.2.1-1) ...\nProcessing triggers for man-db (2.6.7.1-1ubuntu1) ...\n<\/code><\/pre>\n<p>After installing all needed software on both servers we create the <code>\/etc\/openattic\/database.ini<\/code> file as shown below:<\/p>\n<pre><code>[default]\nengine   = django.db.backends.postgresql_psycopg2\nname     = openatticpgsql\nuser     = openatticpgsql\npassword = password\nhost     = 10.20.1.200 \nport     =\n<\/code><\/pre>\n<p>The important bit is setting the host parameter to the VIP of the PostgreSQL cluster <code>10.20.1.200<\/code> as per installation in Part 1. Then we run the <code>oaconfig install<\/code> utility to finish the setup (the output is from oattic02 node install):<\/p>\n<pre><code>root@oattic02:~# oaconfig install\nsystemd is running (pid 21865).\n * Stopping openATTIC systemd                             [ OK ] \n * Starting openATTIC systemd                             [ OK ] \n * Stopping openATTIC rpcd  No \/usr\/bin\/python found running; none killed.           [ OK ]\n * Starting openATTIC rpcd                                [ OK ] \n * Reloading web server apache2 \n * \nCreating tables ...\nInstalling custom SQL ...\nInstalling indexes ...\nInstalled 65 object(s) from 2 fixture(s)\n * Stopping openATTIC systemd                              [ OK ] \n * Starting openATTIC systemd                              [ OK ] \n * Stopping openATTIC rpcd                                 [ OK ] \n * Starting openATTIC rpcd                                 [ OK ] \n * Reloading web server apache2 \n * \nWe have an admin already, not creating default user.\nProFTPD is started in standalone mode, currently running.\nmd5sum: \/var\/www\/index.html: No such file or directory\nAdding lo\nAdding  {'peer': '127.0.0.1', 'netmask': '255.0.0.0', 'addr': '127.0.0.1'}\nAdding  {'netmask': 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', 'addr': '::1'}\nAdding eth1\nAdding  {'broadcast': '10.10.1.255', 'netmask': '255.255.255.0', 'addr': '10.10.1.17'}\nAdding eth2\nAdding  {'broadcast': '10.20.1.255', 'netmask': '255.255.255.0', 'addr': '10.20.1.18'}\nAdding  {'broadcast': '10.20.1.255', 'netmask': '255.255.255.0', 'addr': '10.20.1.200'}\nAdding eth0\nAdding  {'broadcast': '192.168.0.255', 'netmask': '255.255.255.0', 'addr': '192.168.0.135'}\nAdding  {'broadcast': '192.168.0.255', 'netmask': '255.255.255.0', 'addr': '192.168.0.241'}\nAdding  {'broadcast': '192.168.0.255', 'netmask': '255.255.255.0', 'addr': '192.168.0.242'}\nAdding Volume Group vg1\nAdding Service 'Current Load'\nAdding Service 'Current Users'\nAdding Service 'Disk Space'\nAdding Service 'HTTP'\nAdding Service 'SSH'\nAdding Service 'Total Processes'\nAdding Service 'openATTIC RPCd'\nAdding Service 'openATTIC Systemd'\nCompleted successfully.\n<\/code><\/pre>\n<p>Then copy the oA Apache config files to the proper location for Apache 2.x version:<\/p>\n<pre><code>root@oattic01:~# cp \/etc\/apache2\/conf.d\/openattic \/etc\/apache2\/conf-available\/openattic.conf\nroot@oattic01:~# cp \/etc\/apache2\/conf.d\/openattic-volumes \/etc\/apache2\/conf-available\/openattic-volumes.conf\nroot@oattic01:~# cp \/etc\/apache2\/conf.d\/pnp4nagios.conf \/etc\/apache2\/conf-available\/\n<\/code><\/pre>\n<p>then enable them:<\/p>\n<pre><code>root@oattic01:~# a2enconf openattic openattic-volumes pnp4nagios\nEnabling conf openattic.\nEnabling conf openattic-volumes.\nEnabling conf pnp4nagios.\nTo activate the new configuration, you need to run:\n  service apache2 reload\n<\/code><\/pre>\n<p>and reload Apache:<\/p>\n<pre><code>root@oattic01:~# service apache2 reload\n * Reloading web server apache2 * \n<\/code><\/pre>\n<p>after we finish the procedure on both nodes we are able to access the web UI at <code>http:\/\/oattic01<\/code> and <code>http:\/\/oattic02<\/code> (read about issues and workarounds below though).<\/p>\n<p>Next (execute on one server only) set password for the <code>openattic<\/code> user, I set it to openattic:<\/p>\n<pre><code>root@oattic01:~# oaconfig changepassword\nChanging password for user 'openattic'\nPassword: \nPassword (again): \nPassword changed successfully for user 'openattic'\nroot@oattic01:~# \n<\/code><\/pre>\n<p>The list of packages installed:<\/p>\n<pre><code>root@oattic02:~# dpkg -l | grep openatt\nii  openattic                            1.2.1-1                              all          Comprehensive storage management system\nii  openattic-base                       1.2.1-1                              all          Basic requirements for openATTIC\nii  openattic-module-apt                 1.2.1-1                              all          APT module for openATTIC\nii  openattic-module-btrfs               1.2.1-1                              all          BTRFS module for openATTIC\nii  openattic-module-cron                1.2.1-1                              all          Cron module for openATTIC\nii  openattic-module-drbd                1.2.1-1                              all          DRBD module for openATTIC\nii  openattic-module-ftp                 1.2.1-1                              all          FTP module for openATTIC\nii  openattic-module-http                1.2.1-1                              all          HTTP module for openATTIC\nii  openattic-module-ipmi                1.2.1-1                              all          IPMI module for openATTIC\nii  openattic-module-lio                 1.2.1-1                              all          LIO module for openATTIC\nii  openattic-module-lvm                 1.2.1-1                              all          LVM module for openATTIC\nii  openattic-module-mailaliases         1.2.1-1                              all          MailAliases module for openATTIC\nii  openattic-module-mdraid              1.2.1-1                              all          MDRAID module for openATTIC\nii  openattic-module-nagios              1.2.1-1                              all          Nagios module for openATTIC\nii  openattic-module-nfs                 1.2.1-1                              all          NFS module for openATTIC\nii  openattic-module-samba               1.2.1-1                              all          Samba module for openATTIC\nii  openattic-module-zfs                 1.2.1-1                              all          ZFS module for openATTIC\nii  openattic-pgsql                      1.2.1-1                              all          PGSQL database for openATTIC\n<\/code><\/pre>\n<p>In case we have changed something or installed a new module after the initial install we can always re-run <code>oaconfig install<\/code> to bring the system up-to-date.<\/p>\n<h1>Issues and workarounds<\/h1>\n<p>Initially the oaconfig command failed due to the <code>openattic_rpcd<\/code> daemon not being able to start because of the log file <code>\/var\/log\/openattic_rpcd<\/code> permissions, the installer created this file with <code>root<\/code> ownership for some reason. Changing the ownership:<\/p>\n<pre><code>root@[ALL]:~# chown openattic\\: \/var\/log\/openattic_rpcd\n<\/code><\/pre>\n<p>solved the problem and the next run of <code>oaconfig install<\/code> was successful.<\/p>\n<p>At the end I got <code>Bad Request (400)<\/code> error when tried to access the web UI. Adding <code>ALLOWED_HOSTS<\/code> parameter to <code>\/etc\/openattic\/settings.py<\/code> solves the problem for Django-1.6.11 and Python-2.7. In my case I just added:<\/p>\n<pre><code>ALLOWED_HOSTS = [ '*' ]\n<\/code><\/pre>\n<p>to <code>\/etc\/openattic\/settings.py<\/code> and restarted Apache.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[serialposts] OpenATTIC is an opensource converged storage that I think has a great potential to become a unified SDS for virtualization platforms. It offers features like CIFS, NFS, iSCSI and CEPH storage backends, mirrored volumes via DRBD and support for&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[39],"class_list":["post-404","post","type-post","status-publish","format-standard","hentry","category-storage","tag-openattic"],"_links":{"self":[{"href":"https:\/\/icicimov.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icicimov.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icicimov.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icicimov.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icicimov.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=404"}],"version-history":[{"count":3,"href":"https:\/\/icicimov.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/404\/revisions"}],"predecessor-version":[{"id":407,"href":"https:\/\/icicimov.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/404\/revisions\/407"}],"wp:attachment":[{"href":"https:\/\/icicimov.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icicimov.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icicimov.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}