diff --git a/manual/deploy_pro/office-preview-yml/docker-compose.yml b/manual/deploy_pro/office-preview-yml/docker-compose.yml deleted file mode 100644 index d9ee9a01b..000000000 --- a/manual/deploy_pro/office-preview-yml/docker-compose.yml +++ /dev/null @@ -1,11 +0,0 @@ -services: - office-preview: - image: seafileltd/office-preview:latest - container_name: seafile-office-preview - environment: - - IGNORE_JWT_CHECK=true - ports: - - "8089:8089" - command: bash start.sh - volumes: - - /opt/office-preview/shared:/shared # the host path can be customized diff --git a/manual/deploy_pro/office_documents_preview.md b/manual/deploy_pro/office_documents_preview.md deleted file mode 100644 index 3bc7f33cb..000000000 --- a/manual/deploy_pro/office_documents_preview.md +++ /dev/null @@ -1,177 +0,0 @@ -# Office Documents Preview with LibreOffice - -> This is a deprecated feature since version 11. Integrating with CollaboraOnline or OnlyOffice is recommended. - -Seafile Professional Server supports previewing office documents online by converting them to PDF. You can follow these steps to use the feature. If you'd like to edit office files online, you can integrate Seafile with Microsoft Office Online server, CollaboraOnline or OnlyOffice. - - -## Version 7.1.x - 8.0.x - -### Install Libreoffice/UNO - -Libreoffice 6.2+ and Python-uno library are required to enable office files online preview. - -On Ubuntu/Debian: - -```bash -sudo apt-get install libreoffice libreoffice-script-provider-python -``` - -> For older version of Ubuntu: `sudo apt-get install libreoffice python-uno` - -On Centos/RHEL, you need to first remove the default libreoffice in the distribution: - -``` -yum remove --setopt=clean_requirements_on_remove=0 libreoffice-* -``` - -Then install version 6.4 or newer ([Installation of LibreOffice on Linux](https://wiki.documentfoundation.org/Documentation/Install/Linux#Terminal-Based_Install)). - -Also, you may need to install fonts for your language, especially for Asians, otherwise the office document may not display correctly. - -### Enable Office Preview - -Open file `seafevents.conf`, in the `OFFICE CONVERTER` section: - -```conf -[OFFICE CONVERTER] -enabled = true -host = 127.0.0.1 -port = 6000 -``` - -After modifying and saving `seafevents.conf`, restart seafile server by `./seafile.sh restart` - -The office converter process will be started and listen on 127.0.0.1:6000 - -In `seahub_settings.py`, add the following config - -``` -OFFICE_CONVERTOR_ROOT = 'http://127.0.0.1:6000/' -``` - -Open a doc/ppt/xls file on Seahub, you should be about the previewing it in your browser. - -### Other Configurable Options - -Here are full list of options you can fine tune: - -```conf -[OFFICE CONVERTER] - -## must be "true" to enable office file online preview -enabled = true - -## How many libreoffice worker processes to run concurrenlty -workers = 1 - -## where to store the converted office/pdf files. Deafult is /tmp/. -outputdir = /tmp/ - -host = 127.0.0.1 -port = 6000 -``` - -## Version 9.0.x or above - -We use Docker to deploy LibreOffice as an example, so you need to install Docker on the server in advance (Docker installation is not introduced here). The office-preview service needs to be deployed on the same machine as the Seafile service. - -### Prepare `docker-compose.yml` - -Download and change [docker-compose.yml](./office-preview-yml/docker-compose.yml). - -``` -services: - office-preview: - image: seafileltd/office-preview:latest - container_name: seafile-office-preview - environment: - - IGNORE_JWT_CHECK=true # Usually, seafile and office-perview are deployed on the same machine and communicate through the intranet, so the jwt check can be ignored. - ports: - - "192.x.x.x:8089:8089" # 192.x.x.x is the IP address of the machine - command: bash start.sh - volumes: - - /opt/office-preview/shared:/shared # the host path can be customized -``` - -### Start `seafile-office-preview` container - -``` -docker compose up -d -``` - -Add `/opt/office-preview/shared/office_convertor_settings.py` manually. - -``` -# Make sure the SECRET_KEY is the same as value in seahub_settings.py -SECRET_KEY = "o@^yktib39k+oor2_busbcxqaach_$b5zq-)4l6l39v#8ky5ta" - -WORKERS = 10 # worker number -OUTPUT_DIR = '/shared/output' # output folder in container -PORT = 8089 # port in container -``` - -Restart `seafile-office-preview` container. -``` -docker restart seafile-office-preview -``` - -### Config seahub_settings.py - -Add the following configuration to `seahub_settings.py`. - -``` -OFFICE_CONVERTOR_ROOT = 'http://192.x.x.x:8089' # 192.x.x.x is the IP address of the machine -``` - -Restart seahub. -``` -./seahub.sh restart -``` - -## FAQ about Office document preview - -#### Document preview doesn't work, where to find more information? - -You can check the log at logs/seafevents.log - -#### My server is CentOS, and I see errors like "/usr/lib64/libreoffice/program/soffice.bin X11 error: Can't open display", how could I fix it? - -This error indicates you have not installed the `libreoffice-headless` package. Install it by `"sudo yum install libreoffice-headless"`. - -#### Document preview doesn't work on my Ubuntu/Debian server, what can I do? - -Current office online preview works with libreoffice 4.0-4.2. If the version of libreoffice installed by `apt-get` is too old or too new, you can solve this by: - -Remove the installed libreoffice: - -``` -sudo apt-get remove libreoffice* python-uno python3-uno -``` - -Download libreoffice packages from [libreoffice official site](https://downloadarchive.documentfoundation.org/libreoffice/old/) - -Install the downloaded pacakges: - -``` -tar xf LibreOffice_4.1.6_Linux_x86-64_deb.tar.gz -cd LibreOffice_4.1.6.2_Linux_x86-64_deb -cd DEBS -sudo dpkg -i *.deb -``` - -Restart your seafile server and try again. It should work now. - -``` -./seafile.sh restart -``` - -#### The browser displays "document conversion failed", and in the logs I see messages like `[WARNING] failed to convert xxx to ...`, what should I do? - -Sometimes the libreoffice process need to be restarted, especially if it's the first time seafile server is running on the server. - -Try to kill the libreoffice process with `pkill -f soffice.bin`. Then try re-opening the preview page in the brower again. If you are deploying seafile in cluster mode, make sure memcached is working on each server. - -#### The above solution does not solve my problem. - -Please check whether the user you run Seafile can correctly start the libreoffice process. There may be permission problems. For example, if you use www-data user to run Seafile, make sure www-data has a home directory and can write to the home directory. diff --git a/manual/deploy_pro/real_time_backup.md b/manual/deploy_pro/real_time_backup.md deleted file mode 100644 index bd5b5fb54..000000000 --- a/manual/deploy_pro/real_time_backup.md +++ /dev/null @@ -1,184 +0,0 @@ -# Seafile Real-Time Backup Server - -Note: This feature is deprecated and not recommended to use in production. If you're looking for backup solution: - -* If you're not using object storage, you can follow the instructions in [backup and recovery](../maintain/backup_recovery.md). -* If you're using object storage, you can use the [migration script](../deploy_pro/migrate.md) to backup the objects. - -Backup is the procedure that copies data from a primary server (which is running production service) to a backup server. - -The real-time backup server uses a syncing algorithm similar to the Seafile desktop client to retrieve data from the primary server. It works as follows: - -- Whenever a library is updated, the primary server notifies the backup server to retrieve the changed data. With a delta syncing algorithm, this procedure runs quickly and updates the backup server in nearly real-time. -- The backup server also checks all libraries on the primary server at a fixed period. Any new or updated libraries will be synced to the backup server. This will pick up any legged updates due to glitches in the above real-time sync procedure. -- The backup server always keep the database and data directory consistent. So no libraries on the backup server will be in corrupted state (unless they're already corrupted on the primary server). -- The full history of all libraries will be backed up. This is not like the desktop client, which only syncs the latest state of a library. - -There are two sets of data that need to be backed up: - -- The seafile-data directory and the core library metadata tables in the seafile database. This data is the core data structures of the libraries in Seafile. They're synced to the backup server with Seafile's syncing algorithm. In this procedure, the metadata tables are kept consistent with the seafile-data directory. -- All other tables in the database (including seafile, ccnet and seahub databases) are backed up with mysqldump. mysqldump can't back up the database in real time. You can setup a crontab for mysqldump at regular intervals. The latency of backup for these tables doesn't affect the integrity of library data. - -In the following discussion, we'll use "primary server" and "master server", "backup server" and "slave server" interchangeably. - -## Configure Real-Time Backup Server - -We assume you already have a primary server running, and now you want to set up a backup server. - -The steps to setup the backup server are: - -1. Install Seafile on the backup server -2. Configure Seafile syncing between the primary server and the backup server -3. Back up the tables in the database by `mysqldump` at regular intervals - -### Install Seafile on the Backup Server - -You should install Seafile Pro Edition on the backup server according to [this documentation](../deploy_pro/download_and_setup_seafile_professional_server.md). Since the real-time backup feature is only available for 5.1.0 or later, you also have to upgrade your primary server to version 5.1.0 or later. - -When installing Seafile on the backup server, you have to notice: - -- The database names (ccnet, seafile and seahub database) should be the same as the names on the primary server. -- You don't need to enable other Pro features, such as Office file preview, search indexing, file auditing etc. -- You can't start the seahub progress on backup server. It means that usually the Seafile backup server can't provide service. - -### Configure Real-time Backup in Seafile - -On the primary server, add following options to seafile.conf: - -``` -[backup] -backup_url = http://backup-server -sync_token = c7a78c0210c2470e14a20a8244562ab8ad509734 -``` - -On the backup server, add following options to seafile.conf: - -``` -[backup] -primary_url = http://primary-server -sync_token = c7a78c0210c2470e14a20a8244562ab8ad509734 -sync_poll_interval = 3 -``` - -- `backup_url`: the backup server's address in url format. You can use HTTP or HTTPS. -- `primary_url`: the primary server's address in url format. -- `sync_token`: a secret shared between the primary and backup server. It's a 40 character SHA1 token generated by the system admin. You can use `uuidgen | openssl sha1` command to generate a random token. -- `sync_poll_interval`: The backup server polls all libraries of the primary server periodically. You can set the poll interval in units of hours. The default interval is 1 hour, which means the backup server will poll the primary every hour. You should choose larger intervals if you have larger libraries. - -If you use HTTPS to sync between primary and backup servers, you must use the correct Seafile server package for your system. If you run CentOS, you should use the Seafile package named without the "Ubuntu" suffix; if you run Debian or Ubuntu, you should use the Seafile package named with "Ubuntu" suffix. Otherwise you may meet CA errors in HTTPS requests. - -After saving the configuration, restart the seafile service on the primary and backup servers. The backup server will automatically start backing up on restart. - -**Note**: Don't start the seahub progress on the Seafile backup server. - -### Back up the Databases - -Backup data from the databases on the primary server's MySQL with mysqldump: - -``` -mysqldump -u -p --databases \ ---ignore-table=.Repo \ ---ignore-table=.Branch \ ---ignore-table=.RepoHead \ - > dbdump.sql -``` - -You should replace ``, `` with your MySQL admin user and password. You should replace ``, `` and `` with your database names. - -The three ignored tables are core tables related to library data, and are synced by Seafile backup server in a real-time manner. They're kept in the seafile database of the backup server and are separated from the mysqldump process. - -**You should set up crontab to run the mysqldump at regular intervals.** - -If you want to back up the tables (except for the 3 tables synced by Seafile) in a more real-time manner, you can deploy the master-slave replication for the MySQL/MariaDB database from the primary node to another database server. **The database running on the backup server must not be used as the target of this replication.** Otherwise you'll end up with replication conflicts, since the db on backup server will also be updated by Seafile backup process too. - -### Checking Backup Status - -After the above setup, you should now have the below layout of your backup data: - -* Library data is backed up and managed by Seafile backup server. The data can be stored on external storage, object storage, or local disk, depending on your setup for the backup server. -* Database tables are split into two parts: - * 3 core library tables are backed up in real-time to the backup node's MySQL database. - * Other tables are regularly dumped to a file with mysqldump. The backup files are stored somewhere other than the primary server. - -`seaf-backup-cmd.sh` provides `status` command to view the backup status. The output is like: - -``` -# ./seaf-backup-cmd.sh status -Total number of libraries: xxx -Number of synchronized libraries: xxx -Number of libraries waiting for sync: xxx -Number of libraries syncing: xxx -Number of libraries failed to sync: xxx - -List of syncing libraries: -xxx -xxx - -List of libraries failed to sync: -xxx -xxx -``` - -There are a few reasons the backup of a library may fail: - -- Some data in the primary server is corrupted. The data may be in the latest state or in history. Since the backup procedure syncs the full history, corruption in history will fail the backup. -- The primary server has run seaf-fsck, which may restore a library back to an older state. - -## Restore from the Backup Server - -In the unfortunate situation where severe data corruption happens on the primary server, you can restore your service quickly directly on the backup server. The recovered service can be run directly on the backup server. - -There are tow steps to restore on the backup server: - -- Import the latest MySQL dump file into the Seafile backup server's MySQL database. -- Enable other Pro features on the Seafile backup server, and start seahub progress `./seahub.sh start`. - -#### Step1: Import MySQL dump file into backup server - -Importing the latest MySQL dump file into the backup server's database: - -``` -mysql -u -p < dbdump.sql -``` - -Replace `` and `` with your MySQL admin user name and password. - -#### Step2: Start the backup server's seahub - -Copy the seafile's configuration to the backup server, then start the seahub progress on the backup server. - -``` -./seahub.sh start -``` - -## Setup Backup Server for Seafile Cluster - -If your primary service runs as a Seafile cluster, you have two points to notice when setting up a backup server: - -1. You should only use one MySQL instance as the replication master, if you're using MariaDB cluster. -2. You have to change seafile.conf and set the `backup_url` and `sync_token` options on each Seafile node. The configuration on all primary Seafile node should be the same. They all point to the same backup server. - -Currently you cannot deploy the backup service **as** a cluster. That is, you can only use a single node as backup server. This support may be added in the future. - -## Managing the Real-time Backup Server - -`seaf-backup-cmd.sh` script is the tool for managing the backup server. The `seaf-backup-cmd.sh` script provides the following commands: - -### Manually Trigger Syncing a Library - -You can use the `sync` command to manually schedule backup of a library: - -``` -# ./seaf-backup-cmd.sh sync -``` - -The command will block until the backup is finished. - -### Handling Backup Errors - -The `--force` option of `sync` command can be used to force failing backup to complete. Permanent backup failures are usually caused by data corruption of a library in the primary server. The `--force` option asks the backup to skip corrupted objects and finish the backup. - -When you find a backup error, follow two steps: - -1. Run seaf-fsck on the primary server, for the failing libraries. Fsck fixes any corruption for the latest state of the libraries. -2. Run `seaf-backup-cmd.sh sync --force ` on the backup server. diff --git a/mkdocs.yml b/mkdocs.yml index a550e6593..5911d52c1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -127,7 +127,6 @@ nav: - Logrotate: deploy/using_logrotate.md - Open Cloud Mesh: deploy/ocm.md - Config fail2ban: security/fail2ban.md - - Real-time Backup Server: deploy_pro/real_time_backup.md - Configuration and Customization: - Outline: config/README.md - ccnet.conf: config/ccnet-conf.md