www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

Installation Guide

Virtuoso on All platforms Commmon Specifics
Virtuoso for Windows
Virtuoso for Linux (Enterprise Edition)
Virtuoso for Unix (Enterprise Edition)
Virtuoso for Unix (Personal Edition)
Virtuoso for Mac OS X
OpenLink License Management
Virtuoso ADO.Net Data Grid Form Application
Using Visual Studio 2008 to Build an Entity Frameworks based Windows Form Application
Using Visual Studio 2008 to Build an ADO.NET Data Services based Application
Windows Form Application for accessing Virtuoso RDF data via SPASQL using the Virtuoso ADO.Net Provider
Creating a Web Browser Application to Access RDF Data Using The Virtuoso ADO.Net Provider
Creating a Silverlight Application to consume the service
Creating A Simple .NET RIA Services Application To Display Data From Virtuoso
Creating a .Net RIA Services Application That Will Update Virtuoso Data
Cluster Installation and Config
Creating New Cluster Setup Backup and Restore Cluster Configuration Troubleshooting Tips

2.16. Cluster Installation and Config

2.16.1. Creating New Cluster Setup

  1. Run the Virtuoso 6 Unix ( MacOsX) installer to perform a default installation:
    $ tar xvf virtuoso-universal-server-6.1.tar
    x install.sh
    x universal-server.taz
    $ sh install.sh
    
    - Extracting Virtuoso Universal Server v6.1
    
    - Creating default environment settings
    
    - Creating default database settings
    Configuring: database
    Creating directory $VIRTUOSO_HOME/database/backup
    Installing new virtuoso.ini in $VIRTUOSO_HOME/database
    Installing new php.ini in $VIRTUOSO_HOME/database
    Creating symlink to $VIRTUOSO_HOME/bin/virtuoso-iodbc-t
    
    - Registering ODBC drivers
    
    - Registering .NET provider for Mono
    
    - Installing VAD packages in database (this can take some time)
    
    - Checking where license should be stored
    
    - Starting OpenLink License Manager
    
    - Checking for initial Virtuoso license
    
    - Starting Virtuoso server instance
    
    - Finalizing installation
    
    
    This concludes the first part of the installation.
    
    
    - Attempting to start browser
    
    Please start a browser manually and open the following URL to finalize
    the installation process:
    
         http://cname:8890/install/
    
    
    Installation completed
    $
    
  2. Determine how many nodes you want to start the cluster with: 2, 3, 4, 5, 6, 7, 8 etc. Note: the number of the nodes should be >= 2
  3. Setup Virtuoso environment and stop default database:
    $ . ./virtuoso-environment.sh
    $ virtuoso-stop.sh
    Shutting down Virtuoso instance in [database]
    $
    
  4. Optionally remove the default database such that is does not get started with the cluster:
    rm  -rf database
    
  5. Full list of supported options for the script "virtuoso-mkcluster.sh":
      -cluster-size       Number of nodes in cluster
      -cluster-node       Node number in a cluster
      -cluster-port       Base portnumer for cluster
      -cluster-ipc-port   Base portnumer for cluster IPC
      -cluster_size       Size of the cluster
      -virtuoso_home      Virtuoso home path
    
  6. Run the virtuoso-mkcluster.sh script to create the cluster, note the default number of nodes is 4, but this can be changed by setting the environment variable CLUSTER_SIZE to the required number of nodes to be created before running the script:
    $ virtuoso-mkcluster.sh
    Configuring cluster node: 1/4
    
    Creating directory $VIRTUOSO_HOME/cluster_01
    Creating directory $VIRTUOSO_HOME/cluster_01/backup
    Creating directory $VIRTUOSO_HOME/cluster_01/logs
    Installing new virtuoso.ini in $VIRTUOSO_HOME/cluster_01
    Installing new php.ini in $VIRTUOSO_HOME/cluster_01
    Creating symlink to $VIRTUOSO_HOME/bin/virtuoso-iodbc-t
    Configuring cluster node: 2/4
    
    Creating directory $VIRTUOSO_HOME/cluster_02
    Creating directory $VIRTUOSO_HOME/cluster_02/backup
    Installing new virtuoso.ini in $VIRTUOSO_HOME/cluster_02
    Removing unneeded sections from virtuoso.ini
    Creating symlink to $VIRTUOSO_HOME/bin/virtuoso-iodbc-t
    Configuring cluster node: 3/4
    
    Creating directory $VIRTUOSO_HOME/cluster_03
    Creating directory $VIRTUOSO_HOME/cluster_03/backup
    Installing new virtuoso.ini in $VIRTUOSO_HOME/cluster_03
    Removing unneeded sections from virtuoso.ini
    Creating symlink to $VIRTUOSO_HOME/bin/virtuoso-iodbc-t
    Configuring cluster node: 4/4
    
    Creating directory $VIRTUOSO_HOME/cluster_04
    Creating directory $VIRTUOSO_HOME/cluster_04/backup
    Installing new virtuoso.ini in $VIRTUOSO_HOME/cluster_04
    Removing unneeded sections from virtuoso.ini
    Creating symlink to $VIRTUOSO_HOME/bin/virtuoso-iodbc-t
    $
    
  7. For each of the cluster_XX directories created edit the cluster.ini file and set the HostXX parameter to the hostname:portno to be used by the cluster nodes for internal communication.
    $ more cluster_01/cluster.ini
    [Cluster]
    Threads             = 20
    Master              = Host1
    ThisHost            = Host1
    ReqBatchSize        = 10000
    BatchesPerRPC       = 4
    BatchBufferBytes    = 20000
    LocalOnly           = 2
    MaxKeepAlivesMissed = 1000
    Host1               = hostname:22201
    Host2               = hostname:22202
    Host3               = hostname:22203
    Host4               = hostname:22204
    MaxHosts            = 5
    $ more cluster_02/cluster.ini
    [Cluster]
    Threads             = 20
    Master              = Host1
    ThisHost            = Host2
    ReqBatchSize        = 10000
    BatchesPerRPC       = 4
    BatchBufferBytes    = 20000
    LocalOnly           = 2
    MaxKeepAlivesMissed = 1000
    Host1               = hostname:22201
    Host2               = hostname:22202
    Host3               = hostname:22203
    Host4               = hostname:22204
    MaxHosts            = 5
    $ more cluster_03/cluster.ini
    [Cluster]
    Threads             = 20
    Master              = Host1
    ThisHost            = Host3
    ReqBatchSize        = 10000
    BatchesPerRPC       = 4
    BatchBufferBytes    = 20000
    LocalOnly           = 2
    MaxKeepAlivesMissed = 1000
    Host1               = hostname:22201
    Host2               = hostname:22202
    Host3               = hostname:22203
    Host4               = hostname:22204
    MaxHosts            = 5
    $ more cluster_04/cluster.ini
    [Cluster]
    Threads             = 20
    Master              = Host1
    ThisHost            = Host4
    ReqBatchSize        = 10000
    BatchesPerRPC       = 4
    BatchBufferBytes    = 20000
    LocalOnly           = 2
    MaxKeepAlivesMissed = 1000
    Host1               = hostname:22201
    Host2               = hostname:22202
    Host3               = hostname:22203
    Host4               = hostname:22204
    MaxHosts            = 5
    $
    
  8. Start the cluster using the standard virtuoso-start.sh script which automatically detects the number for nodes to be started:
    $ virtuoso-start.sh
    Starting Virtuoso instance in [cluster_01]
    Starting Virtuoso instance in [cluster_02]
    Starting Virtuoso instance in [cluster_03]
    Starting Virtuoso instance in [cluster_04]
    $
    
  9. The default SQL port of the master node is 12201, as indicated in the virtuoso.ini file of the cluster_01 directory, and can then be used for connecting to the newly created cluster and check its status to ensure all nodes are online:
    $ isql 12201
    Connected to OpenLink Virtuoso
    Driver: 06.01.3127 OpenLink Virtuoso ODBC Driver
    OpenLink Interactive SQL (Virtuoso), version 0.9849b.
    Type HELP; for help and EXIT; to exit.
    SQL> status ('cluster');
    REPORT
    VARCHAR
    _______________________________________________________________________________
    
    Cluster 4 nodes, 4 s. 1 m/s 0 KB/s  0% cpu 0%  read 0% clw threads 1r 0w 0i buffers 2981 0 d 0 w 0 pfs
    
    1 Rows. -- 7 msec.
    SQL> cl_ping(1,500, 1000);
    
    Done. -- 7 msec.
    SQL> cl_ping(2,500, 1000);
    
    Done. -- 52 msec.
    SQL> cl_ping(3,500, 1000);
    
    Done. -- 60 msec.
    SQL> cl_ping(4,500, 1000);
    
    Done. -- 51 msec.
    SQL>
    
  10. To split the node across across physical machines for better performance and scalability, simply perform a parallel Virtuoso installation on the additional physical machines and move the cluster nodes required to the designated machine. Example, for the default 4 node cluster to be split across two identical machines it would make sense to split 2 nodes across each machine, thus you would move say the cluster_03 and cluster_04 directory nodes to the new machine (removing them from the original). The cluster.ini file on each node would then need to be updated to set the HostXX parameters to point to the new locations for nodes 03 and 04:
    Machine 1 (hostname1)
    
    $ more cluster_01/cluster.ini
    [Cluster]
    Threads             = 20
    Master              = Host1
    ThisHost            = Host1
    ReqBatchSize        = 10000
    BatchesPerRPC       = 4
    BatchBufferBytes    = 20000
    LocalOnly           = 2
    MaxKeepAlivesMissed = 1000
    Host1               = hostname1:22201
    Host2               = hostname1:22202
    Host3               = hostname2:22203
    Host4               = hostname2:22204
    MaxHosts            = 5
    $ more cluster_02/cluster.ini
    [Cluster]
    Threads             = 20
    Master              = Host1
    ThisHost            = Host2
    ReqBatchSize        = 10000
    BatchesPerRPC       = 4
    BatchBufferBytes    = 20000
    LocalOnly           = 2
    MaxKeepAlivesMissed = 1000
    Host1               = hostname1:22201
    Host2               = hostname1:22202
    Host3               = hostname2:22203
    Host4               = hostname2:22204
    MaxHosts            = 5
    $
    
    Machine 2 (hostname2)
    
    $ more cluster_03/cluster.ini
    [Cluster]
    Threads             = 20
    Master              = Host1
    ThisHost            = Host3
    ReqBatchSize        = 10000
    BatchesPerRPC       = 4
    BatchBufferBytes    = 20000
    LocalOnly           = 2
    MaxKeepAlivesMissed = 1000
    Host1               = hostname1:22201
    Host2               = hostname1:22202
    Host3               = hostname2:22203
    Host4               = hostname2:22204
    MaxHosts            = 5
    $ more cluster_04/cluster.ini
    [Cluster]
    Threads             = 20
    Master              = Host1
    ThisHost            = Host4
    ReqBatchSize        = 10000
    BatchesPerRPC       = 4
    BatchBufferBytes    = 20000
    LocalOnly           = 2
    MaxKeepAlivesMissed = 1000
    Host1               = hostname1:22201
    Host2               = hostname1:22202
    Host3               = hostname2:22203
    Host4               = hostname2:22204
    MaxHosts            = 5
    $
    
  11. The nodes can then be started on each machine, with 2 nodes being started on each in this case to form the cluster:
    
    Machine 1 (hostname1)
    
    $ virtuoso-start.sh
    Starting Virtuoso instance in [cluster_01]
    Starting Virtuoso instance in [cluster_02]
    $
    
    Machine 2 (hostname2)
    
    $ virtuoso-start.sh
    Starting Virtuoso instance in [cluster_03]
    Starting Virtuoso instance in [cluster_04]
    $
    
  12. To stop the cluster use the standard virtuoso-stop.sh script which automatically detects the number for nodes to be stopped:
    $ virtuoso-stop.sh
    Stopping Virtuoso instance in [cluster_01]
    Stopping Virtuoso instance in [cluster_02]
    Stopping Virtuoso instance in [cluster_03]
    Stopping Virtuoso instance in [cluster_04]
    $
    

