用python编写的应用级分布式文件系统
koboldfs的Python项目详细描述
koboldfs是用python编写的应用级分布式文件系统。 受mogilefs[1]的启发,它拥有一些特性和特性:
- Application level – no special kernel modules required;
- No single point of failure – all the components of a KoboldFS setup (servers and database) can be run on multiple machines, so there’s no single point of failure (a minimum of 2 machines is recommended);
- Automatic file replication – files are automatically replicated between all the servers. In KoboldFS there is no concept of “class”, so it is not possible to specify if a given file has to be replicated only in a subset of the available servers;
- “Better than RAID” – in a non-SAN RAID setup, the disks are redundant, but the host isn’t. If you lose the entire machine, the files are inaccessible. KoboldFS replicates the files between devices which are on different hosts, so files are always available;
- Flat name space – Files are identified by named keys in a flat, global name space. You can create as many name spaces as you’d like, so multiple applications with potentially conflicting keys can run on the same MogileFS installation;
- Shared-Nothing – KoboldFS doesn’t depend on a pricey SAN with shared disks. Every machine maintains its own local disks;
- No RAID required – Local disks on KoboldFS storage nodes can be in a RAID, or not. It’s cheaper not to, as RAID doesn’t buy you any safety that MogileFS doesn’t already provide;
- Local file system agnostic – Local disks on KoboldFS storage nodes can be formatted with your file system of choice (ext3, XFS, etc..). KoboldFS does its own internal directory hashing so it doesn’t hit file system limits such as “max files per directory” or “max directories per directory”. Use what you’re comfortable with;
- Completely portable – it is a python-only module, thus can be run on any operating system and architecture which is supported by Python;
- Database-agnostic – it can run with any SQL database; actually only the PostgreSQL support is implemented, but adding support for new databases is quick and easy;
- Support for serving the stored files directly by an external web server, reducing the load on the application servers.
koboldfs不是:
- POSIX Compliant – you don’t run regular Unix applications or databases against KoboldFS; it’s meant for archiving write-once files and doing only sequential reads (though you can modify a file by way of overwriting it with a new version).
示例用法:
>>> from StringIO import StringIO >>> from koboldfs import Client>>> client = Client('demo', servers=['127.0.0.1:9876', '127.0.0.1:9875'])>>> print client.ping() True>>> print client.put('motd', '/etc/motd') True>>> output = StringIO() >>> if client.get('motd', output): >>> output.seek(0) >>> print output.read() Linux...>>> print client.get_url('motd') http://...>>> print client.delete('motd') True>>> client.get('motd', output) False>>> assert client.get_url('motd') is None True
0.3.2(2011-01-13)
- 将方法“client.put_stat(key,source)”添加到客户端;其工作原理如下 Put方法,但如果出现错误,它不返回布尔值, 以及字典{'digest':…,'size':…},以防成功。
0.3.1(2011-01-10)
- 需要sqlalchemy>;=0.6;这修复了utf-8编码中的一些角点情况 从数据库中检索的数据;将模型更新为 炼金术。
- 增加了对ini文件解析的支持。
0.3.0(2010-04-01)
- 删除了koboldfs.zope模块和相关依赖项;相同 使用koboldfs.client.clientpool可以实现功能,而不需要 取决于任何zope包。
- 引入了koboldfs.client.transactionalclientpool,它支持 (可选的两阶段)事务。
- 使用sqlalchemy而不是直接依赖于数据库的psycopg2 连接;koboldfs现在(实际上)与任何数据库后端兼容 它由sqlalchemy支持。
- 使用buildout添加了init脚本。
- 添加了使用sqlite作为数据库后端的单元测试。
0.2.2(2009-07-05)
- 数据管理器中的修复:使用连接池而不是始终保持 数据库连接打开。
0.2.1(2009-05-28)
- zope现在是一个额外的包。
0.2.0(2009-05-28)
- 首次公开发行。