# Changing a key, removing a server

A cluster changes: a machine is replaced, a server is retired, a key may have been seen by somebody who should not have. This page is about those changes. All of them are in **Server Admin, Cluster**.

## Removing a node

In the node's detail, **Identity**, **Remove**:

> Removing … takes its key out of the member list. Every server stops accepting it as soon as the change reaches it. Nothing on …'s own machine is deleted: its users, files and settings stay.

"Type … to confirm": the node's name, exactly.

Then the dialog follows the change through the cluster: "Sending the change...", "Applied on 3 of 3 servers." If a server could not be reached, it says so, and that until then that server still accepts the removed node. Bring that server back, or remove it too.

What a removal is:

- **Final.** A removed node id never becomes active again. The same machine can come back, with a new identity and a new join.
- **About trust only.** The removed server keeps running with everything it has. If it is to go for good, stop it and wipe it yourself.
- **Recorded.** Members lists removed nodes under **Removed**, with who removed them and when.

Remove a node when: a machine is retired; a machine was lost, stolen or broken into; fingerprints did not match.

A removed server says so on its own Cluster page ("This server left its cluster or was removed from it. To join or create a cluster again it needs a new identity first."), and its tile elsewhere, while it is still seen, carries the flag "Says it was removed from the cluster".

## Leaving

On the server that shall go, **More, Leave the cluster**:

> This takes this server out of the cluster …. The other servers stop accepting it. Its users and settings do not change.
>
> To join a cluster again later this server needs a new identity, which this page offers after it has left.

Leaving is removing yourself. Use it when the server is up and you are at it; use **Remove** from another server when it is not.

## A new identity

A server that left or was removed has one button on its Cluster page: **Make a new identity**.

> This makes a new key and node id for this server. A server that left a cluster, or was removed from one, needs it before it can join or create a cluster again. The old key is replaced; users and settings do not change.

It answers with the new fingerprint and node id. After that the server is like a fresh one as far as clusters go: it can join or create.

## Changing a server's key

To replace a key without taking the server out: because your rules ask for it every so often, or because a backup with the key in it went astray.

**More, Change this server's key**, on the server whose key shall change:

> A key change has two steps. First this server makes a new key, and the cluster learns it next to the old one. When every server has the new key, this server switches to it. Links stay up the whole time.

1. **Make a new key.** The dialog shows "This server's key now:" and "The new key, which the cluster is learning:". On the other servers the node carries the mark **Key change under way**.
2. When every server has the new key: **Switch to the new key**. "This server uses its new key. Its fingerprint is now: …"

If a server has not got the new key because it is down, the button reads **Switch anyway**:

> Switch anyway only when a server that does not have the new key is gone for good: it will refuse this server until it gets the new member list.

No link is dropped by a key change done in order. Users notice nothing: the key is for links between nodes, not for the certificate that users see.

The same can be started from another server, in the node's detail: **New key**.

## A lost key

A server whose key file is gone or unreadable cannot prove itself: the others refuse it, and the alert **Cluster Identity Unreadable** fires on it. There is nothing to repair. Remove the node from another server, give it a new identity, and let it join again with a code. Its users and settings are untouched by all this.

## A cloned machine

When a virtual machine is copied, or a backup is started beside the original, two processes have the same identity. The cluster notices two reports for one node id from different places, and raises **Cluster Identity Cloned**.

Stop the copy. If it shall be a server of its own, give it a new identity before it joins.

## Replacing a machine

To put a new machine in the place of an old one:

1. Install CrushMFT 27 on the new machine and let it join as a new member, with a code. Copy the users and settings over: [Joining a server](Cluster-Joining.md#copying-what-was-there-before).
2. Move the address, or the load balancer's entry, to the new machine.
3. Remove the old node.

Do not copy the old machine's `cluster` folder to the new one to "keep the identity". That is a cloned key, and the old disk still has it.

## The cluster's name and settings

**More, Rename the cluster, approvals**: the cluster's name, and whether joins wait for approval. See [Joining a server](Cluster-Joining.md#approval).

## Undoing the pairing of a DMZ

A paired DMZ accepts only the servers it knows. To free it, for a move to another cluster or after the cluster is gone, it has to be told on its own machine: see [Pairing a DMZ](DMZ-Pairing.md#undoing-a-pairing). Nothing that arrives over the network can do it.

## Things to know

- **Changes travel as the member list.** Every change is one new version of the list, merged on every server. Members shows "The newest change of the list" and how many servers it has reached.
- **Do removals first, joins second** when you are replacing a machine that may be compromised.
- **After a removal, think about what the node knew.** A server of a cluster has the users with their password hashes and the stored keys. If it was broken into, removing it stops it from talking to the cluster; it does not take back what it had. Change what matters.
- **What was tried**, when the cluster was built, on test servers on one machine: a removal reached every server, and the removed one said it was removed and by whom; a key change, with the links back after a restart; a server that rejoined with a fresh identity. These were run through the server's commands; **Change this server's key**, **Leave**, **Make a new identity**, **Compare fingerprints** and **Remove** were not pressed in the page itself. Nothing was run again for this page.
