hellopablo / esconfig
该软件包已被废弃且不再维护。未建议替代软件包。
管理简单Elasticsearch实例的简单工具。
2.3.1
2021-05-05 16:37 UTC
Requires (Dev)
- bamarni/composer-bin-plugin: 1.2.0
This package is auto-updated.
Last update: 2021-05-05 16:37:27 UTC
README
管理简单Elasticsearch实例的简单工具。该工具会查找名为.esconfig.json的文件,并使用该文件中的定义来创建索引及其映射。如果需要,它还可以运行预热脚本以填充这些索引。
安装
手动安装,通过克隆并确保dist/esconfig.phar二进制文件在您的$PATH中;或者使用Homebrew
brew tap hellopablo/utilities
brew install hellopablo/utilities/esconfig
命令
help
渲染帮助视图
nuke
完全擦除集群,适用于从头开始。显然,请谨慎使用。
reset
删除.esconfig.json中描述的索引,并重新创建它们及其映射,但无数据
warm
调用.esconfig.json中描述的预热命令。
环境
您可以使用以下任何方法定义正在使用的环境(按特定顺序)
- 作为第二个参数,例如
esconfig warm production - 使用位于项目根目录的名为
esconfig.environment的文件,其中包含要使用的环境 - 使用
.esconfig.json的default_environment属性 - 默认,为
DEVELOPMENT
示例.esconfig.json文件
{
"host": "localhost:9200",
"warm": "php ./warm_es.php",
"host": {
"DEVELOPMENT": "192.168.99.100:32769",
"PRODUCTION": "localhost:9200",
"STAGING": "localhost:9200"
},
"warm": {
"DEVELOPMENT": "php ./warm_es.php {{__HOST__}}",
"PRODUCTION": "php ./warm_es.php {{__HOST__}}",
"STAGING": "php ./warm_es.php {{__HOST__}}"
}
"default_environment": "DEVELOPMENT",
"indexes": [
{
"name": "my-index",
"settings": {},
"mappings": {
"my-item": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
},
{
"name": "another-index",
"settings": {},
"mappings": {
"another-item": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}
]
}
路线图
- 使用symfony控制台组件
- 使用Guzzle或类似工具