These are chat archives for atomix/atomix
bootstrap. There are two ways you can bootstrap a cluster. First, you can call
bootstrapon a single mode without any arguments and then
joinother nodes to it. Second, you can call
bootstrapon all nodes and pass the full list of
Addresses on each node. That results in the cluster being started with the provided configuration, but it also requires that
bootstrapbe called on at least a majority of nodes to start the cluster. The
CompletableFuturereturned by the
joinmethods will be completed once a leader is elected. So, if you bootstrap a single node with no arguments, it will form a single node cluster, elect itself leader, and then complete the bootstrap. Then when additional nodes
jointhat cluster you call
joinwith the boostrapped node's
Address. The joining node will request to join the boostrapped node. The bootstrapped node will commit a configuration change, and once the joining node finds the leader the returned
CompletableFuturewill be completed, etc.
DEBUGlogging. Copycat prints pretty extensive logs about what's going on internally, and if you paste them I'd be glad to look at them. They should show the problem.
bootstrap()to bootstrap a single node. If that hangs then it's likely the server startup is hanging for some reason.
java -jar value-state-machine.jar path/to/log localhost:5000 localhost:5001 localhost:5002. The log path must be unique for each server if they're being run on the same machine. The first host:port is the local server's host/port and the remaining host:port tuples are remote servers.
java -jar value-client.jar localhost:5000 localhost:5001 localhost:5002to connect a client and it will start writing a bunch of commands. Then you can arbitrarily kill servers and what not to play around with it
bootstrap(new Address("localhost", 5000), new Address("localhost", 5001), new Address("localhost", 5002))in the case of the first example above
Transport, and configured
Storage. That's it.
bootstrap()should start it with no problem. The only real risks for hanging I've seen is a failure to elect a leader or a blocked event thread, but the latter shouldn't happen when the server is being started. The
ValueStateMachineexample should show everything that's necessary to start the server.
StorageLevel.MEMORYand switching to disk to avoid having to wipe out the logs if you're messing with configurations...
takeSnapshotrequests the snapshot from the state machine and
complrteSnapshotcommits it once it's safe to do so
installSnapshotinstalls the snapshot to the state machine once it's at the appropriate index