protected function findAvailableConnection()
    {
        $servers = $this->credentials;
        shuffle($servers);
        $previous = null;

        foreach ($servers as $server) {
            try {
                $node = $this->getNodeConnection($server);
            } catch (ConnectionException $e) {
                $previous = $e;
                continue;
            }

            if ($node->isConnected()) {
                return $node;
            }
        }

        throw new ConnectionException('No servers available', 0, $previous);
    }