Bounce all Traffic Server nodes in the cluster. Bouncing Traffic Server
    shuts down and immediately restarts Traffic Server, node-by-node.

    .. code-block:: yaml

        bounce_ats_cluster:
          trafficserver.bounce_cluster
353842
def bounce_cluster(name):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    if __opts__['test']:
        ret['comment'] = 'Bouncing cluster'
        return ret

    __salt__['trafficserver.bounce_cluster']()

    ret['result'] = True
    ret['comment'] = 'Bounced cluster'
    return ret
1060064
@Override
  public void onShutdownRequest() {
    this.reefEventHandlers.onRuntimeStatus(RuntimeStatusEventImpl.newBuilder()
        .setName(RUNTIME_NAME).setState(State.DONE).build());
    this.driverStatusManager.onError(new Exception("Shutdown requested by YARN."));
  }
728567
function startWorkers(instances) {
	let stopping = false;

	cluster.on("exit", function(worker, code) {
		if (!stopping) {
			// only restart the worker if the exit was by an error
			if (production && code !== 0) {
				logger.info(`The worker #${worker.id} has disconnected`);
				logger.info(`Worker #${worker.id} restarting...`);
				cluster.fork();
				logger.info(`Worker #${worker.id} restarted`);
			} else {
				process.exit(code);
			}
		}
	});

	const workerCount = Number.isInteger(instances) && instances > 0 ? instances : os.cpus().length;

	logger.info(`Starting ${workerCount} workers...`);

	for (let i = 0; i < workerCount; i++) {
		cluster.fork();
	}

	stopSignals.forEach(function (signal) {
		process.on(signal, () => {
			logger.info(`Got ${signal}, stopping workers...`);
			stopping = true;
			cluster.disconnect(function () {
				logger.info("All workers stopped, exiting.");
				process.exit(0);
			});
		});
	});
}
300926
def _node_tag_update_loop(self):
        
        while True:
            self.tag_cache_update_event.wait()
            self.tag_cache_update_event.clear()

            batch_updates = defaultdict(list)

            with self.tag_cache_lock:
                for node_id, tags in self.tag_cache_pending.items():
                    for x in tags.items():
                        batch_updates[x].append(node_id)
                    self.tag_cache[node_id].update(tags)

                self.tag_cache_pending = {}

            for (k, v), node_ids in batch_updates.items():
                m = "Set tag {}={} on {}".format(k, v, node_ids)
                with LogTimer("AWSNodeProvider: {}".format(m)):
                    if k == TAG_RAY_NODE_NAME:
                        k = "Name"
                    self.ec2.meta.client.create_tags(
                        Resources=node_ids,
                        Tags=[{
                            "Key": k,
                            "Value": v
                        }],
                    )

            self.tag_cache_kill_event.wait(timeout=5)
            if self.tag_cache_kill_event.is_set():
                return
541785
def reset_rammbock(self):
        
        for client in self._clients:
            client.close()
        for server in self._servers:
            server.close()
        self._init_caches()
775009
def start
      @nodes.each(&:start)
      @worker = Thread.start do
        Thread.abort_on_exception = true
        catch(:shutdown) do
          loop do
            Moped.logger.debug "replica_set: waiting for next client"
            server, client = @manager.next_client

            if server
              Moped.logger.debug "replica_set: proxying incoming request to mongo"
              server.proxy(client, @mongo)
            else
              Moped.logger.debug "replica_set: no requests; passing"
              Thread.pass
            end
          end
        end
      end
    end
103127
def start(self, nodes=None):
        
        if not self.is_connected():
            return None

        nodes = nodes or self.nodes
        result = []

        for node in nodes:
            if node.state == 'running':
                logging.warning('Node %s is already "running".', node.name)
                continue
            try:
                status = self.gce.ex_start_node(node)
                if status:
                    result.append(node)
            except InvalidRequestError as err:
                raise ComputeEngineManagerException(err)

        return result
691577
def reboot(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The restart action must be called with -a or --action.'
        )

    data = show_instance(name, call='action')
    if data.get('status') == 'off':
        return {'success': True,
                'action': 'stop',
                'status': 'off',
                'msg': 'Machine is already off.'}

    ret = query(droplet_id=data['id'],
                command='actions',
                args={'type': 'reboot'},
                http_method='post')

    return {'success': True,
            'action': ret['action']['type'],
            'state': ret['action']['status']}
804562
def refresh(self):
        
        try:
            self._private_to_public = self.cloud_discovery.discover_nodes()
        except Exception as ex:
            self.logger.warning("Failed to load addresses from Hazelcast.cloud: {}".format(ex.args[0]),
                                extra=self._logger_extras)
