manticoresoftware/manticoresearch-backup
Composer 安装命令:
composer require manticoresoftware/manticoresearch-backup
包简介
Backup tool for Manticore Search
README 文档
README
How to use
Read the official documentation for all the information about using the tool.
S3 Storage Support
See the official documentation for full details on using S3-compatible storage.
Developer documentation
Structure
| Folder | Description |
|---|---|
| bin | This directory contains various binaries to execute and also build script |
| bin/run | This script is used for run the backup script in development and use it for debug purpose |
| build | This directory is ignored by git but built binary goes there |
| src | All sources code goes here |
| src/lib | Library independent components |
| src/lib/func.php | All helper functions that required to use the script are here |
| src/main.php | This is the main entrypoint for starting the logic |
| test | All tests are here |
Philosophy
- Keep the tool as small and lightweight as possible with no/minimum external dependencies.
- Try to write the code so that we can use it in different OSes (Windows, Linux, and any other where PHP can be used).
- We can use external binaries like
rsyncor any others, but we should maintain the native behavior so that we can still use the script when there is no such dependency. - Tests should cover every new feature or extension to the script.
Backup structure
The directory with name backup-%date% is created in the --backup-dir folder. The target created directory has the following structure:
| Folder | Description |
|---|---|
| data | The path to store all files (tables) from the searchd data dir |
| config | The directory is for saving configs, mainly manticore.json and manticore.conf |
| state | The searchd state files backup dir |
| versions.json | This file contains versions of manticore where current backup was made |
Building
To build the final executable you need to to run bin/build. The executable can be found then in the ./build directory under build/manticore-backup.
We recommend using manticore-executor. In this case, the script will use the custom-built PHP binary with all required extensions to run the tool. If you are adding a new functionality which requires a specific PHP module make sure you update manticore-executor as well.
The final script is a PHP Phar archive that can be run with PHP version of 8.1.11 that contains the next extensions:
- zstd
- Phar
- Posix
Developing
To develop and run the system without building process you should use bin/run script that does all the magic.
Tests
All tests are located in the test directory.
We use PHPUnit for testing.
There are two tests: unit tests of used components and integrated tests of the whole script behavior.
Metrics
The backup tool by default sends your anonymized metrics to Manticore metrics server. It helps maintainers a lot with improving the product. We respect your privacy and you can be sure that the metrics are anonymous and no sensitive info is sent out, but if you still want to disable the telemetry, please make sure you run the tool with the flag --disable-metric or use the environment variable TELEMETRY=0.
Here are all metrics that we collect:
| Metric | Description |
|---|---|
| collector | 🏷 backup. Means this metric comes from the backup tool |
| os_name | 🏷️ Name of the operating system |
| machine_id | 🏷 Server identifier (the content of /etc/machine-id in Linux) |
| invocation | Sent when backup was invoked. Boolean |
| failed | Sent in case the backup was failed. Boolean |
| done | Sent when the backup/restore was successful. Boolean |
| arg_* | What arguments you used to run the tool (skipping all your index names etc.) |
| backup_store_versions_fails | Indicates that it failed to save your Manticore version in the backup |
| backup_table_count | Total count of backed up tables |
| backup_no_permissions | Failed to backup due to no permissions to destination dir |
| backup_total_size | Total size of the full backup |
| backup_time | How long it took to backup |
| restore_searchd_running | Failed to run restoring process due to searchd being running already |
| restore_no_config_file | No config file in the backup on restore |
| restore_time | How long it took to restore |
| fsync_time | How long it took to fsync |
| restore_target_exists | It occurs when there's a folder or index in the destination folder to restore to |
| terminations | In case the process was terminated |
| signal_* | What signal was used to terminate the process |
| tables | How many tables Manticore holds |
| config_unreachable | Passed configuration file does not exist |
| config_data_dir_missing | Failed to parse data_dir from the passed configuration file |
| config_data_dir_is_relative | data_dir path in the configuration file of the Manticore instance is relative |
manticoresoftware/manticoresearch-backup 适用场景与选型建议
manticoresoftware/manticoresearch-backup 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 23.82k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2022 年 10 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「search」 「backup」 「manticoresearch」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 manticoresoftware/manticoresearch-backup 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 manticoresoftware/manticoresearch-backup 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 manticoresoftware/manticoresearch-backup 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Client for Manticore Search
A SDK for working with B2 cloud storage.
A Laravel package to retrieve data from Google Search Console
Indexed Search Autocomplete - Extends the TYPO3 Core Extension Indexed_Search searchform with an autocomplete feature.
ManticoreSearch vector store bridge for Symfony AI
A sleek PHP wrapper around rclone with Laravel-style fluent API syntax
统计信息
- 总下载量: 23.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 15
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2022-10-12