My favorites | Sign in
Project Logo
                
Search
for
Updated Dec 15, 2009 by kru...@informatik.hu-berlin.de
Labels: Featured
FAQ  
Frequently asked questions.

General

Is the store persisted on disk?

No its not persistent on disk (see also next question). Persistent storage is an often demanded feature, but it is not as easy to do as one might think. Lets explain why:

Why persistent storage?

Persistent storage to overcome node failures and node resets:

Scalaris uses quorum algorithms, that assume a crash-stop failure model for processes. A precondition of such systems is, that a majority of the replicas of an item is always available.

If this precondition is violated, a majority of the nodes with replicas of an item x is not available, the item cannot be changed. It is lost. Persistent storage cannot help directly.

If a minority of the replicas fail, they will be repaired (new replicas are created on other nodes).

If a single failed node does crash and recover, which is not foreseen in the crash-stop model, but might happen if we have local persistent storage, we have three choices:

  1. drop the persistent storage and start as new node (crash-stop model)
  2. get some inconsistencies as another node already took over. For a short timeframe there might be more replicas in the system than allowed, which destroys the proper functioning of our majority based algorithms.
  3. friendly join the system and update the stored peristent state with the current state in the system (one way to implement that would be (1)).

So, persistent storage does not help in improving the availability or robustness of the system.

Persistent storage to allow pausing the system (controlled shutdown and restart):

This would be possible to implement by a snapshot mechanism for the system. To pause the system, one would cut user access, wait some time for all ongoing transactions to finish, and then trigger a snapshot to local disks. On startup, the nodes would continue from the last state after reading the snapshot. Then user access can be restarted.

Persistent storage to have an always up-to-date snapshot of the system:

Persistency as in traditional replicated databases is not intended by our system model and thereby not possible. The best alternative would be periodic snapshots, that can be done also without interrupting the service.

Can I store more data in Scalaris than ram+swapspace is available in the cluster?

Yes. We have several database backends, e.g. src/db_ets.erl (ets) and src/db_tcerl (tokyocabinet). The former uses the main memory for storing data, while the latter uses tokyocabinet for storing data on disk. With tokycoabinet, only your local disks should limit the total size of your database. Note however, that this still does not provide persistency.

For instructions on switching the database backend to tokyocabinet see Tokyocabinet.

Installation

Prebuild packages

We build rpm and deb packages using checkouts from svn trunk and the latest tagged version and provide them using the openSUSE BuildService at http://download.opensuse.org/repositories/home:/tschuett/. The available packages are listed in the following table:

Distribution Version Download
Fedora 9 Repository: http://download.opensuse.org/repositories/home:/tschuett/Fedora_9/
Fedora 10 Repository: http://download.opensuse.org/repositories/home:/tschuett/Fedora_10/
Fedora 11 Repository: http://download.opensuse.org/repositories/home:/tschuett/Fedora_11/
Fedora 12 Repository: http://download.opensuse.org/repositories/home:/tschuett/Fedora_12/
Mandriva 2008 Repository: http://download.opensuse.org/repositories/home:/tschuett/Mandriva_2008/
Mandriva 2009 Repository: http://download.opensuse.org/repositories/home:/tschuett/Mandriva_2009/
Mandriva 2009.1 Repository: http://download.opensuse.org/repositories/home:/tschuett/Mandriva_2009.1/
Mandriva 2010 Repository: http://download.opensuse.org/repositories/home:/tschuett/Mandriva_2010/
openSUSE 11.0 Repository: http://download.opensuse.org/repositories/home:/tschuett/openSUSE_11.0/
1-Click Install (stable)
1-Click Install (unstable)
openSUSE 11.1 Repository: http://download.opensuse.org/repositories/home:/tschuett/openSUSE_11.1/
1-Click Install (stable)
1-Click Install (unstable)
openSUSE 11.2 Repository: http://download.opensuse.org/repositories/home:/tschuett/openSUSE_11.2/
1-Click Install (stable)
1-Click Install (unstable)
openSUSE Factory Repository: http://download.opensuse.org/repositories/home:/tschuett/openSUSE_Factory/
SLE 10 Repository: http://download.opensuse.org/repositories/home:/tschuett/SLE_10/
1-Click Install (stable)
1-Click Install (unstable)
SLE 11 Repository: http://download.opensuse.org/repositories/home:/tschuett/SLE_11/
1-Click Install (stable)
1-Click Install (unstable)
CentOS 5.4 Repository: http://download.opensuse.org/repositories/home:/tschuett/CentOS_5/
RHEL 5 Repository: http://download.opensuse.org/repositories/home:/tschuett/RHEL_5/
Debian 5.0 Repository: http://download.opensuse.org/repositories/home:/tschuett/Debian_5.0/
Ubuntu 9.04 Repository: http://download.opensuse.org/repositories/home:/tschuett/xUbuntu_9.04/
Ubuntu 9.10 Repository: http://download.opensuse.org/repositories/home:/tschuett/xUbuntu_9.10/

