job "mongodb-db" {
datacenters = ["dc1"]
type = "service"
group "mongodb" {
count = 1
network {
port "mongodb" {
static = 27017
to = 27017
}
}
service {
name = "mongodb"
port = "mongodb"
check {
type = "tcp"
port = "mongodb"
interval = "10s"
timeout = "2s"
}
}
task "mongodb" {
driver = "docker"
env = {
MONGO_INITDB_ROOT_USERNAME = "admin"
MONGO_INITDB_ROOT_PASSWORD = "adminpass"
MONGO_INITDB_DATABASE = "mydatabase"
MONGO_INITDB_USERNAME = "myuser"
MONGO_INITDB_PASSWORD = "mypassword"
}
config {
image = "mongo:latest"
ports = ["mongodb"]
volumes = [
"local/mongodb_data:/data/db"
]
}
resources {
cpu = 500
memory = 1024
}
}
}
}
I keep getting this error when i include the service block in my nomad job file:
Scheduler dry-run
mongodb
1 unplaced
- Constraint
${attr.consul.version} semver >= 1.8.0
filtered 3 nodes
how can i fix this issue