2.16.2. Backup and Restore

Backup

There are 2 ways to backup Virtuoso Cluster DB:

  1. Backup every node using back_online

    For example, for every cluster in its backup folder execute:

    SQL> backup_online('dbp',10000000,0,vector('backup'));
    
    Done. -- 272 msec.
    
  2. Make backup of all nodes at once using cl_exec. For example, execute:
    SQL> cl_exec ('backup_online (''dbp'', 10000000, 0,  vector (''backup''))');
    
    Done. -- 573 msec.
    

Restore from Backup

After backup is done for every node in its backup folder, in order to restore, execute from the ..\bin folder the virtuoso-restore.sh:

# . ./virtuoso-restore.sh all dbp

where the second parameter is the restore prefix.


2.16.3. Cluster Configuration

  1. Set "FAST_START=1" in the viruoso-start.sh file and then run:
    viruoso-start.sh
    

    or

  2. Execute the following line:
    # /etc/init.d/virtuoso start
    Starting OpenLink Virtuoso:                                [  OK  ]
    
  3. In order to check the nodes, connect to port 12201 using the ISQL tool:
    isql 12201
    
  4. To check the cluster status, execute the following command:
    SQL> status('cluster');
    REPORT
    VARCHAR
    _______________________________________________________________________________
    
    Cluster 4 nodes, 293 s. 0 m/s 0 KB/s  0% cpu 0%  read 0% clw threads 1r 0w 0i buffers 1781 0 d 0 w 0 pfs
    
    1 Rows. -- 4 msec.
    

2.16.4. Troubleshooting Tips

If an operation seems to hang, see the output of:

status ()

Check for the presence of the following conditions:


See Also:

Setting up and operating Virtuoso on a cluster.

Virtuoso Cluster Programming

Virtuoso Cluster Fault Tolerance.