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.
- 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.
- 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”}
}
]