SeaweedFS can utilize existing familiar data store, e.g., Cassandra, Mysql, Postgres, Redis, to store the filer metadata.

The following takes Cassandra as an example.

Cassandra Setup

Here is the CQL to create the table.CassandraStore.Optionally you can adjust the keyspace name and replication settings.For production, you would want to set replication_factor to 3if there are at least 3 Cassandra servers.

  1. create keyspace seaweedfs WITH replication = {
  2. 'class':'SimpleStrategy',
  3. 'replication_factor':1
  4. };
  5.  
  6. use seaweedfs;
  7.  
  8. CREATE TABLE filemeta (
  9. directory varchar,
  10. name varchar,
  11. meta blob,
  12. PRIMARY KEY (directory, name)
  13. ) WITH CLUSTERING ORDER BY (name ASC);

Create a filer.toml

Try run weed filer -h to see an example filer.toml file. The file should be under one of current directory, $HOME/.seaweedfs/, or /etc/seaweedfs/ folers.

Here is the shortest example for Cassandra

  1. [cassandra]
  2. enabled = true
  3. keyspace="seaweedfs"
  4. hosts=[
  5. "localhost:9042",
  6. ]

Starting the Filer

  1. weed filer