brooklyncentral / clocker

Apache Brooklyn cloud native infrastructure blueprints
Apache License 2.0
429 stars 66 forks source link

Unable to deploy Application at localhost (Localmachine) #194

Open sylentprayer opened 8 years ago

sylentprayer commented 8 years ago

For testing purpose I am trying to deploy dockers on local machine. But getting following error:

First attempt to create application with YAML taken from http://brooklyncentral.github.io/clocker throws error: org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation$LocalhostMachine cannot be cast to org.apache.brooklyn.core.location.dynamic.DynamicLocation, see logs for details: Software process entity VanillaDockerApplicationImpl{id=qpmRq0FK} did not pass is-running check within the required 5m limit (5m 2s elapsed);

Second attempt to start the application again from Effectors throws error: Error invoking start at VanillaDockerApplicationImpl{id=EHYWbX2y}: java.lang.IllegalArgumentException: Ambiguous locations detected when starting VanillaDockerApplicationImpl{id=EHYWbX2y}: [LocalhostMachineProvisioningLocation{id=LROyOUaX, name=localhost}, LocalhostMachineProvisioningLocation{id=dlB7Lvtg, name=localhost}]

Is there any example for local deployment of docker containers?

Full trace: 2015-11-22 22:41:51,038 WARN Setting VanillaDockerApplicationImpl{id=qpmRq0FK} on-fire due to problems when expected running, up=false, not-up-indicators: {service.process.isRunning=No information on whether this service is running} 2015-11-22 22:41:51,038 WARN Setting VanillaDockerApplicationImpl{id=qpmRq0FK} on-fire due to problems when expected running, up=false, not-up-indicators: {service.process.isRunning=No information on whether this service is running} 2015-11-22 22:41:51,042 WARN Error invoking start at VanillaDockerApplicationImpl{id=qpmRq0FK}: java.lang.IllegalStateException: Software process entity VanillaDockerApplicationImpl{id=qpmRq0FK} did not pass is-running check within the required 5m limit (5m 2s elapsed); check failed at least once with exception: org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation$LocalhostMachine cannot be cast to org.apache.brooklyn.core.location.dynamic.DynamicLocation, see logs for details: Software process entity VanillaDockerApplicationImpl{id=qpmRq0FK} did not pass is-running check within the required 5m limit (5m 2s elapsed); check failed at least once with exception: org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation$LocalhostMachine cannot be cast to org.apache.brooklyn.core.location.dynamic.DynamicLocation, see logs for details: java.lang.ClassCastException: org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation$LocalhostMachine cannot be cast to org.apache.brooklyn.core.location.dynamic.DynamicLocation 2015-11-22 22:41:51,250 WARN Service is not up when setting running on BasicApplicationImpl{id=ilprh22n}; delayed 205ms but Sensor: service.isUp (java.lang.Boolean) did not recover from false; not-up-indicators={service-lifecycle-indicators-from-children-and-members=None of the entities are up} 2015-11-22 22:41:51,250 WARN Setting BasicApplicationImpl{id=ilprh22n} on-fire due to problems when expected running, up=false, problems: {service-lifecycle-indicators-from-children-and-members=Required entities not healthy: VanillaDockerApplicationImpl{id=EHYWbX2y}, VanillaDockerApplicationImpl{id=aXrplnyZ}, VanillaDockerApplicationImpl{id=qpmRq0FK}} 2015-11-22 22:41:51,250 WARN Setting BasicApplicationImpl{id=ilprh22n} on-fire due to problems when expected running, up=false, problems: {service-lifecycle-indicators-from-children-and-members=Required entities not healthy: VanillaDockerApplicationImpl{id=EHYWbX2y}, VanillaDockerApplicationImpl{id=aXrplnyZ}, VanillaDockerApplicationImpl{id=qpmRq0FK}} 2015-11-22 22:41:51,251 WARN Error invoking start at BasicApplicationImpl{id=ilprh22n}: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: org.apache.brooklyn.util.exceptions.CompoundRuntimeException: 3 of 3 parallel child tasks failed, 3 errors including: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at VanillaDockerApplicationImpl{id=EHYWbX2y}: java.lang.IllegalStateException: Software process entity VanillaDockerApplicationImpl{id=EHYWbX2y} did not pass is-running check within the required 5m limit (5m 2s elapsed); check failed at least once with exception: org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation$LocalhostMachine cannot be cast to org.apache.brooklyn.core.location.dynamic.DynamicLocation, see logs for details: Software process entity VanillaDockerApplicationImpl{id=EHYWbX2y} did not pass is-running check within the required 5m limit (5m 2s elapsed); check failed at least once with exception: org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation$LocalhostMachine cannot be cast to org.apache.brooklyn.core.location.dynamic.DynamicLocation, see logs for details: java.lang.ClassCastException: org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation$LocalhostMachine cannot be cast to org.apache.brooklyn.core.location.dynamic.DynamicLocation 2015-11-22 22:42:21,951 INFO REST invocation of BasicApplicationImpl{id=ilprh22n}.start[locations] {locations=F39iSm7F} 2015-11-22 22:42:21,987 WARN Error invoking start at VanillaDockerApplicationImpl{id=aXrplnyZ}: java.lang.IllegalArgumentException: Ambiguous locations detected when starting VanillaDockerApplicationImpl{id=aXrplnyZ}: [LocalhostMachineProvisioningLocation{id=LROyOUaX, name=localhost}, LocalhostMachineProvisioningLocation{id=dlB7Lvtg, name=localhost}] 2015-11-22 22:42:21,990 WARN Error invoking start at VanillaDockerApplicationImpl{id=EHYWbX2y}: java.lang.IllegalArgumentException: Ambiguous locations detected when starting VanillaDockerApplicationImpl{id=EHYWbX2y}: [LocalhostMachineProvisioningLocation{id=LROyOUaX, name=localhost}, LocalhostMachineProvisioningLocation{id=dlB7Lvtg, name=localhost}] 2015-11-22 22:42:21,991 WARN Error invoking start at VanillaDockerApplicationImpl{id=qpmRq0FK}: java.lang.IllegalArgumentException: Ambiguous locations detected when starting VanillaDockerApplicationImpl{id=qpmRq0FK}: [LocalhostMachineProvisioningLocation{id=LROyOUaX, name=localhost}, LocalhostMachineProvisioningLocation{id=dlB7Lvtg, name=localhost}] 2015-11-22 22:42:22,198 WARN Service is not up when setting running on BasicApplicationImpl{id=ilprh22n}; delayed 205ms but Sensor: service.isUp (java.lang.Boolean) did not recover from false; not-up-indicators={service-lifecycle-indicators-from-children-and-members=None of the entities are up} 2015-11-22 22:42:22,199 WARN Setting BasicApplicationImpl{id=ilprh22n} on-fire due to problems when expected running, up=false, problems: {service-lifecycle-indicators-from-children-and-members=Required entities not healthy: VanillaDockerApplicationImpl{id=EHYWbX2y}, VanillaDockerApplicationImpl{id=aXrplnyZ}, VanillaDockerApplicationImpl{id=qpmRq0FK}} 2015-11-22 22:42:22,199 WARN Setting BasicApplicationImpl{id=ilprh22n} on-fire due to problems when expected running, up=false, problems: {service-lifecycle-indicators-from-children-and-members=Required entities not healthy: VanillaDockerApplicationImpl{id=EHYWbX2y}, VanillaDockerApplicationImpl{id=aXrplnyZ}, VanillaDockerApplicationImpl{id=qpmRq0FK}} 2015-11-22 22:42:22,199 WARN Error invoking start at BasicApplicationImpl{id=ilprh22n}: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: org.apache.brooklyn.util.exceptions.CompoundRuntimeException: 3 of 3 parallel child tasks failed, 3 errors including: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error invoking start at VanillaDockerApplicationImpl{id=EHYWbX2y}: java.lang.IllegalArgumentException: Ambiguous locations detected when starting VanillaDockerApplicationImpl{id=EHYWbX2y}: [LocalhostMachineProvisioningLocation{id=LROyOUaX, name=localhost}, LocalhostMachineProvisioningLocation{id=dlB7Lvtg, name=localhost}]

