This section describes the procedure to update an Ophidia single-node instance from v1.4 to v1.5. In order to make the process as smooth as possible, ensure to read carefully and apply in the order specified all the point provided below.
The first step to be performed is to stop the processes of the running services in particular the oph_server and the oph_io_server. For example, on CentOS you can run the following:
pkill oph_server pkill oph_io_server
With respect to version v1.4, a new version of gSoap library is required. In particular, you need to download and install gSOAP 2.8.76 from http://sourceforge.net/projects/gsoap2/files/gSOAP/
unzip gsoap-2.8.76.zip cd gsoap-2.8 ./configure --prefix=/usr/local/ophidia/extra make make install
You can update both from source or from binaries (RPMs and DEBs) according to how you installed Ophidia the first time:
Before proceeding with update of the Ophidia packages, you should make a backup copy of the configuration files in order to preserve the current configuration. In particular, the following files and folders:
You might also consider to backup the following log files:
In order to update from source code you should first download the packages or clone the git repositories. Please refer to the specific installation from source pages:
After the installation of the new version, restore the configuration files previously backed up and revise the changes with respect to the new version.
First download the latest version of RPMs from https://download.ophidia.cmcc.it/rpm/1.5/ and then run the following command to update from the previous version. Note that the configuration files will not be overwritten by default so you need to manually extend them as reported in the following steps (a new file called *.rpmsave or *.rpmnew will be created in the folder it the older version has been previously update).
sudo yum update ophidia-*.x86_64.rpm sudo chown -R ophidia:ophidia /usr/local/ophidia/ sudo chown -R ophidia:ophidia /var/www/html/ophidia/
First download the latest version of RPMs from https://download.ophidia.cmcc.it/deb/1.5/ and then run the following command to update from the previous version. Note that the configuration files will not be overwritten by default so you need to manually extend them as reported in the following steps. The update command will require to check the files before updating the files.
sudo dpkg -i ophidia-*_amd64.deb sudo chown -R ophidia:ophidia /usr/local/ophidia/ sudo chown -R ophidia:ophidia /var/www/html/ophidia/
After the package update, reload the primitives on the MySQL server used for Ophidia. Run following commands:
sudo cp /usr/local/ophidia/oph-cluster/oph-primitives/lib/liboph_*.so /usr/lib64/mysql/plugin mysql -u root -p mysql < <$oph-ioserver-prefix>/etc/create_func.sql
In case of errors in the last command, simply try to rerun it again. Then, restart the MySQL server:
sudo service mysql restart
In order to update the PyOphidia python module you can simply run the following:
pip install PyOphidia --upgrade
After the installation of the new version, restore the configuration files (and the folders) backed up previosly. In particular, restore the following files and folders:
With respect to version v1.4, no new argument has been added to the configuration files, so you can simply keep the previous version.
Once all the previous steps have been performed you can proceed with the OphidiaDB update.
Before performing the database update, it is highly recommended to take a full backup of the OphidiaDB database.
With respect to v1.4 of the Ophidia platform some extensions and updates to various OphidiaDB tables have been made. In particular, you need to run the following update queries:
DROP TRIGGER TRIGGER_after_insert_datacube; DROP TRIGGER TRIGGER_before_delete_datacube; ALTER TABLE dbmsinstance DROP COLUMN fstype; ALTER TABLE dbmsinstance DROP COLUMN status; ALTER TABLE datacube DROP COLUMN dbmsxhost; ALTER TABLE datacube DROP COLUMN dbxdbms; ALTER TABLE container DROP COLUMN hidden; ALTER TABLE host CHANGE COLUMN `datacubecount` `importcount` int(10) unsigned NOT NULL DEFAULT 0; ALTER TABLE hashost CHANGE COLUMN `datacubecount` `importcount` int(10) unsigned NOT NULL DEFAULT 0; ALTER TABLE user ADD COLUMN `maxhosts` int(10) unsigned NULL DEFAULT 0; ALTER TABLE partitioned ADD CONSTRAINT UNIQUE KEY `db_datacube` (`iddbinstance`, `iddatacube`); ALTER TABLE dimension ADD CONSTRAINT UNIQUE KEY `container_dimensionname` (`idcontainer`, `dimensionname`); ALTER TABLE cubehasdim ADD CONSTRAINT UNIQUE KEY `datacube_dimensioninstance` (`iddatacube`, `iddimensioninstance`); ALTER TABLE container ADD CONSTRAINT UNIQUE KEY `folder_containername` (`idfolder`, `containername`); ALTER TABLE metadatainstance ADD CONSTRAINT UNIQUE KEY `datacube_metadatakey` (`iddatacube`, `idkey`); CREATE TABLE `imported` ( `idimported` int(10) unsigned NOT NULL AUTO_INCREMENT, `idhost` int(10) unsigned NOT NULL, `iddatacube` int(10) unsigned NOT NULL, PRIMARY KEY (`idimported`), UNIQUE KEY `host_datacube` (`idhost`, `iddatacube`), KEY `idhost` (`idhost`), CONSTRAINT `idhost_i` FOREIGN KEY (`idhost`) REFERENCES `host` (`idhost`) ON DELETE CASCADE ON UPDATE CASCADE, KEY `iddatacube` (`iddatacube`), CONSTRAINT `iddatacube_i` FOREIGN KEY (`iddatacube`) REFERENCES `datacube` (`iddatacube`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER TRIGGER_before_delete_datacube BEFORE DELETE ON datacube FOR EACH ROW BEGIN UPDATE IGNORE host SET importcount = IF(importcount > 0, importcount - 1, 0) where idhost in (select distinct(idhost) from imported where imported.iddatacube = OLD.iddatacube); END */;; DELIMITER ; INSERT INTO imported (idhost, iddatacube) (SELECT host.idhost, iddatacube FROM partitioned INNER JOIN dbinstance ON partitioned.iddbinstance = dbinstance.iddbinstance INNER JOIN dbmsinstance ON dbmsinstance.iddbmsinstance = dbinstance.iddbmsinstance INNER JOIN host ON host.idhost = dbmsinstance.idhost);
Check the OphidiaDB configuration page for additional details.
Finally restart the Ophidia services:
su - ophidia /usr/local/ophidia/oph-cluster/oph-io-server/bin/oph_io_server -i 1 > /dev/null 2>&1 & /usr/local/ophidia/oph-server/bin/oph_server 2>&1 > /dev/null < /dev/null &
Now you are ready to use this brand new Ophidia version!