public function __construct(Deployer $deployer, $name, $nodes, $port)
{
if (count($nodes) < 1) {
throw new \InvalidArgumentException('You must define at least one node to deploy');
}
$this->name = $name;
$this->port = $port;
foreach ($nodes as $key => $host) {
$nName = $name . '_' . $key;
$node = new Node();
$node->setDeployer($deployer)->setName($nName)->setHost($host)->setPort($port);
$node->initialize();
$this->nodes[] = $node;
}
$this->clusterBuilder = new ClusterBuilder($this->nodes);
}