ljha-CS commented 8 years ago

I am tring to deploy from Dockerfile. This is the yml used:

name: crate
location: localhost
services:
  - type: brooklyn.clocker.example.MicroserviceDockerfile
    id: crate
    name: Crate
    brooklyn.config:
      docker.containerName: crate
      docker.dockerfile.url: https://raw.githubusercontent.com/crate/docker-crate/d8ef1163d5937083a6cb8831732822d0f5d3cb84/Dockerfile
      docker.directPorts: 4200
      docker.openPorts: 4200

Application is started, but noting available on localhost:4200 and startup finished within seconds. Docker image buildup can not complete within seconds.

How to deploy docker containers locally, any example.

Graeme-Miller commented 8 years ago

@sylentprayer, firstly apologies for the delay in getting back to you. It appears that you might be trying to deploy the VanillaDockerApplication directly to local host. This application needs to be deployed to a DockerInfrastructure. The docs may not be clear enough about this, but after you have run clocker, you can add a DockerInfrastructure by clicking on the applications tab, clicking the + button, selecting Clocker and following the instructions. Please note, deploying to local host will only work on an Ubuntu, Centos or Mac machine.

Once that has been deployed, a new "my-docker-cloud" location will be available, representing that infrastructure. You can deploy a VanillaDockerApplicationImpl to the "my-docker-cloud" location.

Alternatively, you can create a MicroserviceDockerfile or MicroserviceImage application that will create the infrastructure for you.

Graeme-Miller commented 8 years ago

@pklalitjha You mentioned that the startup finished within seconds, but did it finish with a success or a failure? If you select your application and click on the activity tab, and dig around a bit, can you see it setting up and installing the docker infrastructure? Lastly, any exceptions in the logs?