Creating a namespace


#1

Suppose I have a cluster consisting of 4 nodes: N1, N2, N3, N4. I want to create a namespace. I specify my new namespace on N1 in aerospike.conf. So, I need to restart the whole cluster.

Q1: Do I have to specify the new namespace on N2, N3, N4 in aerospike.conf as well? I guess we don’t do we? The gossip protocol should disseminate the new namespace.

Q2: How do we restart the cluster? By simply restarting the aerospike daemon /etc/init.d/aerospike restart ?


#2

Does the cluster have existing namespace and data and you want a add a new namespace or is it a brand new cluster you want to start with one or more namespaces?


#3

It is a brand new namespace. I tried /etc/init.d/aerospike restart. it worked. But I am not sure if it is the right way to restart the cluster. And what if the cluster has existing namespace and data and I want to add a new namespace?

I searched in documentation but couldn’t find info about how to restart a cluster.


#4

Namespace spans across all nodes. Node - is an aerospike process. It runs on a server - VM or physical host. In production, you will run one node on one server. (For playing around, it is possible to start multiple nodes on same server and form a cluster by separating the IP addresses.)

In a brand new cluster, you must shutdown all nodes. Edit the config file in each node. Namespace definition for config parameters identified unanimous and static in each .conf file have to be identical for the cluster to form- for example replication-factor. Other parameters such as memory size may be different but that is a seriously bad idea. (BTW, Aerospike does not check namespace memory size you specify against actual available RAM. Burden is on you to go through capacity planning upfront.) So for practical purpose, each node should have identical namespace stanza - except for perhaps device name differences. I am assuming you are running one aerospike node (process) per server. The cluster forms by each node pointing to one or more different nodes in the mesh-seed-address-port config parameters.

Once you have correctly setup all config files, start each node one by one. All nodes should have the same namespaces defined for a proper cluster to form.

Use the search tool on this forum to understand all the nuances. There are plenty of knowledge base articles and discussions on this topic. Search for “Adding a Namespace”. Aerospike does not allow adding or deleting namespaces on an active cluster. Entire cluster has to be shutdown and there are other subtleties related to preserving existing data - non-trivial to add a namespace in a running production cluster.

Since you are setting a brand new cluster, I would do: /etc/init.d/aerospike stop (on all nodes) Then, edit config file on all nodes. Then, /etc/init.d/aerospike start (node by node)

However, plan upfront for what namespace(s) you will need before getting into production.


#5

Thanks, now it’s clear. Nevertheless I should read and understand all the nuances.


#6

If you are at a point that you are seriously considering Aerospike, CE or EE, for production, you may want to explore http://www.aerospike.com/training/administration-operations/

Otherwise, this discussion forum has lots of good material.


#7

The 3.11 announcement mentioned the ability to add a namespace without needing a cluster wide restart as being slated for 3.12.


#8

Good news! :slight_smile: I am beginning to wonder about Aerospike’s stability though.


#9

What does that have to do with stability?


#10

A lot of changes from release to a release. So far only improvements and fixes. I hope there will be no a lot of depreciations, kind of “in previous version we did this way, but now we do it that way in a completely different way”. By stability I mean that when you migrate to a new version many features are deprecated or changed.


#11

That’s not what stability means in this context, but I understand your concern. The release notes are pretty clear, so it’s your choice as to when and if you update the version.


#12

The ability to add/remove namespaces with rolling restart of the cluster is added starting server version 3.13.0.1 for both Community and Enterprise versions on paxos-protocol version v5.

[AER-3485] - (KVS) Support adding/removing namespaces with rolling restart. http://www.aerospike.com/download/server/notes.html#3.13.0.1