Blockish is an NBD server. NBD stands for Network Block Device and is a Linux mechanism for making network resources available as local block devices.
Blockish has a pluggable framework that can support multiple backends. Currently there are three backends:
It is easy to configure and run Blockish. Just execute the JAR file and give the path to a configuration file as the only argument. For example, given the following XML configuration file named memory.xml:
<blockish>
<server type="nbd">
<bind port="3000"/>
<backend type="memory">
<args size="1048576"/>
</backend>
</server>
</blockish>
Executing java -jar blockish.jar memory.xml starts a server on port 3000 that serves up 1 megabyte of storage using local memory.
There can be any number of server elements. Each one specifies a server to start that will be given its own thread.
Each server element requires a type attribute that specifies the kind of server to run. For now, only the nbd type is supported. Future versions of Blockish may support different protocols for serving up block devices.
The server element must contain a bind element which specifies where to listen for client connections. The bind element must contain a port attribute which specifies the TCP port to listen on.
The server element must contain a backend element which specifies the block device to serve. The backend element must have a type attribute which specifies the kind of backend to run. All child elements of the backend element are passed to the configuration of the backend. The expected configuration of the backends is documented below.
Backends provide a block device of some form up to the server, which then exposes it to the client.
This is the simplest form of block device. It just serves up a chunk of RAM. It expects a single args element in the configuration file with a single size attribute, which specifies the number of bytes to serve.
The memory backend uses a fixed block size of 1024. The size must be a multiple of 1024 bytes.
This backend allows you to use a file as the block device. It expects a single args element in the configuration file with a file attribute, which specifies the path to the file to serve up and a size attribute, which specifies the size of the file in bytes. If the file does not exist, it is created. If the size of the file does not match the specified size, it is changed to match.
The file backend uses a fixed block size of 1024. The size must be a multiple of 1024 bytes.
This backend allows you to use Amazon's S3 service as the block device. It expects a single args element in the configuration file with a host attribute, which specifies the host to use, a size attribute, which specifies the size of the file in bytes, a username attribute, which is the Amazon S3 access key ID, a password attribute, which is the Amazon S3 secret access key, and a bucket attribute, which is the name of the bucket to use. Bucket names are in a global namespace, so one should pick something globally unique, (e.g. a UUID). If the bucket does not exist, it is created.
The s3 backend uses a fixed block size of 1024. The size must be a multiple of 1024 bytes.
Blockish is free software and is licensed under version 2 of the GPL.
The canonical homepage for Blockish is http://www.stackframe.com/Blockish/. You can ask questions and provide feedback and code changes to blockish@stackframe.com.
StackFrame, LLC provides Blockish free of charge and accepts no liability for data loss or storage charges incurred through the use of Blockish.