title: Config Profiles Akka Cluster
body: <p>I am working with akka clustering and trying to setup two different configs for different environments. </p>
  
  <ul>
  <li>one for my local setup where I would be using seed nodes to start up my application</li>
  <li>two for my production Kubernetes setup. </li>
  </ul>
  
  <p>I tried the <a href="https://doc.akka.io/docs/akka/current/general/configuration.html" rel="nofollow noreferrer">Config Docs from Akka</a> that mention about the <code>-Dconfig.resource=/dev.conf</code> and <code>include application</code> in the conf files but it still keep asking for <code>akka.discovery.method</code> in <code>application.conf</code> </p>
  
  <p>Below are my two config files:</p>
  
  <p><strong>application.conf</strong></p>
  
  <pre><code>akka {
    log-config-on-start = off
  
    stdout-loglevel = "DEBUG"
    loglevel = "INFO"
    loggers = ["akka.event.slf4j.Slf4jLogger"]
    logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
  
    log-dead-letters = on
    log-dead-letters-during-shutdown = off
  
    actor {
      provider = "cluster"
    }
  
  
    cluster {
      down-removal-margin = 7s
  
      sharding {
        least-shard-allocation-strategy {
          rebalance-threshold = 1
  
          max-simultaneous-rebalance = 5
        }
      }
    }
  }
  
  akka.http.server.idle-timeout = 900s
  akka.http.client.idle-timeout = 900s
  </code></pre>
  
  <p><strong>application-seed.conf</strong></p>
  
  <pre><code>include "application"
  
  akka {
  
    actor {
      provider = "cluster"
      serializers {
        jackson-json = "akka.serialization.jackson.JacksonJsonSerializer"
      }
    }
  
    discovery.method = config
  
    remote.artery {
      canonical {
        hostname = "127.0.0.1"
        port = 2551
      }
    }
  
    cluster {
      seed-nodes = [
        "akka://MyCluster@127.0.0.1:2551"]
    }
  }
  </code></pre>
  
  <p>When I run the code with the parameter: </p>
  
  <blockquote>
    <p>-D config.resource=/application-seed.conf</p>
  </blockquote>
  
  <p>it throws me the error: </p>
  
  <blockquote>
    <p>No default service discovery implementation configured in <code>akka.discovery.method</code>. Make sure to configure this setting to your preferred implementation such as 'akka-dns' in your application.conf (from the akka-discovery module).</p>
  </blockquote>
  
  <p>Has anyone done this kind of a setup before? </p>