首页   快速返回

aerospike增加节点     所属分类 aerospike
https://www.aerospike.com/docs/operations/manage/cluster_mng/adding_node/index.html

Adding a node to an Aerospike cluster is an easy way to add capacity. 
Aerospike supports adding a single or multiple nodes to a running cluster 
and does not have specific requirements in the number of nodes that can be added based on the number of existing node. 
Cluster configured with Rackware would typically add the same number of nodes in each group.
This document provides the steps to follow to add a new node to an existing cluster.

向Aerospike集群添加节点是增加容量的一种简单方法。
Aerospike支持向正在运行的集群添加单个或多个节点,并且对于基于现有节点的数量可以添加的节点数量没有特定的要求。
使用Rackware配置的集群通常会在每个组中添加相同数量的节点。
本文档提供了向现有集群添加新节点的步骤。


IMPORTANT PREREQUISITES

It is important to prepare the node. To avoid any scenario of pre-existing data, the drives must be initialized. 
New SSD drives must be prepared/installed before use. 
This process erases the drives using the dd command as described in the SSD Initialization section. 

The files under the /opt/aerospike/smd folder should be removed if the node was previously in use in a different cluster. 
The system metadata files in this folder contain details about secondary index definitions, udf modules, user roles and permissions, 
truncate and truncate-namespace related information, roster information and more. 
Adding a node in a cluster with existing data from a different cluster in the smd folder would result in potentially disastrous situations.


重要的先决条件


准备节点很重要。为了避免预先存在数据的任何场景,必须初始化驱动器。
使用前必须准备/安装新的SSD驱动器。这个过程使用dd命令擦除驱动器,如SSD初始化部分所述。
如果节点以前在不同的集群中使用过,那么应该删除/opt/aerospike/smd文件夹下的文件。
此文件夹中的系统元数据文件包含关于辅助索引定义、udf模块、用户角色和权限的详细信息,truncate和truncat-namespace相关信息、名册信息等。
将来自smd文件夹中不同集群的现有数据添加到集群中的节点将导致潜在的灾难性情况。


If configured correctly, the new node will join the cluster automatically upon starting up the Aerospike daemon. 
如果配置正确,新节点将在启动Aerospike守护进程时自动加入集群。



The configuration file is by default under /etc/aerospike/aerospike.conf
Adding a node to a cluster initiates migrations to rebalance the number of partitions across all the available nodes. 
Migrations occupy various system resources, so it is advised to add a node during low traffic period. 
This data rebalancing mechanism ensures that query volume distributes evenly across all cluster nodes, 
and is persistent during node failure. Please see Auto Rebalance for more information.

默认情况下,配置文件位于/etc/aerospike/aerospike.conf下

向集群中添加节点将启动迁移,以重新平衡所有可用节点上的分区数量。
迁移占用各种系统资源,因此建议在低流量期间添加一个节点。
这种数据重新平衡机制确保查询量均匀分布在所有集群节点上,并且在节点故障期间是持久的。
有关更多信息,请参见自动再平衡。

Important points to consider when adding a new node to a cluster
The following must be enforced to ensure the node will properly join the cluster:

For both in-memory and persistent namespaces, the total memory / disk space allocated for each namespace on each node should be the same (other than transient state when changing capacity).
If the namespace is persistent the individual devices allocated to the namespace have the same capacity.
Refer to the Namespace Storage Configuration page for more information on configuring a namespace.
[Versions prior to 3.13 only] The number of namespaces are the same on all nodes in the cluster i.e. including the new incoming node.
[Versions prior to 3.13 only] The order of namespaces in the namespace section of the configuration file is preserved across nodes.


向集群添加新节点时要考虑的要点

为确保节点正确加入集群,必须执行以下操作:

对于内存中的名称空间和持久名称空间,在每个节点上为每个名称空间分配的总内存/磁盘空间应该是相同的(更改容量时的暂态除外)。
如果名称空间是持久性的,则分配给该名称空间的各个设备具有相同的容量。
有关配置名称空间的更多信息,请参阅名称空间存储配置页面。

[只在3.13之前的版本]集群中所有节点上的名称空间数量是相同的,即包括新的传入节点。
[只在3.13之前的版本]配置文件名称空间节中的名称空间顺序在节点之间保持不变。



