inzh/elasticsearch-high-level-dump 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

inzh/elasticsearch-high-level-dump

最新稳定版本:v1.0.0

Composer 安装命令:

composer require inzh/elasticsearch-high-level-dump

包简介

Tool for create or restore high level dump for cluster elasticsearch with search/scroll method

README 文档

README

A tool for creating and restoring dump on cluster Elasticsearch with search/scroll method.

Minimum PHP Version Minimum Elasticsearch Version

Installation

You can install this tool in your PHP project using composer:

composer require inzh/elasticsearch-high-level-dump

Usage

⚠️ All indexs is read with search/scrool method, and written with bulk method, use with caution for preserve data integrity.

Bash:

You can use this tool in cli context.

For dump process :

./vendor/bin/edump

For restore process :

./vendor/bin/erestore 

All options :

  1. The --gzip option Use GZip compression for restore or dump.

  2. The -b, --buffer option Set buffer for read on write, big buffer need more memory: 1000

  3. The -o, --output option Set output path file or stream, default on standart output: /var/dir/file

  4. The -i, --input option Set input path file or stream, default on standart input: /var/dir/file

  5. The -es-host option Set Elasticsearch service hostname or ip: localhost

  6. The -es-port option Set Elasticsearch service port: 9200

Exemple :

./vendor/bin/edump --gzip -b 1000 -es-host localhost -es-port 9200 > output.json.gz
cat output.json.gz | ./vendor/bin/erestore --gzip -b 1000 -es-host localhost -es-port 9200

./vendor/bin/edump --gzip -b 1000 -es-host localhost -es-port 9200 -o output.json.gz
./vendor/bin/erestore --gzip -b 1000 -es-host localhost -es-port 9200 -i output.json.gz

Development:

You can use directly process class in your code.

For dump process :

use inzh\elasticsearch\dump\HighLevelDump;

$client = $yourInstanceOfClient; // Your elasticsearch client
$options = new \stdClass; // .... See all options in next section

$process = new HighLevelDump($client, $options);
$process->dump();

For restore process :

use inzh\elasticsearch\dump\HighLevelRestore;

$client = $yourInstanceOfClient; // Your elasticsearch client
$options = new \stdClass; // .... See all options in next section

$process = new HighLevelRestore($client, $options);
$process->restore();

All options :

// All options parameters
$options = new \stdClass;
$options->buffer = 1000;
$options->gzip = false;
$options->output = "php://stdout"; // Stream or filePath
$options->input = "php://stdin"; // Stream or filePath
$options->host = "localhost";
$options->port = 9200;

© 2011-2022 [InZH] Studio.

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: CC-BY-4.0
  • 更新时间: 2022-09-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固