Thursday, 15 October 2009

Upgrading OpenSim

1) Upgrading OpenSim

Upgrading from 0.6.7 to 0.6.8

I have just upgraded a standalone installation of OpenSim from 0.6.7 to 0.6.8

The process I followed is outlined below:

Login as user opensim and to be on the safe side backup the existing database:

[opensim@standbyvle ~]$ mysqldump -u root -p --opt opensim > opensim.0.6.7.2009-12-25

Download and unpack the latest release:

[opensim@standbyvle ~]$ lynx http://dist.opensimulator.org/opensim-0.6.8-release.tar.gz
[opensim@standbyvle ~]$ tar -xzvf opensim-0.6.8-release.tar.gz

Change directory and build OpenSim:

[opensim@standbyvle ~]$ cd opensim-0.6.8-release
[opensim@standbyvle opensim-0.6.8-release]$ ./runprebuild.sh
[opensim@standbyvle opensim-0.6.8-release]$ nant

Make a copy of the new OpenSim.ini.example as OpenSim.ini, perform a line by line comparison with OpenSim.ini as customised for use with version 0.6.7 and modify the clean copy of OpenSim.ini appropriately. (I actually spent some time stripping all the comments from the clean copy of OpenSim.ini to make it more manageable).

[opensim@standbyvle opensim-0.6.8-release]$ cd bin
[opensim@standbyvle bin]$ cp OpenSim.ini.example OpenSim.ini
[opensim@standbyvle bin]$ nano OpenSim.ini

Additionally to overcome problems with "grey" avatars and inventory control, ensure that the following parameters are included in OpenSim.ini:

[Startup]
hypergrid = true

[Network]
; change to reflect your external IP address
user_server_url = "http://195.194.82.16:9000"
asset_server_url = "http://195.194.82.16:9000"
inventory_server_url = "http://195.194.82.16:9000"
grid_server_url = "http://195.194.82.16:9000"

[Architecture]
Include-HGStandalone = "config-include/StandaloneHypergrid.ini"

After customising OpenSim.ini it is also necessary to examine and customise certain files in the config-include directory:

[opensim@standbyvle bin]$ cd config-include
[opensim@standbyvle config-include]$ cp StandaloneCommon.ini.example StandaloneCommon.ini
[opensim@standbyvle config-include]$ cp CenomeCache.ini.example CenomeCache.ini

Edit StandaloneCommon.ini and set up the [Database Service] parameters to use MySQL:

[opensim@standbyvle config-include]$ nano StandaloneCommon.ini

Note that for a standalone installation none of the other .example files in the config-include directory are required. The required contents of config-include for a standalone installation are show below:

[opensim@standbyvle config-include]$ ls
CenomeCache.ini StandaloneCommon.ini StandaloneHypergrid.ini

Copy over the necessary files from 0.6.7:

Please note that some of the files copied below are specific to our installation of OpenSim.

