magneticio / vamp

Vamp - canary releasing and autoscaling for microservice systems
http://vamp.io
Apache License 2.0
623 stars 55 forks source link

Always 'localhost' is injected as environment variable #327

Closed zutherb closed 8 years ago

zutherb commented 9 years ago

Since i am using vamp 0.7.9 'localhost' is always injected as environment variable to the created containers. Unfortunately with this environment variable the containers can't access the haproxy. I am using the shop blueprint.

screen shot 2015-08-14 at 09 54 25

Is it possible that this is a configuration problem? My application.conf looks like:

vamp.core {

  persistence {
    response-timeout = 5 # seconds
    storage-type: "jdbc" # jdbc, elasticsearch or in-memory
    jdbc {
      database-schema-name = ""
      # PostgreSQL
      slick-driver = "scala.slick.driver.PostgresDriver$"
      provider = {
        url = "jdbc:postgresql://master1/vamp"
        user = "vamp"
        password = "vamp"
        connectionPool = disabled
        keepAliveConnection = true
      }
    }
    elasticsearch {
      url = "http://master1:9200"
      response-timeout = 5 # seconds, timeout for elasticsearch operations
      index = "vamp-persistence"
    }
  }

  container-driver {
    type = "marathon"
    url = "http://master1:8080"
    response-timeout = 30 # seconds, timeout for container operations
  }

  dictionary {
    port-range = 33000-43000
    default-scale {
      instances: 1
      cpu: 1
      memory: 1024
    }
    response-timeout = 5 # seconds, timeout for container operations
  }

  rest-api {
    interface = 0.0.0.0
    host = "master1"
    port = 8081

    info {
      message = "Hi, I'm Vamp! How are you?"
      timeout = 5 # seconds, response timeout for each component (e.g. Pulse, Router...)
    }

    response-timeout = 10 # seconds, HTTP response timeout
  }

  router-driver {
    url = "http://master1:10001"
    host = "master1" # note: host of cluster hosts will have this value (e.g. db.host)
    response-timeout = 30 # seconds, timeout for container operations
  }

  pulse {
    url = "http://master1:8083"
    elasticsearch {
      url = "http://master1:9200"
      index {
        name = "vamp"
        time-format.event = "YYYY-MM-dd"
      }
    }
    response-timeout = 30 # seconds, timeout for pulse operations
  }

  operation {
    synchronization {
      period = 1 # seconds, synchronization will be active only if period is greater than 0

      mailbox {
        // Until we get available akka.dispatch.NonBlockingBoundedMailbox
        mailbox-type = "akka.dispatch.BoundedMailbox"
        mailbox-capacity = 10
        mailbox-push-timeout-time = 0s
      }

      timeout {
        ready-for-deployment: 600 # seconds
        ready-for-undeployment: 600 # seconds
      }
    }

    sla.period = 5 # seconds, sla monitor period
    escalation.period = 5 # seconds, escalation monitor period

    workflow {
      enabled = false // In order to avoid boot errors, flag should be set to true only for "in-memory" or "elasticsearch" persistence.
      http {
        timeout = 30 # seconds, maximal http request waiting time
      }
      info {
        timeout = 10 // seconds
        component-timeout = 5 // seconds
      }
    }
  }
}

akka {

  loglevel = "INFO"
  log-dead-letters = on
  log-config-on-start = off
  loggers = ["akka.event.slf4j.Slf4jLogger"]
  event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]

  actor.default-mailbox.mailbox-type = "akka.dispatch.SingleConsumerOnlyUnboundedMailbox"

  default-dispatcher.fork-join-executor.pool-size-max = 32
  jvm-exit-on-fatal-error = false
}

spray.can {

  server {
    server-header = ""
    ssl-encryption = off
    pipelining-limit = 1
    idle-timeout = 60 s
    request-timeout = 10 s
    verbose-error-messages = off
    automatic-back-pressure-handling = on
    back-pressure {
      noack-rate = 10
      reading-low-watermark = infinite
    }
    ssl-tracing = off
  }
}
tnolet commented 9 years ago

@zutherb That value comes from the host value in this configuration snippet. This is probably parsed to localhost on your machine (where master1 hostname == localhost). Try putting the exact IP address of the box where Vamp Router is running there and where all mesos slaves can reach that machine.

  router-driver {
    url = "http://master1:10001"
    host = "master1" # note: host of cluster hosts will have this value (e.g. db.host)
    response-timeout = 30 # seconds, timeout for container operations
  }

Setting up Vamp Router is by far the trickiest part of Vamp. We updated the docs on it very recently: http://vamp.io/documentation/installation/configuration/#router-driver