Xen/KVM Virtualization Management Application
  • 日本語
  • English

Karesansui Wiki


Update Instructions


1. Contents


2. Users who are using SQLite with Karesansui 1.0.0 and Karesansui 1.0.1.

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.

Download URL

# rm -rf Karesansui
# tar zxvf karesansui-<version>-install-pack.tar.gz
# cd Karesansui


3. Check current database path

Get current Pysilhouette database path.

  • Get from the configuration file
    Look at the key "database.url" in /etc/opt/pysilhouette/silhouette.conf
Example)
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
  • In "Administrator Settings" screen
    Set "Password", and press "OK".
  • In "Database Settings" screen
    Uncheck "Initialize database", and input the new database path in "Pysilhouette database path", and press "OK".
Warning)
Uncheck "Initialize database", or you will lose your current database settings.
  • On "Confirmation" screen
    Press "OK".


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>
  • Put the path we got checked in the above section
    "3. Check current database path" into <old database path>.
  • <new database path> is available through some ways.
    • Get from 'karesansui-checkenv' output: Check the output message
      "Checking whether we are able to connect to database for XXXXX... of karesansui-checkenv.
    • Get from the configuration file
      Check the key "database.url" of /etc/opt/pysilhouette/silhouette.conf.
  • Database path format
SQLite : sqlite:////var/opt/karesansui/pysilhouette.db
MySQL : mysql://username:password@hostname:port/pysilhouette?charset=utf8
PostgreSQL : postgres://username:password@hostname:port/pysilhouette
Warning)
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


8. Restart Daemon
To make changes affect, restart the daemon processes.
# /etc/init.d/hde-lighttpd stop
# /etc/init.d/silhouetted restart
# /etc/init.d/hde-lighttpd start

3. Users who want to upgrade from Karesansui 1.0.x to 1.1.x.

  • Description

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.

Download URL

# rm -rf Karesansui
# tar zxvf karesansui-<version>-install-pack.tar.gz
# cd Karesansui


3. Update Karesansui

# ./karesansui-install

_*You must not choise the database initialization.*_


4. Installation Environment Check
Execute ./karesansui-checkenv to check if there are any errors.

# ./karesansui-checkenv


Also available in: HTML TXT