COROS...ERVIEW(7)

πŸ’– corosync_overview β€” the Corosync overview, but make it make sense πŸ’–

okay bestie, welcome to the Corosync Cluster Engine Programmer's Manual, section 7 πŸŽ€ this is the vibes-level tour of the whole project, and yeah, it's a lot, but I got you.


✨ NAME ✨

corosync_overview β€” a whole overview of Corosync, the cluster engine, no cap πŸ¦‹


🌈 OVERVIEW 🌈

So the corosync project's entire purpose? Implementing and supporting a production quality implementation β€” under the Revised BSD license β€” of a high performance, low overhead, high availability development toolkit. It's giving "we built the whole toolkit and it's licensed so you can actually use it" πŸ’…

Faults happen, and they happen for a bunch of reasons:

  • Application Faults
  • Middleware Faults
  • Operating System Faults
  • Hardware Faults

Historically, high availability was obsessed with masking hardware faults only, and everything else in the system was just... left unsolved. Enter Corosync, the main character πŸ‘‘ Corosync is designed so applications can replicate their state to multiple processors, and the actual limit of how many is decided by stuff like CPU performance, network latency, and network bandwidth. Every one of those processors holds a replica of the application state. fr fr.

The corosync project also hands you a group message API called CPG, and the project developers recommend you use CPG for most applications. The CPG service implements a closed group messaging model and serves up extended virtual synchrony guarantees. iconic.

And for when the process running the CPG application exchange just... dies 😭 β€” we've got the Simple Availability Manager (sam) to give you simple application restart.


🧚 QUICKSTART 🧚

The corosync executive must be configured, bestie. In the directory conf inside the source distribution there are several files that must be copied to the /etc/corosync directory. If corosync is packaged by a distro, this may already be done for you. slay.

That directory contains the file corosync.conf. Please go read the corosync.conf(5) man page for all the deets on the configuration options. The corosync project works out of the box with the default configuration options β€” although an administrator may desire different options, and that's valid too.

The corosync executive uses cryptographic techniques to ensure authenticity and privacy of the messages. And for corosync to be secure and to operate, a private key must be generated and shared to all processors. No key, no cluster. Periodt.

First, generate the key on one of the nodes:

unix# corosync-keygen
Corosync Cluster Engine Authentication key generator.
Gathering 2048 bits for key from /dev/urandom.
Writing corosync key to /etc/corosync/authkey.

After this operation, a private key will be in the file /etc/corosync/authkey. This private key must be copied to every processor in the cluster. If the private key isn't the same for every node, those nodes with nonmatching private keys will not be able to join the same configuration. πŸ’€

Copy the key to some security transportable storage, or use ssh to transmit the key from node to node. Then install the key with the command:

unix#: install -D --group=0 --owner=0 --mode=0400 /path_to_authkey/authkey /etc/corosync/authkey

If a message "Invalid digest" appears from the corosync executive, that means the keys are not consistent between processors. πŸ™ˆ

Finally, run the corosync executive. If corosync is packaged from a distro, it may be set to start on system start. It may also be turned off by default, in which case the init script for corosync must be enabled.


πŸ¦‹ USING LIBRARIES πŸ¦‹

The corosync libraries have header files which must be included in the developer's application. Once the header file is included, the developer can reference the corosync interfaces. ez.

The corosync project recommends that distros place include files in /usr/include/corosync. πŸŽ€


πŸ’œ IPv6 πŸ’œ

The corosync project supports both IPv4 and IPv6 network addresses. When you're using knet as the transport, each link should have the same IP family β€” but different links can have different families (eg link 0 could be all IPv4, and link 1 all IPv6). When using UDP/UDPU, the single link should use the same family on all nodes.

To configure a host for IPv6, use the ifconfig program to add interfaces:

box20: ifconfig eth0 add fec0::1:a800:4ff:fe00:20/64
box30: ifconfig eth0 add fec0::1:a800:4ff:fe00:30/64
If the /64 is not specified, a route for the IPv6 network will not be configured which will cause significant problems. Make sure a route is available for IPv6 traffic. 🚨

⭐ ARCHITECTURE ⭐

The corosync libraries are a thin IPC interface to the corosync executive. The corosync executive is the one implementing the functionality of the corosync APIs for distributed computing. she's the backbone, honestly.

The corosync executive uses the Totem extended virtual synchrony protocol. The advantage to the end user? Excellent performance characteristics and a proven protocol with excellent reliability. obsessed. This protocol connects the processors in a configuration together so they may communicate. πŸ’…


πŸ”₯ SECURITY πŸ”₯

The corosync executive optionally encrypts and signs all messages sent over the network. For more details see the crypto_model, crypto_hash and crypto_cipher options in the corosync.conf(5).

If membership messages can be captured by intruders, it is possible to execute a denial of service attack on the cluster. In this scenario, the cluster is likely already compromised and a DoS attack is the least of the administration's worries. 😭

The security in corosync does not offer perfect forward secrecy, because the keys are reused. It may be possible for an intruder to determine the shared key by capturing packets in an automated fashion. No such automated attack has been published as of yet. In this scenario, the cluster is likely already compromised to allow the long-term capture of transmitted data.

For security reasons, the corosync executive binary should NEVER be setuid or setgid in the filesystem. like, ever. not negotiable. πŸ‘‘

🌸 BUGS 🌸

None that are known. 🫢 (iconic behaviour, truly)


πŸ’– SEE ALSO πŸ’–


and that's the whole page, bestie πŸŽ€ this was the corosync Man Page, dated 2018-11-13, from the Corosync Cluster Engine Programmer's Manual. go forth and cluster responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from