[opensim@standbyvle config-include]$ cd
[opensim@standbyvle ~]$ cp opensim-0.6.7-release/bin/Regions/Regions.ini opensim-0.6.8-release/bin/Regions
[opensim@standbyvle ~]$ cp opensim-0.6.7-release/bin/Regions/Regions.ini.* opensim-0.6.8-release/bin/Regions
[opensim@standbyvle ~]$ cp opensim-0.6.7-release/bin/*.bmp opensim-0.6.8-release/bin
[opensim@standbyvle ~]$ cp opensim-0.6.7-release/bin/*.png opensim-0.6.8-release/bin

Start 0.6.8:

[opensim@standbyvle ~]$ cd opensim-0.6.8-release/bin
[opensim@standbyvle bin]$ mono OpenSim.exe

And to my surprise 0.6.8 successfully started :)


Getting Diva's Libraries working

This requires the use of git to fetch the latest HEAD for OpenSim 0.6.9(dev) as the library feature is not available with 0.6.8.

[opensim@standbyvle ~]$ cd git
[opensim@standbyvle git]$ rm -rf opensim
[opensim@standbyvle git]$ git clone git://opensimulator.org/git/opensim
Initialized empty Git repository in /home/opensim/git/opensim/.git/
remote: Counting objects: 141938, done.
remote: Compressing objects: 100% (39087/39087), done.
remote: Total 141938 (delta 109292), reused 129516 (delta 99488)
Receiving objects: 100% (141938/141938), 111.56 MiB | 556 KiB/s, done.
Resolving deltas: 100% (109292/109292), done.

[opensim@standbyvle git]$ cd opensim
[opensim@standbyvle opensim]$ git reset --hard ########
HEAD is now at 2205d1c... Merge branch 'master' of
ssh://MyConnection/var/git/opensim

[opensim@standbyvle ~]$ cp -pr /home/opensim/git/opensim /home/opensim/opensim-0.6.9-pre-release
[opensim@standbyvle ~]$ cd /home/opensim/opensim-0.6.9-pre-release

It is then necessary to follow the upgrade procedure detailed elsewhere in this blog.

Add add the following parameters to OpenSim.ini:

[Modules]
LibraryModule = true

[LibraryModule]
LibraryName = "OpenSim Library (Diva)"

Download the Diva libraries and save the files in the bin/Library folder. These can be obtained by upgrading the latest Diva distribution and copying over the .iar files. A larger object collection is also avaliable for download from the github site. For more information visit: http://www.metaverseink.com/blog/?p=29

The contents of the library folder are shown below:

[opensim@standbyvle bin]$ ls Library
Clothing Library (small).iar Objects_Library__large_.iar Objects Library (small).iar

When OpenSim is started the contents of the .iar files are automatically unpacked and incorporated into the inventory structure.


Upgrading Mono

Once I had a lot of objects/scripts rezzed I encountered segmentation errors when shutting down the simulator. This was solved thanks to reply to a posting by Jane Foxclaw.

The solution was to upgrade the version of mono we were using to 2.4.2.3

The upgrade process is outlined below:

Login as user opensim and use the following commands:

[opensim@standbyvle ~]$ lynx http://ftp.novell.com/pub/mono/archive/2.4.2.3/sources/
[opensim@standbyvle ~]$ tar -jxvf libgdiplus-2.4.2.tar.bz2
[opensim@standbyvle ~]$ cd libgdiplus-2.4.2
[opensim@standbyvle libgdiplus-2.4.2] ./configure --prefix=/home/opensim/bin/mono
[opensim@standbyvle libgdiplus-2.4.2] make
[opensim@standbyvle libgdiplus-2.4.2] make install
[opensim@standbyvle libgdiplus-2.4.2] cd ..
[opensim@standbyvle ~]$ lynx http://ftp.novell.com/pub/mono/archive/2.4.2.3/sources/
[opensim@standbyvle ~]$ tar -jxvf mono-2.4.2.3.tar.bz2
[opensim@standbyvle ~]$ cd mono-2.4.2.3
[opensim@standbyvle mono-2.4.2.3]$ ./configure --prefix=/home/opensim/bin/mono
[opensim@standbyvle mono-2.4.2.3]$ make
[opensim@standbyvle mono-2.4.2.3]$ make install
[opensim@standbyvle mono-2.4.2.3] cd ..
[opensim@standbyvle ~]$ mono -V

Mono JIT compiler version 2.4.2.3 (tarball Sun Jan 17 19:22:13 GMT 2010)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC)
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none



Upgrading from 0.6.6 to 0.6.7

I have just upgraded a standalone installation of OpenSim from 0.6.6 to 0.6.7

The process I followed is outlined below:

Login as user opensim and to be on the safe side backup the existing database:

[opensim@standbyvle ~]$ mysqldump -u root -p --opt opensim > opensim.0.6.6.2009-10-15

Download and unpack the latest release:

[opensim@standbyvle ~]$ lynx http://dist.opensimulator.org/opensim-0.6.7-release.tar.gz
[opensim@standbyvle ~]$ tar -xzvf opensim-0.6.7-release.tar.gz

Change directory and build OpenSim:

[opensim@standbyvle ~]$ cd opensim-0.6.7-release
[opensim@standbyvle opensim-0.6.7-release]$ ./runprebuild.sh
[opensim@standbyvle opensim-0.6.7-release]$ nant
[opensim@standbyvle opensim-0.6.7-release]$ cd ..

Copy over the necessary files from 0.6.6:

Please note that some of the files copied below are specific to our installation of OpenSim. Also be careful in just copying over OpenSim.ini from version 0.6.6 as there are some new parameters added to OpenSim.ini.example in version 0.6.7, which you may want to append to the existing configuration file.

[opensim@standbyvle ~]$ cp opensim-0.6.6-release/bin/OpenSim.ini opensim-0.6.7-release/bin
[opensim@standbyvle ~]$ cp opensim-0.6.6-release/bin/Regions/Regions.ini opensim-0.6.7-release/bin/Regions
[opensim@standbyvle ~]$ cp opensim-0.6.6-release/bin/Regions/Regions.ini.* opensim-0.6.7-release/bin/Regions
[opensim@standbyvle ~]$ cp opensim-0.6.6-release/bin/*.bmp opensim-0.6.7-release/bin
[opensim@standbyvle ~]$ cp opensim-0.6.6-release/bin/*.png opensim-0.6.7-release/bin

Start 0.6.7:

[opensim@standbyvle ~]$ cd opensim-0.6.7-release/bin
[opensim@standbyvle bin]$ mono OpenSim.exe

And to my surprise 0.6.7 successfully started and to my even greater surprise when I logged in from the client I found megaregions had been enabled by default. However the total prim count in About Land is still listed as 15000 even though I have 4 sims in a 512x512 grid.


Using git to fetch the 0.6.7 post release

Getting fed up with flailing arms on 0.6.7 I decided to install git and use it to fetch the 0.6.7 post release, which has Teravus's and Kitto's fix installed.

The first setp was to install git as the root user. The following commands were used to download and install git:

[root@standbyvle ~]# lynx http://centos.karan.org/el5/extras/testing/x86_64/RPMS/perl-Error-0.17008-1.el5.kb.noarch.rpm
[root@standbyvle ~]# lynx http://kernel.org/pub/software/scm/git-core/testing/git-1.5.6.rc3-1.i386.rpm
[root@standbyvle ~]# lynx http://kernel.org/pub/software/scm/git-core/testing/perl-Git-1.5.6.rc3-1.i386.rpm
[root@standbyvle ~]# lynx http://kernel.org/pub/software/scm/git-core/testing/git-core-1.5.4.rc5-1.i386.rpm
[root@standbyvle ~]# rpm -ivh --force --nodeps perl-Error-0.17008-1.el5.kb.noarch.rpm
[root@standbyvle ~]# rpm -ivh --force --nodeps git-1.5.6.rc3-1.i386.rpm
[root@standbyvle ~]# rpm -ivh --force --nodeps perl-Git-1.5.6.rc3-1.i386.rpm
[root@standbyvle ~]# rpm -ivh --force --nodeps git-core-1.5.4.rc5-1.i386.rpm
[root@standbyvle ~]# git --version
git version 1.5.4.rc5

I then asked our network manager to open open tcp port 9418 inbound and outbound to the Internet so that git could fetch the contents of the remote repository.

It was then necessary to become the opensim user and use git to fetch the required release:

[opensim@standbyvle ~]$ mkdir git
[opensim@standbyvle ~]$ cd git
[opensim@standbyvle git]$ git clone git://opensimulator.org/git/opensim
[opensim@standbyvle git]$ cd opensim
[opensim@standbyvle opensim]$ git checkout -b 0.6.7-post-fixes origin/0.6.7-post-fixes
[opensim@standbyvle opensim]$ git checkout origin/0.6.7-post-fixes
HEAD is now at a9da278... * Fix incorrect math on the Velocity check in PhysicsCollisionUpdate. This may reduce avatar flailing.
[opensim@standbyvle opensim]$ cp -pr /home/opensim/git/opensim /home/opensim/opensim-0.6.7-post-release
[opensim@standbyvle ~]$ cd opensim-0.6.7-post-fixes

I then went ahead to run with the upgrade procedure outlined above. I was delighted to find that when I logged in the flailing arms problem had gone away :)


Getting XML-RPC working

Initially I couldn't get XMLRPC calls from an external Web Server to a scripted object in OpenSim to work.

This was eventually solved by following the steps below:


1) Enable the following parameters in OpenSim.ini

[NETWORK]
remoteDataPort = 20800
ExternalHostNameForLSL=standbyvle.bromley.ac.uk


[XMLRPC]
XmlRpcRouterModule = "XmlRpcRouterModule"
XmlRpcPort = 20800



2) As the root user upgrade PEAR on the Webserver running the PHP code and use PEAR to install XML_RPC2

[root@standbyvle ~]# pear upgrade --force pear
[root@standbyvle ~]# pear install XML_RPC2


3) Use appropriate syntax in the Webserver PHP script.

Note that this script is specific to my particular implementation and will need modification before it is used elsewhere.


require_once('XML/RPC2/Client.php');

$conn=@mysql_connect("localhost", "yyyyyyyy", "xxxxxxxx")
or die("Err:Conn");

$rs=@mysql_select_db("sl", $conn)
or die("Err:Db");

$sql="select * from key_table where region = '$region'";

$rs=mysql_query($sql,$conn);

while( $row = mysql_fetch_array($rs) )
{
$channel=$row["lslkey"];
}

if ($action == 'delete')
{
$sql1="delete from key_table where lslkey = '$channel'";
$rs1=mysql_query($sql1,$conn);
}

$intval="2010";

// Create the client with the target uri
$client = XML_RPC2_Client::create('http://standbyvle.bromley.ac.uk:20800');

// an array with the data for our call to the channel in the simulator
$llPacket = array(
'Channel' => $channel,
'IntValue' => $intval,
'StringValue' => $action);

// call the rpc to get a response
$xresponse = $client->llRemoteData($llPacket);

// print the contents of the array in the browser window;
print_r ($xresponse);
?>



Return to Menu

Comments:
Nice guide Clive. I presume that this is for connection to an existing grid or standalone rather than for somebody running an entire grid (which would require more configuration migration work).
 
Yes this is just upgrade instrcutions for a standalone. We've had enough issues with our insitutional ISA firewall with a standalone installation without braving a grid connection ;)
 

Post a Comment





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]