-
Notifications
You must be signed in to change notification settings - Fork 204
Deployment Guidelines
Here you can find guidelines about how to use and deploy BFT-SMaRt. These are important tips that you should follow to avoid running into problems while using the library.
If a machine running a replica is not correctly configured, BFT-SMaRt may fail to obtain the proper IP address and use the loopback address instead (127.0.0.1). This phenomenom may prevent clients and/or replicas from successfully establishing a connection among them.
If some (or all) replicas are deployed/executed within the same machine (127.0.0.1), config/hosts.config
cannot have sequential port numbers (e.g., 10000, 10001, 10002, 10003). This is because each replica binds two ports: one to receive messages from clients (that are configured in 'config/hosts.config', as shown above) and other to receive message from the other replicas (chosen by getting the next port number). More generally, if replica R is assigned port number P, it will try to bind ports P (to received client requests) and P+1 (to communicate with other replicas). If this guideline is not enforced, replicas may not be able to bind all ports that are needed.
Clients requests should not be issued before all replicas have been properly initialized. Replicas are ready to process client requests when each one outputs '(DeliveryThread.run) canDeliver released.' in the console.
If you are getting timeout messages, it is possible that the application you are running takes too long to process the requests or the network delay is too high and PROPOSE messages from the leader don't arrive in time, so replicas may start the leader change protocol. To prevent that, try to increase the system.totalordermulticast.timeout
parameter in config/system.config
.
Never forget to delete the config/currentView
file after you modify config/hosts.config
or config/system.config
. If config/currentView
exists, BFT-SMaRt always fetches the group configuration from this file first. Otherwise, BFT-SMaRt fetches information from the other files and creates config/currentView
from scratch. Note that config/currentView
only stores information related to the group of replicas. You do not need to delete this file if, for instance, you want to enable the debugger or change the value of the request timeout.
Always make sure that each client uses a unique ID. Otherwise, clients may not be able to complete their operations.
Regardless of which state transfer protocol is used, developers must avoid using Java API objects like HashSet
or HashMap
, and use TreeSet
or TreeMap
instead. This is because serialization of Hash* objects is not deterministic, i.e, it generates different results for equal objects. This will lead to problems after more than 'f' replicas used the state transfer protocol to recover from failures.
When invoking the reconfiguration protocol, always propagate the current config/currentView
among processes.
Everytime you use the reconfiguration protocol, you must make sure that all replicas and the host where you invoke the above commands have the latest config/currentView
file. The current implementation of BFT-SMaRt does not provide any mechanism to distribute this file, so you will need to distribute it on your own (e.g., using the 'scp' command). You also need to make sure that any client that starts executing can read from the latest config/currentView
file.