Multiple Storage Backend

Hello,
I want to config multiple storage backend to fs and followed the manual in multiple_storage_backends.html.

Seafile version 6.3.9 on CentOS7 with autoscript installation.

  1. Without any config, all data is stored to /opt/seafile/seafile-data. I created a few librarys with a few documents with admin and a second user. Then I made the config for multiple storage (see config files below) with policy STORAGE_CLASS_MAPPING_POLICY = ‘REPO_ID_MAPPING’ and used “for_new_library”: true on the new second storage class. The first storage class I setup to /opt/seafile/seafile-data with “is_default”: true. Then I restarted the service. The first ceated libraries I could access, new created libraries are stored on the first storage class /opt/seafile/seafile-data but not on the second new one. I expected them on the new one, but perhaps I did not understand correctly the manual.

Then I changed the “is_default”: true to the second new class. Then, the new librarys were stored on the new storage class, but the first created libraries (before configuring the multiple storage backend) I could not open. The library created after configuring the multiple storage backend I could open. I have changed the default config only.
The logfile has the following entry:
PM] repo-mgr.c(1085): Commit 727ee476-52dd-4348-925b-006740458d8c:dcb0ef5cb6802fd97d617eb5593af8e3fcab6bb6 is missing
PM] seafile-session.c(507): Failed to get system default repo. Create a new one.

  1. Then I tried to use the policy STORAGE_CLASS_MAPPING_POLICY = ‘USER_SELECT’.
    On creating a new library I expected a dropdown to select the class or something like that. But there is no one. I dont know, if it does not work or I cant find the setup or make something wrong. The library is then stored in the default configured library.

Thanks for help / answers.
Chris

seafile.conf
-> added
[storage]
enable_storage_classes = true
storage_classes_file = /opt/seafile_storage_classes.json

seahub_settings.py
-> added
ENABLE_STORAGE_CLASSES = True
STORAGE_CLASS_MAPPING_POLICY = ‘REPO_ID_MAPPING’
-> then changed to
STORAGE_CLASS_MAPPING_POLICY = ‘USER_SELECT’

seafile_storage_classes.json
-> new file created
[

{
“storage_id”: “seafile-data”,
“name”: “seafile-data”,
“is_default”: true, (then changed to false)
“for_new_library”: false,
“fs”: {“backend”: “fs”, “dir”: “/opt/seafile/seafile-data”},
“commits”: {“backend”: “fs”, “dir”: “/opt/seafile/seafile-data”},
“blocks”: {“backend”: “fs”, “dir”: “/opt/seafile/seafile-data”}
},

{
“storage_id”: “storage_1”,
“name”: “storage_1”,
“is_default”: false, (then changed to true)
“for_new_library”: true,
“fs”: {“backend”: “fs”, “dir”: “/storage/1”},
“commits”: {“backend”: “fs”, “dir”: “/storage/1”},
“blocks”: {“backend”: “fs”, “dir”: “/storage/1”}
}

]

Are you using the professional edition? It does not work with CE

Yes, it is pro edition.

I think the issue is, that no mapping has been stored for libraries created before adding the mappings. Thus the libraries are searched in the default storage backend.

You could change that by manipulating the database.

Hi,
I have the same issue… is anyone able to set mutiple seafile-data folder for different users?

Withouth further specifics from your end, please have a look at the pertinent section in the manual: https://download.seafile.com/published/seafile-manual/deploy_pro/multiple_storage_backends.md

I tested again…
only able to change the default lib folder
and the creation folder path is under seafile.ini (in 7.0.5 version, under /seafile/ccnet/)
I changed the location of this doc and then restart service… it will show folder doest exist and create new one.
i didnt see any select option for user to choose different storage type