Package brooklyn.location.basic

Examples of brooklyn.location.basic.SshMachineLocation


     * Delegate port operations to machine. Note that firewall configuration is
     * fixed after initial provisioning, so updates use iptables to open ports.
     */
    private void addIptablesRule(Integer port) {
        if (getOwner().getConfig(DockerInfrastructure.OPEN_IPTABLES)) {
            SshMachineLocation host = getOwner().getDockerHost().getDynamicLocation().getMachine();
            if (LOG.isDebugEnabled()) {
                LOG.debug("Using iptables to add access for TCP/{} to {}", port, host);
            }
            List<String> commands = ImmutableList.of(
                    IptablesCommands.insertIptablesRule(Chain.INPUT, Protocol.TCP, port, Policy.ACCEPT));
            int result = host.execCommands(String.format("Open iptables TCP/%d", port), commands);
            if (result != 0) {
                String msg = String.format("Error running iptables update for TCP/%d on %s", port, host);
                LOG.error(msg);
                throw new RuntimeException(msg);
            }
View Full Code Here


                for (DockerAwareProvisioningStrategy strategy : provisioningStrategies) {
                    flags = strategy.apply((Map<String,Object>) flags);
                }

                LOG.info("Provisioning new host with flags: {}", flags);
                SshMachineLocation provisioned = getProvisioner().obtain(flags);
                Entity added = getDockerInfrastructure().getDockerHostCluster().addNode(provisioned, MutableMap.of());
                dockerHost = (DockerHost) added;
                machine = dockerHost.getDynamicLocation();
            }
View Full Code Here

        }
    }

    protected void onHostAdded(Entity item) {
        synchronized (mutex) {
            SshMachineLocation machine = ((DockerHost) item).getDynamicLocation().getMachine();
            EntitySpec<WeaveContainer> spec = EntitySpec.create(getAttribute(WEAVE_CONTAINER_SPEC))
                    .configure(WeaveContainer.DOCKER_HOST, (DockerHost) item);
            WeaveContainer weave = getWeaveServices().addChild(spec);
            Entities.manage(weave);
            getWeaveServices().addMember(weave);
View Full Code Here

TOP

Related Classes of brooklyn.location.basic.SshMachineLocation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.