当前位置: 首页 > 知识库问答 >
问题:

弹性搜索-从多个服务器移动到一个服务器

宋耀
2023-03-14

我有一个由5个服务器组成的集群用于elasticsearch,所有服务器都具有相同的elasticsearch版本。

我需要将服务器2、3、4、5的所有数据移动到服务器1。

我怎么做?

PUT _cluster/settings
{
  "persistent" : {
    "cluster.routing.allocation.require._host" : "server1"
  }
}
shards disk.indices disk.used disk.avail disk.total disk.percent host    ip      node
     6       54.5gb   170.1gb      1.9tb      2.1tb            7 *.*.*.* *.*.*.* node-5
     6       50.4gb   167.4gb      1.9tb      2.1tb            7 *.*.*.* *.*.*.* node-3
     6       22.6gb   139.8gb        2tb      2.1tb            6 *.*.*.* *.*.*.* node-2
     6       49.8gb   166.6gb      1.9tb      2.1tb            7 *.*.*.* *.*.*.* node-4
     6       54.8gb   172.1gb      1.9tb      2.1tb            7 *.*.*.* *.*.*.* node-1

以下内容:

#! Deprecation: [node.max_local_storage_nodes] setting was deprecated in Elasticsearch and will be removed in a future release!
{
  "persistent" : {
    "cluster" : {
      "routing" : {
        "allocation" : {
          "require" : {
            "_host" : "server1"
          }
        }
      }
    }
  },
  "transient" : { },
  "defaults" : {
    "cluster" : {
      "max_voting_config_exclusions" : "10",
      "auto_shrink_voting_configuration" : "true",
      "election" : {
        "duration" : "500ms",
        "initial_timeout" : "100ms",
        "max_timeout" : "10s",
        "back_off_time" : "100ms",
        "strategy" : "supports_voting_only"
      },
      "no_master_block" : "write",
      "persistent_tasks" : {
        "allocation" : {
          "enable" : "all",
          "recheck_interval" : "30s"
        }
      },
      "blocks" : {
        "read_only_allow_delete" : "false",
        "read_only" : "false"
      },
      "remote" : {
        "node" : {
          "attr" : ""
        },
        "initial_connect_timeout" : "30s",
        "connect" : "true",
        "connections_per_cluster" : "3"
      },
      "follower_lag" : {
        "timeout" : "90000ms"
      },
      "routing" : {
        "use_adaptive_replica_selection" : "true",
        "rebalance" : {
          "enable" : "all"
        },
        "allocation" : {
          "node_concurrent_incoming_recoveries" : "2",
          "node_initial_primaries_recoveries" : "4",
          "same_shard" : {
            "host" : "false"
          },
          "total_shards_per_node" : "-1",
          "shard_state" : {
            "reroute" : {
              "priority" : "NORMAL"
            }
          },
          "type" : "balanced",
          "disk" : {
            "threshold_enabled" : "true",
            "watermark" : {
              "low" : "85%",
              "flood_stage" : "95%",
              "high" : "90%"
            },
            "include_relocations" : "true",
            "reroute_interval" : "60s"
          },
          "awareness" : {
            "attributes" : [ ]
          },
          "balance" : {
            "index" : "0.55",
            "threshold" : "1.0",
            "shard" : "0.45"
          },
          "enable" : "all",
          "node_concurrent_outgoing_recoveries" : "2",
          "allow_rebalance" : "indices_all_active",
          "cluster_concurrent_rebalance" : "2",
          "node_concurrent_recoveries" : "2"
        }
      },
     ...
      "nodes" : {
        "reconnect_interval" : "10s"
      },
      "service" : {
        "slow_master_task_logging_threshold" : "10s",
        "slow_task_logging_threshold" : "30s"
      },
      ...
      "name" : "cluster01",
      ...
      "max_shards_per_node" : "1000",
      "initial_master_nodes" : [ ],
      "info" : {
        "update" : {
          "interval" : "30s",
          "timeout" : "15s"
        }
      }
    },
...

共有1个答案

乐正心水
2023-03-14

可以使用碎片分配筛选将所有数据移动到服务器1。

只需运行以下内容:

PUT _cluster/settings
{
  "persistent" : {
    "cluster.routing.allocation.require._name" : "node-1",
    "cluster.routing.allocation.exclude._name" : "node-2,node-3,node-4,node-5"
  }
}

您也可以使用_ip_host,而不是_name,这取决于哪种方式对您更实用。

PUT _all/_settings
{
  "index" : {
    "number_of_replicas" : 0
  }
}
 类似资料:
  • 这应该创建一次索引,并将数据存储到elastic Server。然而,在部署过程中,我们有时会遇到以下错误(间歇性问题)。 SampleTypeId创建(或更新)的时间有时也一样长,尽管我们特别提到它是整数。这就是问题的起因。我已经检查了数据类型,同时保存到弹性数据库以及,这看起来很好。这是否意味着弹性索引会随着每次部署而更新。对于数据库,我们做,对于弹性,我们能做同样的事情吗?我不明白为什么会发

  • 问题内容: 我需要将Jenkins 2.32版从服务器A移至Jenkins 2.72.1服务器B。两台服务器均具有ubuntu 16.04.3,由于内存问题,我无法安装任何插件,也无法在服务器A中使用该插件。有什么办法可以实现这一目标? 问题答案: 将目录中的所有文件复制到新服务器。 将新服务器指向新目录。 将Jenkins war文件(或servlet容器设置,如果有的话)复制到新机器上并启动它

  • 使用ws,Node.js WebSocket库,可以让多个服务器共享一个HTTP/S服务器。 有可能用socket.io做同样的事情吗?

  • A web server 一个 Web 服务器 Let’s finish with a complete Go program, a web server. This one is actually a kind of web re-server. Google provides a service at http://chart.apis.google.com that does automat

  • 多个同步服务器 Since you have full control of express instance lifecycle, it's not a problem to create a few multiple simultaneous servers (e.g. both HTTP & HTTPS). Example: 因为你已经可以完全控制express实例的生命周期了,所以创建多个