The Akka.Cluster commands supported by Petabridge.Cmd.Host
can be added to your Petabridge.Cmd.Host
installation by installing the Petabridge.Cmd.Cluster
NuGet package:
PM> Install-Package Petabridge.Cmd.Cluster
And then inside your Akka.NET application, you can simply register the ClusterCommands
command palette with your ActorSystem
using the following syntax:
using Akka.Actor;
using Petabridge.Cmd.Cluster;
namespace Petabridge.Cmd.Host.Cluster.Sample
{
public class Program
{
private static void Main(string[] args)
{
using (var a = ActorSystem.Create("webcrawler"))
{
var cmd = PetabridgeCmd.Get(a);
cmd.RegisterCommandPalette(ClusterCommands.Instance);
cmd.Start();
a.WhenTerminated.Wait();
}
}
}
}
Available Commands Command Name Description cluster join
Has the current node JOIN one or more nodes at the specified address. cluster leave
Has the specified node LEAVE the cluster if it is currently a member. cluster down
Has the current node DOWN one or more nodes at the specified address(es). cluster down-unreachable
Has the current node DOWN all nodes that are currently UNREACHABLE. cluster status
Gets the cluster status of the current node. cluster show
Describes the current state of the cluster from the perspective of the current node. cluster leader
Returns the Address
of the current leader in the cluster. Useful for debugging purposes. cluster tail
Similar to the log tail
command, cluster tail
writes all of the cluster membership, reachability, and leader change events out to the console until stopped via Control + C. cluster join
cluster join
is only intended to be used for nodes that haven't already joined an Akka.NET Cluster.
If the current node (the one the pbm
client is connected to) is already a member of a cluster then cluster join
will fail.
cluster join
takes the following arguments:
Joining an available node.
pbm [host:port] cluster join -a akka.tcp://[email protected]:9009
cluster leave
cluster leave
takes a single optional argument: the address of the node we wish to have leave the cluster.
If the specified node is not already a member of an Akka.NET Cluster, the cluster leave
command will fail with an error message.
Current node leaves the cluster:
pbm [host:port] cluster leave
Other node gracefully leaves the cluster:
pbm [host:port] cluster leave -a akka.tcp://[email protected]:4053
cluster down
cluster down
is a useful tool in scenarios where a node in your cluster have become unreachable and it needs to be manually downed so the cluster can achieve convergence again and begin marking new members as up.
cluster down
takes the following arguments:
Downing two unreachable nodes in a cluster via their addresses.
pbm [host:port] cluster down -a akka.tcp://[email protected]:9000 -a akka.tcp://[email protected]:9000
cluster down-unreachable
cluster down-unreachable
is special version of the cluster down
command that doesn't require the end-user to specify any node addresses. Instead, the currently connected node will automatically down all nodes in the cluster who currently have a status of UNREACHABLE. If there are no unreachable nodes at the time this command is issued, it simply behaves as a no-op.
Downing two unreachable nodes in a cluster.
pbm [host:port] cluster down-unreachable
cluster show
cluster show
can be used to help visualize the current state of the cluster. It will provide the pbm
client with the list of all other members of the same cluster as the Petabridge.Cmd.Host
and will also include data such as each node's roles, reachability, and address.
Show all nodes in the cluster regardless of status, role, or reachability.
pbm [host:port] cluster show
Show all nodes in the cluster that are unreachable.
pbm [host:port] cluster show -U
Show all nodes in the cluster in role "web" that are unreachable.
pbm [host:port] cluster show -U -r "web"
cluster status
cluster status
is a lightweight version of cluster show
that shows just the status of the current node the pbm
client is connected to. cluster status
takes no arguments.
cluster leader
cluster leader
will just return the Address
of the node who is currently the leader of the cluster. It takes no arguments.
cluster tail
cluster tail
will print all of the cluster membership, reachability, and leadership change events out to the console until explicitly interrupted via Control + C.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4