Target users for this document
Users who are using SQLite with 1.0.0 and 1.0.1.
Affected area
The job manager (Pysilhouette)
Issue which was fixed in 1.0.2
Installer was causing the job manager (Pysilhouette) to lookup SQLite database path, even the user specified other database path (like MySQL or PostgreSQL), so multi-host configuration was not supported.
1.0.2 fixes these problems, but some manual configuration are needed for updates.
1. Database Creation
Create database for the job manager (Pysilhouette).
Example)
For PostgreSQL
# createdb -U username -W pysilhouette --encoding=utf8
For MySQL
# mysql -u username -p -e 'CREATE DATABASE pysilhouette DEFAULT CHARACTER SET utf8;'
Important)
Create database with UTF-8 charsets.
2. Download the new package and deploy.
# rm -rf Karesansui # tar zxvf karesansui-<version>-install-pack.tar.gz # cd Karesansui
3. Check current database path
Get current Pysilhouette database path.
sqlite:////var/opt/pysilhouette/pysilhouette.db
4. Update Karesansui
Update Karesansui and change Pysilhouette database path.
Update Karesansui as the steps in the tutorial
# ./karesansui-install
Uncheck "Initialize database", or you will lose your current database settings.
5. Installation Environment Check
Execute ./karesansui-checkenv to check if there are any errors.
Check if the output message "Checking whether we are able to connect to database for XXXXX... " describes your new database path.
# ./karesansui-checkenv
6. Migrate Database
Copy SQLite database to MySQL or PostgreSQL database.
# cd /opt/pysilhouette/share/doc/pysilhouette-0.6.2/tool/ # export PYTHONPATH=/opt/hde/lib/python:/opt/karesansui/lib/python:/opt/pysilhouette/lib/python:$PYTHONPATH # ./sqlite2other.py --input=<old database path> --output=<new database path>
SQLite : sqlite:////var/opt/karesansui/pysilhouette.db MySQL : mysql://username:password@hostname:port/pysilhouette?charset=utf8 PostgreSQL : postgres://username:password@hostname:port/pysilhouetteWarning)
Take a memo of the outputted "copy num" number. We use it later. (copy num - xxx) sqlite2other.py only supports SQLite -> MySQL or SQLite -> PostgreSQL migration.Example)
# ./sqlite2other.py --input=sqlite:////var/opt/pysilhouette/pysilhouette.db --output=mysql://username:password@localhost/pysilhouette?charset=utf8 Cleanup Database [OK] copy num - 3
Information)
For details about database path format, consult the reference
7. Change Auto Increment Counter Value
Change the auto increment counter value of Pysilhouette.
Access Pysilhouette database an execute the SQL below.
Put the "copy-num" value we got above into <copy num value>.
For PostgreSQL:
select setval('jobgroup_id_seq', <copy num value>);
select setval('job_id_seq', <copy num value>);
Example)
# psql pysilhouette -U username -h localhost -c "select setval('jobgroup_id_seq', 3);"
# psql pysilhouette -U username -h localhost -c "select setval('job_id_seq' 3);"
For MySQL:
ALTER TABLE jobgroup AUTO_INCREMENT = <copy num value>;
ALTER TABLE job AUTO_INCREMENT = <copy num value>;
Example)
# mysql pysilhouette -u username -h localhost -p -e "ALTER TABLE jobgroup AUTO_INCREMENT = 3;"
# mysql pysilhouette -u username -h localhost -p -e "ALTER TABLE job AUTO_INCREMENT = 3;"
Information)# ./sqlite2other.py --input=<old database path> --output=<new database path> Cleanup Database [OK] copy num - 3 <-- "copy-num" value
# /etc/init.d/hde-lighttpd stop # /etc/init.d/silhouetted restart # /etc/init.d/hde-lighttpd start
In version 1.1, the path of some configuration files and disk image files has changed.
This document describes how to migrate these files and settings.
_*We recommend to back up the important data to other physical machine in advance.*_
1. Stop Daemon
Stop the daemon processes.# /etc/init.d/silhouetted stop # /etc/init.d/hde-lighttpd stop # /etc/init.d/hde-libvirtd stop # /etc/init.d/xend stop
2. Download the new package and deploy.
# rm -rf Karesansui # tar zxvf karesansui-<version>-install-pack.tar.gz # cd Karesansui
3. Update Karesansui
# ./karesansui-install
_*You must not choose the database initialization.*_
4. Installation Environment Check
Execute ./karesansui-checkenv to check if there are any errors.
# ./karesansui-checkenv
In version 2.0, the disk image files are stored on the disk volumes in storage pool.
This document describes how to migrate these files and settings.
_*We recommend to back up the important data to other physical machine in advance.*_
1. Shutdown all the domains gracefully
You need to stop domains by Karesansui's management console or executing command below.
# /opt/hde/bin/virsh shutdown <domain>
2. Stop Daemon
Stop the daemon processes.# /etc/init.d/silhouetted stop # /etc/init.d/hde-lighttpd stop # /etc/init.d/hde-libvirtd stop # /etc/init.d/xend stop (on system using xen-kernel)
3. Download the new package and deploy.
# rm -rf Karesansui # tar zxvf karesansui-<version>-install-pack.tar.gz # cd Karesansui
4. Update Karesansui
# ./karesansui-install
_*You must not choose the database initialization.*_
_*Whatever you choose, the database of pysilhouette will be initialized. If necessary, please back up the database.*_
5. Installation Environment Check
Execute ./karesansui-checkenv to check if there are any errors.
# ./karesansui-checkenv
6. Reboot Host
# shutdown -r now
Differences about paths between the previous version and this version
In version 2.0, each disk image file used by guest is stored on the disk volumes in storage pool.
1. Disk image file used by guest
1.1 path of version 1.1.x
/var/opt/hde/libvirt/domains/<domain_name>/images/<domain_name>.img
1.1 path of version 2.0.x
The disk volume file in libvirt's storage pool.
By default, the storage pool named 'default' will be created in ''/var/opt/hde/libvirt/domains''.
So after finishing upgrade from 1.1.x, volume files are created as an symbolik link to existant image files used by the previous version and named uuid.
# ls -ltr /var/opt/hde/libvirt/domains/[0-9]* lrwxrwxrwx 1 root kss 57 Jun 9 HH:MM /var/opt/hde/libvirt/domains/55236ff8-88bb-023f-1499-2f34c4f1b133 -> /var/opt/hde/libvirt/domains/foo/images/foo.img
This document describes how to migrate these files and settings.
_*We recommend to back up the important data to other physical machine in advance.*_
1. Shutdown all the domains gracefully
You need to stop domains by Karesansui's management console or executing command below.
# /opt/hde/bin/virsh shutdown <domain>
2. Stop Daemon
Stop the daemon processes.# /etc/init.d/silhouetted stop # /etc/init.d/hde-lighttpd stop # /etc/init.d/hde-libvirtd stop # /etc/init.d/xend stop (on system using xen-kernel)
3. Download the new package and deploy.
# rm -rf Karesansui # tar zxvf karesansui-<version>-install-pack.tar.gz # cd Karesansui
4. Update Karesansui
# ./karesansui-install
_*You must not choose the database initialization.*_
_*Whatever you choose, the database of pysilhouette will be initialized. If necessary, please back up the database.*_
5. Installation Environment Check
Execute ./karesansui-checkenv to check if there are any errors.
# ./karesansui-checkenv
6. Reboot Host
# shutdown -r now