There is no need to restart the existing nodes in the cluster to add a new node.
For the purposes of performing a rolling upgrade, Aerospike supports mixed-version clusters.
Aerospike does not, however, support long term use of clusters with nodes running different versions of the Aerospike database. 
Please see rolling upgrade for more information.

不需要重新启动集群中的现有节点来添加新节点。
为了执行滚动升级,Aerospike支持混合版本集群。
但是,Aerospike不支持长期使用具有运行不同版本的Aerospike数据库的节点的集群。
有关更多信息,请参见滚动升级。

 
As a recommendation – do not add multiple nodes simultaneously to avoid corner cases 
where the new nodes form a cluster on their own before joining the main cluster, 
adding more partition versions that would cause the subsequent duplicate resolution to be heavier. 
We recommend, as best practice, to wait for a new node to successfully join the cluster before adding the next one.

建议-不要同时添加多个节点,以避免出现死角情况,新节点在加入主集群之前单独形成集群,
添加更多的分区版本,这会导致后续的 副本解析 变得更重。
作为最佳实践,建议在添加下一个节点之前等待一个新节点成功加入集群。

Important when adding empty nodes: For server version on the older paxos and heartbeat protocol (prior to 3.13), 
it may be prefereable to wait for migrations to complete between adding empty nodes. 
The older cluster protocol would drop redundant partition copies prior to completing the migration for the partition, 
leaving some partitions (the one that would be owned by the newly added node) with 1 less copy than dictated by the replication factor. 
This adds risks of data unavailability in the unlikely event of a node leaving the cluster prior to migrations completing. 
The more new nodes added at once, the more partitions would be losing a copy putting more data at risk in case of a node leaving the cluster. 
For server versions running the new cluster protocol (3.13 and above), replica copies of a partition is kept around until the migration of the partition has completed.
The configuration file options node-id and node-id-interface are mutually exclusive.

添加空节点时非常重要:对于旧paxos和heartbeat协议(3.13之前)上的服务器版本,

最好在添加空节点之间等待迁移完成。
旧的集群协议会在完成分区迁移之前删除冗余分区副本,导致一些分区(新添加的节点将拥有的分区)比复制因子指定的复制少1。
这增加了数据不可用的风险,即使在迁移完成之前,节点不太可能离开集群。
一次添加的新节点越多,就会有越多的分区丢失一个副本,从而在节点离开集群时将更多的数据置于危险之中。
对于运行新的集群协议(3.13及以上版本)的服务器版本,将保留分区的副本,直到分区迁移完成。
配置文件选项 node-id 和  node-id-interface 是互斥的。


The older cluster protocol would drop redundant partition copies prior to completing the migration for the partition, 



Mesh mode

Multicast mode


Verify node joined the cluster
To verify the node is now a part of the cluster on any of the nodes we can issue an info commad within the asadm tool. 
For our example the info command outputs the following

Admin> info
                         Node               Node                Ip        Build   Cluster            Cluster     Cluster         Principal   Client     Uptime   
                            .                 Id                 .            .      Size                Key   Integrity                 .    Conns          .   
10.0.0.101:3000                 BB90A09E3270008    10.0.0.101:3000   E-3.11.0.2         3   F0322B636B7B0FE9   True        BB9AF1F8D270008        5   51:49:48
10.0.0.103:3000                 BB9235677270008    10.0.0.103:3000   E-3.11.0.2         3   F0322B636B7B0FE9   True        BB9AF1F8D270008       10   51:49:36
10.0.0.100:3000                 *BB9AF1F8D270008   10.0.0.100:3000   E-3.11.0.2         3   F0322B636B7B0FE9   True        BB9AF1F8D270008       10   03:05:39
Number of rows: 3


We can verify the same by searching the server log at /var/log/aerospike/aerospike.log

grep 'CLUSTER-SIZE' /var/log/aerospike/aerospike.log
You should see (from our example):

Jan 28 2017 01:00:03 GMT: INFO (info): (ticker.c:169) NODE-ID bb9af1f8d270008 CLUSTER-SIZE 3


集群节点数查看

asadm

info 

aerospike.log 日志文件查看

上一篇     下一篇
springboot2获取HttpServletRequest的三种方式

21 Questions for a Trading Plan

科创板要点

aerospike删除节点

The java.util.concurrent Synchronizer Framework 翻译

java8 Lambda 实例