Inside those repositories you will also find erlang packages - you don't need this if you already have a recent enough erlang version (R12B-4)!

How to build an rpm?

svn checkout http://scalaris.googlecode.com/svn/trunk/ scalaris-0.0.1
tar -cvzf scalaris-0.0.1.tar.gz scalaris-0.0.1 --exclude-vcs
cp scalaris-0.0.1.tar.gz /usr/src/packages/SOURCES/
rpmbuild -ba scalaris-0.0.1/contrib/packages/scalaris.spec

Your source and binary rpm will be generated in /usr/src/packages/SRPMS and RPMS. Note however that this rpm's version will be 0.0.1, contrary to the packages in the repositories mentioned above. Different versions can be set in the given .spec file

Does Scalaris run on Windows?

No. Well, maybe.

  1. install Erlang (http://www.erlang.org/download.html)
  2. install OpenSSL (for crypto module) (http://www.slproweb.com/products/Win32OpenSSL.html)
  3. checkout scalaris code from SVN
  4. copy an appropriate EMakefile_for from contrib\win32 to the trunk-directory and name in EMakefile
  5. adapt the path to your Erlang installation in build.bat
  6. create an empty autoconf.hrl in include
  7. start a cmd.exe
  8. go to the scalaris directory
  9. run build.bat in the cmd window
  10. check that there were no errors during the compilation; warnings are fine
  11. go to the bin sub-directory
  12. adapt the path to your Erlang installation in boot.bat
  13. run boot.bat in the cmd window

Note: we do not support Scalaris on Windows at the moment.

Configuration

How can I change the web server port/yaws port?

For changing the yaws port of the boot server add "-boot_cs yaws_port XXXX" to the erl call in bin/boot.sh, where XXXX is the port.

For changing the yaws port of a normal server change in bin/cs_local?.sh "-chordsharp yaws_port XXXX", where XXXX is the port.

Usage

How do I delete a key?

The principle issues with deleting keys from Scalaris are described in this thread of the mailing list.

In short: deleting a key may violate one of Scalaris' fundamental assumptions - version numbers of keys never decrease. Everything is fine, as long as all replicas are deleted. If some remain, because a node was not available during the delete, you may get into trouble.

Keys can be deleted outside transactions from Erlang and Java.

In Erlang you call transstore.transaction_api:delete(Key, Timeout) which returns {ok, pos_integer(), list()} | {fail, timeout} | {fail, timeout, pos_integer(), list()} | {fail, node_not_found}). The pos_integer() indicates how many replicas were successfully deleted, and the list contains further details.

In Java you can call delete(key) or delete(key, timeout) from the Scalaris object and get further details on the result by calling getLastDeleteResult().

What does the "discarded messages" error message mean?

When you stop an scalaris node and immediately restart it, you can get the following message:

=ERROR REPORT==== 20-Jul-2009::14:51:06 ===
Discarding message {ping,{{127,0,0,1},14195,<8031.110.0>},4} from <0.99.0> to <0.106.0> 
in an old incarnation (3) of this node (1)

It is not so much an error but a message by the Erlang runtime, that this particular message was sent to the last "incarnation" of this scalaris node. Here it is the failure detector sending a ping message. After a couple of seconds, the failure detector will notice the change and the messages will stop to appear.



Sign in to add a comment
Hosted by Google Code