When I try to create a base with sqlite3
on a EFS directory, this results in an error:
$ sqlite3 foo.db
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .log stderr
sqlite> CREATE TABLE foo (int bar);
Error: disk I/O error
The Sqlite3 database in question is supposed to story meta data only and will be updated infrequently. Concurrent access is not required. However, it is required that if the process creating the Database dies, the process can be restarted on a different host and carry on where the previous instance quit.
Amazon claims that EFS is a "file system that [is] accessible to Amazon EC2 instances via a file system interface (using standard operating system file I/O APIs) and that support full file system access semantics (such as strong consistency and file locking)." Thus, I'm assuming it is fit for the task at hand.
The mount options in /etc/fstab
are:
eu-west-1a.fs-ID.efs.eu-west-1.amazonaws.com:/ /efs nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0
I understand that it is often generally discouraged to put databases on NFS. However, I believe, given the language used by both Amazon and SQLite, developers will keep trying.
.log stderr
to get more error information. – CL..log stderr
produces no addtional output – Jansqlite3
tool. – CL.