Reason: This occurred due to the change in the IP address of your instance.
Solution: Once you have restarted then the IP of your instances then the IP will change. Either you can take a reserved instance or modify the updated master IP in the command that you are trying to run. This will resolve your issue.
For more details, refer to this Jenkins Tutorial.