1048829
def traffic(stack_name: str,
            stack_version: Optional[str],
            percentage: Optional[int],
            region: Optional[str],
            remote: Optional[str],
            output: Optional[str]):
    ''''''
    lizzy = setup_lizzy_client(remote)

    if percentage is None:
        stack_reference = [stack_name]

        with Action('Requesting traffic info..'):
            stack_weights = []
            for stack in lizzy.get_stacks(stack_reference, region=region):
                if stack['status'] in ['CREATE_COMPLETE', 'UPDATE_COMPLETE']:
                    stack_id = '{stack_name}-{version}'.format_map(stack)
                    traffic = lizzy.get_traffic(stack_id, region=region)
                    stack_weights.append({
                        'stack_name': stack_name,
                        'version': stack['version'],
                        'identifier': stack_id,
                        'weight%': traffic['weight']
                    })
        cols = 'stack_name version identifier weight%'.split()
        with OutputFormat(output):
            print_table(cols,
                        sorted(stack_weights, key=lambda x: x['identifier']))
    else:
        with Action('Requesting traffic change..'):
            stack_id = '{stack_name}-{stack_version}'.format_map(locals())
            lizzy.traffic(stack_id, percentage, region=region)
656927
def worker_errordown(self, node, error):
        """"""
        self.config.hook.pytest_testnodedown(node=node, error=error)
        try:
            crashitem = self.sched.remove_node(node)
        except KeyError:
            pass
        else:
            if crashitem:
                self.handle_crashitem(crashitem, node)

        self._failed_nodes_count += 1
        maximum_reached = (
            self._max_worker_restart is not None
            and self._failed_nodes_count > self._max_worker_restart
        )
        if maximum_reached:
            if self._max_worker_restart == 0:
                msg = "Worker restarting disabled"
            else:
                msg = "Maximum crashed workers reached: %d" % self._max_worker_restart
            self.report_line(msg)
        else:
            self.report_line("Replacing crashed worker %s" % node.gateway.id)
            self._clone_node(node)
        self._active_nodes.remove(node)
1264143
function restartNode() {
        try {
            _nodeConnection.domains.base.restartNode();
        } catch (e) {
            window.alert("Failed trying to restart Node: " + e.message);
        }
    }
1304115
def resume(self):
        
        log.info("Resuming cluster `%s` ...", self.name)
        failed = self._resume_all_nodes()
        for node in self.get_all_nodes():
            node.update_ips()
        self._gather_node_ip_addresses(
            self.get_all_nodes(), self.start_timeout, self.ssh_probe_timeout)
        self.repository.save_or_update(self)
        if failed:
            log.warning(
                    "Not all cluster nodes have been successfully "
                    "restarted.  Check error messages above and consider "
                    "re-running `elasticluster resume %s` if "
                    "necessary.", self.name)
            return
        if not self._setup_provider.resume_cluster(self):
            log.warning("Elasticluster was not able to guarantee that the "
                        "cluster restarted correctly - check the errors "
                        "above and check your config.")
1292396
async def disconnect(self, abort=False):
        
        if self.state == 'connected':
            await self._send_packet(packet.Packet(packet.CLOSE))
            await self.queue.put(None)
            self.state = 'disconnecting'
            await self._trigger_event('disconnect', run_async=False)
            if self.current_transport == 'websocket':
                await self.ws.close()
            if not abort:
                await self.read_loop_task
            self.state = 'disconnected'
            try:
                client.connected_clients.remove(self)
            except ValueError:  # pragma: no cover
                pass
        self._reset()
1317117
def reboot(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The stop action must be called with -a or --action.'
        )

    log.info('Rebooting node %s', name)

    instance_id = _get_node(name)['InstanceId']

    params = {'Action': 'RebootInstance',
              'InstanceId': instance_id}
    result = query(params)

    return result
651295
def pause(self):
        
        log.info("Pausing cluster `%s` ...", self.name)
        failed = self._pause_all_nodes()
        if os.path.exists(self.known_hosts_file):
            os.remove(self.known_hosts_file)
        self.repository.save_or_update(self)
        if failed:
            log.warning(
                    "Not all cluster nodes have been successfully "
                    "stopped.  Some nodes may still be running - "
                    "check error messages above and consider "
                    "re-running `elasticluster pause %s` if "
                    "necessary.", self.name)
68141
def shutdown(self):
        
        if self.lifecycle.is_live:
            self.lifecycle.fire_lifecycle_event(LIFECYCLE_STATE_SHUTTING_DOWN)
            self.near_cache_manager.destroy_all_near_caches()
            self.statistics.shutdown()
            self.partition_service.shutdown()
            self.heartbeat.shutdown()
            self.cluster.shutdown()
            self.reactor.shutdown()
            self.lifecycle.fire_lifecycle_event(LIFECYCLE_STATE_SHUTDOWN)
            self.logger.info("Client shutdown.", extra=self._logger_extras)