小编ilo*_*ejq的帖子

ElasticSearch节点故障

在 AWS 上,我的 Elasticsearch 集群从 2B 文档减少到 900M 记录

重新定位碎片:4

显示时

活跃碎片:35

活跃主分片:34

(可能不相关,但这是其余的统计数据):

节点数量:9

数据节点数量:6

未分配的分片:17

跑步时

GET /_cluster/allocation/explain
Run Code Online (Sandbox Code Playgroud)

它返回:

{
  "index": "datauwu",
  "shard": 6,
  "primary": true,
  "current_state": "unassigned",
  "unassigned_info": {
    "reason": "NODE_LEFT",
    "at": "2019-10-31T17:02:11.258Z",
    "details": "node_left[removedforsecuritybecimparanoid1]",
    "last_allocation_status": "no_valid_shard_copy"
  },
  "can_allocate": "no_valid_shard_copy",
  "allocate_explanation": "cannot allocate because a previous copy of the primary shard existed but can no longer be found on the nodes in the cluster",
  "node_allocation_decisions": [
    {
      "node_id": "removedforsecuritybecimparanoid2",
      "node_name": "removedforsecuritybecimparanoid2",
      "node_decision": "no",
      "store": {
        "found": …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services elasticsearch

4
推荐指数
1
解决办法
1万
查看次数

jq:无法使用字符串“id”索引数组

我的backup.json看起来像这样:

{
  "andres": [
    [
      {
        "id": 1,
        "email": "password",
        "username": test1,
        "password": "email@email.com",
        "name": "Dummy Account",
        "address": "123 st road",,
        "ip_address": "0.0.0.0",
        "phone": "123-123-1234",
      },
      {
        "id": 2,
        "email": "email2@email.com",
        "username": test2,
        "password": "password",
        "name": "Dummy Account",
        "address": "123 st road",,
        "ip_address": "0.0.0.0",
        "phone": "123-123-1234"
      }
    ],
  ]
}
Run Code Online (Sandbox Code Playgroud)

我正在使用命令:

jq -r '.andres[] | .id, .email, .username, .password, .name, .address, .ip_address, .phone' < backup.json > backup.csv
Run Code Online (Sandbox Code Playgroud)

但它给出了错误:

Cannot index array with string "id"
Run Code Online (Sandbox Code Playgroud)

我希望它看起来像这样:

1,email@email.com,test1,password,Dummy Account,123 st …
Run Code Online (Sandbox Code Playgroud)

arrays shell json jq

3
推荐指数
2
解决办法
2万
查看次数

标签 统计

amazon-web-services ×1

arrays ×1

elasticsearch ×1

jq ×1

json ×1

shell ×1