Courseiva

HashiCorp Certified: Consul Associate (Consul 1.15) (Consul 1.15) (Consul 1.15) — Questions 76–150

265 questions total · 4 pages · All types, answers revealed

Page 1

Page 2 of 4

Page 3
76
MCQeasy

An operator registers a service with a script health check that runs a custom binary. The binary exits with status code 1. What status will Consul assign to the service's health check?

A.critical
B.maintenance
C.passing
D.warning
AnswerA

For script health checks, Consul interprets the exit code: 0 means passing, 1 means warning, and any other non-zero code means critical. However, in Consul 1.15, the behavior is that exit code 1 is actually treated as critical for script checks. This is because the script check does not differentiate between warning and critical; any non-zero exit code results in a critical status. Therefore, the service will be marked critical.

Why this answer

In Consul, script health checks use the exit code of the script to determine health status. An exit code of 0 indicates passing, while any non-zero exit code indicates a failure. Specifically, Consul treats exit code 1 as critical for script checks, not warning.

Therefore, when the custom binary exits with 1, the check status becomes critical, and the service is considered unhealthy.

Exam trap

The trap here is assuming that exit code 1 corresponds to a warning state, as it might in some other systems, but Consul script checks treat any non-zero exit as critical.

77
Multi-Selecteasy

Which THREE of the following are true about Consul KV keys?

Select 3 answers
A.Keys must start with a slash
B.Keys support storing binary data
C.Keys are case-sensitive
D.Keys cannot contain spaces
E.Keys can be organized in a folder-like hierarchy
AnswersB, C, E

Consul KV values are stored as raw byte arrays rather than text-only strings, so arbitrary binary payloads survive intact. This satisfies the stem's requirement, letting operators store certificates, images or serialised blobs directly without encoding them first.

Why this answer

Option B is correct because Consul KV values are stored as raw bytes, so any binary data (not just UTF-8 text) can be written and retrieved via the KV API or `consul kv put`/`consul kv get`. Option C is correct because Consul KV keys are case-sensitive, meaning `App/Config` and `app/config` are distinct keys. Option E is correct because keys use slash-delimited paths such as `service/web/port`, giving a folder-like hierarchy that can be listed with `consul kv get -recurse` or the `?recurse` API parameter.

Option A is wrong because a leading slash is not required; keys like `foo/bar` are valid without one. Option D is wrong because spaces are permitted in Consul KV keys (they are just bytes in the key string), so there is no rule forbidding them.

Exam trap

The trap is assuming KV keys follow filesystem rules like requiring a leading slash or disallowing spaces — candidates often over-apply Unix path conventions, but Consul KV keys are flexible byte strings with only case-sensitivity and hierarchy via slashes as notable properties.

78
Multi-Selectmedium

Which TWO of the following are true regarding the Consul Service Catalog?

Select 2 answers
A.It provides a unified view of all services in the cluster.
B.It is replicated across the cluster using Raft.
C.It is strictly read-only.
D.It is only accessible via the CLI.
E.It is stored in the local disk of every agent.
AnswersA, B

The catalog is the source of truth.

Why this answer

The catalog is replicated via Raft and can be queried via API or DNS.

79
MCQmedium

You want to delete a key and all its children in the KV store using the CLI. Which flag should you use?

A.-force
B.-recurse
C.--all
D.--cascade
AnswerB

The -recurse flag makes the delete operation walk the key's entire subtree, removing the key and every child beneath it in one command. Without it, Consul deletes only the single key, leaving children orphaned, so this satisfies the requirement to remove the key and all its children.

Why this answer

The -recurse flag in the CLI allows the delete operation to act on the key and all nested keys.

80
MCQhard

What is the primary benefit of using a Mesh Gateway in a Consul Connect architecture?

A.It enables communication between services in different datacenters.
B.It encrypts traffic at the storage layer.
C.It improves local mTLS performance.
D.It provides load balancing for local services.
AnswerA

Mesh gateways provide a single entry point that routes Consul Connect traffic between datacenters, letting services in separate datacenters reach each other without direct network peering or sidecar-to-sidecar links across WAN boundaries. This satisfies the stem's cross-datacenter communication requirement, unlike ingress gateways, which only expose services within one datacenter.

Why this answer

Mesh gateways provide a single point of ingress/egress for cross-datacenter traffic, reducing the need for direct cross-DC networking.

81
MCQmedium

Which Consul API endpoint is used to create a new session that can be used for locking KV keys?

A./v1/kv/acquire
B./v1/session/create
C./v1/lock/init
D./v1/session/renew
AnswerB

Consul creates lock sessions through the session endpoint, which returns a session ID used as the lock-delimiter when acquiring KV locks. The /v1/session/create path is the documented API for this, unlike destroy or renew operations.

Why this answer

The correct endpoint is /v1/session/create because it is specifically designed to create a new session in Consul. Sessions are the foundation for distributed locks and KV key acquisition. When you create a session, Consul returns a session ID that can be used with the KV acquire endpoint to obtain a lock on a key.

This endpoint accepts parameters like name, TTL, and behavior on invalidation, allowing fine-grained control over lock semantics.

Exam trap

Consul 1.15 often tests the distinction between session creation and KV lock acquisition, so candidates may confuse /v1/kv/acquire with /v1/session/create, forgetting that a session must exist before a lock can be acquired.

How to eliminate wrong answers

Option A is wrong because /v1/kv/acquire is used to acquire a lock on a KV key using an existing session, not to create a new session. Option C is wrong because /v1/lock/init does not exist in Consul's API; it is a fabricated endpoint. Option D is wrong because /v1/session/renew is used to renew an existing session's TTL, not to create a new session.

82
MCQmedium

In a multi-datacenter environment, what happens if the 'primary_datacenter' server cluster becomes unavailable?

A.Secondary datacenters elect a new primary.
B.Secondary datacenters continue to operate, but ACL updates are blocked.
C.All secondary datacenters immediately shut down.
D.The entire WAN federation is dismantled.
AnswerB

Secondary datacentres keep serving their local workloads because each maintains its own replicated state, but ACL token and policy updates originate from the primary and cannot propagate. The outage therefore blocks only ACL changes, not ongoing operations.

Why this answer

In Consul's multi-datacenter model, the primary datacenter is authoritative for ACL token replication and certain global operations. If the primary becomes unavailable, secondary datacenters continue serving their local services and DNS/HTTP queries, but ACL updates and token replication are blocked until the primary returns. This design prioritizes availability of local service discovery over global consistency.

Exam trap

Consul 1.15 often tests the assumption that losing the primary triggers automatic failover or total shutdown, when in reality secondaries keep running with ACL replication paused.

How to eliminate wrong answers

Option A is wrong because Consul does not automatically elect a new primary datacenter; primary designation is a static configuration (primary_datacenter) and requires manual intervention to change. Option C is wrong because secondary datacenters are designed for fault isolation and continue operating independently rather than shutting down. Option D is wrong because WAN federation is not dismantled; the secondary datacenters remain federated and simply cannot receive ACL updates from the unavailable primary.

83
MCQmedium

You are deploying a blue/green release where the active environment is selected by the value of the Consul KV key `deploy/active-color`, currently set to `blue`. Your CI pipeline must atomically switch the value to `green` but only if the current value is still `blue`, and must fail if another pipeline already changed it. Which API operation should the pipeline use?

A.A `PUT` to `/v1/txn` that writes the new value and deletes the old one in the same transaction, using the key name as the version token.
B.A `PUT` to `/v1/kv/deploy/active-color` after acquiring a Consul session lock on the same key using `/v1/kv/deploy/active-color?acquire=<session>`.
C.A `PUT` to `/v1/kv/deploy/active-color?flags=1` with the body `green`, relying on the flags bit to reject concurrent writers.
D.A `PUT` to `/v1/kv/deploy/active-color` with the `cas` query parameter set to the `ModifyIndex` of the current `blue` value.
AnswerD

The check-and-set (`cas`) parameter makes the write succeed only when the key's current `ModifyIndex` equals the supplied value. Reading the key first to capture that index, then writing with `cas`, gives the pipeline an atomic compare-and-swap that fails if another pipeline already changed the value, exactly the guard the blue/green switch requires.

Why this answer

Atomic conditional writes in Consul KV are performed with the check-and-set mechanism: the client reads the key to learn its `ModifyIndex`, then issues a write carrying that index in the `cas` parameter. If the stored index no longer matches, the write is rejected and the pipeline knows another actor modified the key. This gives exactly the fail-if-changed semantics a blue/green switch needs.

Exam trap

The trap here is assuming the `flags` field or a session lock provides optimistic concurrency control on the value itself, when only the `cas` parameter compares the stored `ModifyIndex`.

84
MCQmedium

A Consul service is registered with a TTL health check. The application owner wants the service to be marked unhealthy automatically if the application stops sending heartbeats, without requiring a separate check script or endpoint. The application can send heartbeats every 10 seconds. Which TTL check configuration should be used to mark the service unhealthy after no heartbeat is received for 30 seconds?

A.check { ttl = "30s", status = "passing" }
B.check { ttl = "10s" }
C.check { interval = "30s", timeout = "10s" }
D.check { ttl = "30s" }
AnswerD

A TTL check is marked critical when the TTL expires without an update. Setting ttl = "30s" means the service remains passing as long as the application sends a heartbeat at least every 30 seconds. This matches the requirement to mark the service unhealthy after 30 seconds without a heartbeat, and no external script or HTTP endpoint is needed.

Why this answer

A TTL check expires and becomes critical if no heartbeat is received within the configured ttl duration. Setting ttl to 30 seconds aligns with the requirement to mark the service unhealthy after 30 seconds without a heartbeat. The interval, timeout, and status fields do not replace the ttl field for heartbeat-based checks.

Exam trap

The trap here is confusing TTL checks with interval-based checks and assuming that interval or timeout controls heartbeat expiration.

85
MCQhard

When a service check transitions to 'critical', what does Consul do with the service's DNS entry?

A.It marks the record as 'stale'.
B.It removes the instance from the DNS response.
C.It returns the IP but with a low TTL.
D.It returns a 503 status code.
AnswerB

Consul's DNS interface only returns instances whose health checks are passing. A check transitioning to critical marks the instance unhealthy, so it is omitted from the service's DNS response, preventing clients from resolving to the failed node.

Why this answer

When a service check transitions to 'critical', Consul's DNS interface automatically removes that service instance from DNS query results. This is because Consul's DNS server only returns instances that are considered healthy (passing checks). The DNS entry for the service as a whole may still exist if other instances are healthy, but the critical instance is excluded.

This behavior ensures that clients using DNS for service discovery do not route traffic to unhealthy instances.

Exam trap

The trap here is confusing Consul's DNS behavior with HTTP API behavior or assuming that DNS can convey health status via TTL or status codes; candidates might think Consul returns the IP with a low TTL to indicate issues, but it actually removes the instance entirely.

How to eliminate wrong answers

Option A is wrong because Consul does not mark DNS records as 'stale'; staleness in Consul refers to potentially outdated information due to network partitions or stale reads, not to health status. Option C is wrong because Consul does not return the IP with a low TTL for critical services; it removes the instance entirely from DNS responses. Option D is wrong because DNS does not use HTTP status codes like 503; Consul's DNS interface returns standard DNS responses (e.g., NXDOMAIN or empty answer sections) and does not include HTTP status codes.

86
MCQeasy

When using the Consul KV store, what is the maximum size allowed for a single value in a key?

A.There is no limit.
B.128 KB
C.1 MB
D.512 KB
AnswerD

Consul's KV store caps each individual value at 512 KB, a hard limit imposed by the Raft replication and storage layer. Larger payloads must be split across multiple keys or stored externally, so 512 KB is the precise maximum for a single key's value.

Why this answer

The Consul KV store enforces a maximum value size of 512 KB per key. This limit is a hard constraint imposed by the Raft consensus protocol, which replicates all writes across the cluster. Values larger than 512 KB are rejected by the server to prevent excessive memory usage and network overhead during replication.

This is documented in the official Consul limits and is consistent across versions, including 1.15.

Exam trap

The trap here is assuming that Consul KV has no size limit or confusing it with other systems that allow larger values, leading candidates to overlook the documented 512 KB maximum.

How to eliminate wrong answers

Option A is wrong because Consul does impose a hard limit on KV value size; claiming no limit is a misconception that ignores Raft's replication constraints. Option B is wrong because 128 KB is not the maximum; it is smaller than the actual limit and may be confused with other systems' defaults. Option C is wrong because 1 MB exceeds the actual limit; Consul rejects values larger than 512 KB, so 1 MB is not allowed.

87
MCQeasy

You are configuring a health check that should be considered passing as long as the HTTP response code is in the 2xx range. Which HTTP check configuration achieves this?

A.Set `status: "passing"` in the check definition.
B.Set `method: "GET"` and `header: { "Accept": ["application/json"] }`.
C.Use the default HTTP check without specifying any `status` codes.
D.Add `tls_skip_verify: true` to the check.
AnswerC

By default, an HTTP check in Consul considers any response code in the 2xx range as passing. If no explicit status codes are configured, the check uses this default behavior. Therefore, simply defining an HTTP check with a URL and interval will treat 2xx responses as healthy. This directly satisfies the requirement without additional configuration.

Why this answer

Consul's HTTP check by default treats any 2xx response code as passing. No additional configuration is needed to achieve this behavior; specifying a URL and interval is sufficient. Other options either set initial status, control request formatting, or manage TLS verification, none of which alter the default status code evaluation.

The correct choice is to rely on the default behavior.

Exam trap

The trap here is thinking that an explicit status code range must be configured to treat 2xx responses as passing, when that is already the default for HTTP checks.

88
MCQeasy

A developer registers a service called 'web' with a sidecar proxy in a Consul 1.15 datacenter. The service needs to call a backend service named 'api' through the mesh. The developer adds an upstream block to the 'web' service definition pointing to 'api' on port 8080. What does this upstream configuration accomplish for the 'web' sidecar proxy?

A.It configures the 'web' sidecar to accept inbound connections from 'api' on port 8080.
B.It enables mTLS between 'web' and 'api' by generating a shared certificate for both services.
C.It creates a local listener on the 'web' sidecar that forwards traffic to an 'api' proxy instance on port 8080.
D.It registers 'api' as a dependency in the Consul catalog so that 'web' can discover its IP address directly.
AnswerC

An upstream entry causes the web sidecar to open a local port that the web application connects to. The sidecar then forwards that traffic through the mesh to a healthy api proxy instance, using the port specified in the upstream. This decouples the application from service discovery and lets Connect handle mTLS and load balancing.

Why this answer

Upstreams are declared in the calling service's definition and cause its sidecar proxy to open a local listener. The application connects to that local port, and the proxy forwards traffic to a healthy instance of the upstream service through the mesh. This provides service discovery, mTLS, and load balancing without the application knowing backend addresses.

Exam trap

The trap here is reversing the direction, assuming an upstream controls inbound access rather than outbound connectivity from the local service.

89
MCQmedium

An operator wants to query the Consul catalog for all nodes that provide a service named `api` in the `us-east` datacenter. They need to retrieve the node names and addresses. Which Consul HTTP API endpoint should they use?

A.`GET /v1/agent/services`
B.`GET /v1/catalog/nodes?dc=us-east`
C.`GET /v1/health/service/api?dc=us-east`
D.`GET /v1/catalog/service/api?dc=us-east`
AnswerD

The `/v1/catalog/service/:service` endpoint returns the nodes and service instances for a given service. Adding `?dc=us-east` specifies the datacenter. The response includes node names, addresses, and service details. This is the correct endpoint to retrieve all nodes providing the `api` service in the specified datacenter.

Why this answer

The `/v1/catalog/service/:service` endpoint is designed to return all nodes and service instances for a specific service, optionally filtered by datacenter using the `dc` parameter. The health endpoint is more focused on health status, while the nodes endpoint lists all nodes. The agent services endpoint is local only.

Exam trap

The trap here is confusing the catalog service endpoint with the health service endpoint, which also returns node information but is filtered by health status.

90
MCQmedium

A developer notices that the application process in a Connect-enabled pod connects to 127.0.0.1:8080 to reach an upstream, but the sidecar proxy's actual listener was assigned a different port. The application is failing to reach the upstream. Which action should the developer take to provide a predictable local address for the upstream?

A.Change the application to connect to the upstream service's registered LAN address directly.
B.Add a 'port' field to the upstream block that matches the destination service's port.
C.Set 'local_bind_port' in the upstream definition to 8080 and restart the sidecar.
D.Register the application with a 'tagged_addresses' entry pointing to the sidecar's port.
AnswerC

The local_bind_port field fixes the port on which the sidecar listens for that upstream. Assigning 8080 makes the application's hard-coded address valid. After updating the registration and restarting the sidecar, the listener binds to the chosen port and forwards to the upstream over the mesh.

Why this answer

Upstream listeners are configured per consuming sidecar. When no local bind port is specified, Consul chooses an ephemeral port, which breaks applications that assume a fixed address. Explicitly setting local_bind_port to the expected value gives the application a stable local endpoint that the sidecar forwards over the mesh.

Exam trap

The trap here is assuming the sidecar always listens on the destination service's port, when without local_bind_port it picks an ephemeral port instead.

91
MCQmedium

You are deploying a Consul cluster across three datacenters: dc1, dc2, and dc3. Each datacenter has its own LAN gossip pool and they are all joined via WAN gossip. You want to enable cross-datacenter service discovery so that services in dc1 can discover services in dc2 and dc3. Which Consul feature allows a service in one datacenter to query services in another datacenter without additional configuration?

A.Service mesh with intentions
B.DNS interface with datacenter parameter
C.Prepared queries
D.Network segments
AnswerB

Consul's DNS interface allows querying services in other datacenters by appending the datacenter name to the query, such as service.service.dc2.consul. This works out of the box once WAN federation is established. No additional configuration is needed beyond the initial federation. This is the standard way to perform cross-datacenter service discovery.

Why this answer

Consul's DNS interface supports querying services in other datacenters by including the datacenter in the query name. Once WAN federation is established, a service in dc1 can query a service in dc2 by using the format <service>.service.<dc>.consul. This requires no extra configuration beyond the initial federation, making it the correct answer.

Exam trap

The trap here is overcomplicating cross-datacenter discovery; many think advanced features like prepared queries are needed, but the DNS interface handles it natively once federation is set up.

92
MCQmedium

When providing a session TTL, what is the minimum duration allowed?

A.10 seconds
B.30 seconds
C.5 seconds
D.1 second
AnswerA

A session TTL of 10 seconds is the minimum Consul permits; any lower value is rejected. This satisfies the stem's constraint by matching Consul's documented lower bound for session TTLs, ensuring the lock-delay and health-check timing mechanisms retain meaningful granularity rather than collapsing into effectively immediate expiry.

Why this answer

Consul enforces a minimum session TTL of 10 seconds; any value below this is rejected by the agent. This floor prevents excessively chatty heartbeat traffic that would overwhelm the gossip protocol and server resources. The correct answer is therefore 10 seconds.

Exam trap

The trap here is confusing a 'typical' or 'recommended' TTL with the enforced minimum — candidates often pick 30 seconds because it sounds like a sensible default, but Consul's hard floor is 10 seconds.

How to eliminate wrong answers

Option B is wrong because 30 seconds is a valid TTL but not the minimum — Consul accepts values well below 30 seconds down to the 10-second floor. Option C is wrong because 5 seconds is below the enforced minimum and would be rejected by the Consul agent. Option D is wrong because 1 second is far below the minimum and would generate unsustainable heartbeat load, so Consul refuses it.

93
MCQmedium

You are designing a distributed leader election system using Consul. A service instance must hold a lock on the KV key 'service/leader' to become the leader. You need to ensure that if the instance crashes or loses network connectivity, the lock is automatically released so another instance can acquire it. Which Consul feature should you use to achieve this?

A.Consul sessions with a TTL and the acquire parameter on a KV PUT request
B.Consul watches on the KV key with a script that releases the lock
C.Consul KV key with a long TTL and manual cleanup by an operator
D.Consul prepared queries with failover to another datacenter
AnswerA

Consul sessions provide a mechanism for liveness checking. When you create a session with a TTL and use the acquire parameter on a KV PUT, the key is locked to that session. If the session expires due to missed TTL heartbeats, Consul automatically releases the lock, allowing another instance to acquire it. This is the standard way to implement leader election.

Why this answer

Sessions are the correct mechanism for distributed locks in Consul. By creating a session with a TTL and using the acquire parameter when writing to a KV key, the key becomes locked to that session. If the session expires because the instance fails to renew it, Consul releases the lock, enabling another instance to acquire it.

This pattern is fundamental for leader election.

Exam trap

The trap here is confusing Consul watches with sessions, thinking that a watch can automatically release a lock, but watches only notify and do not manage lock ownership.

94
MCQmedium

A platform team runs Consul agents in server mode on three dedicated hosts and client agents on each application node. They need a check that verifies the Consul servers themselves are reachable on the Serf LAN gossip port from the perspective of every client agent, so that a partitioned server is flagged even if it still answers HTTP requests on port 8500. Which check definition should they register on each client agent?

A.A TCP check with `tcp` set to the server's address on port 8301, registered as a check on each client agent.
B.An HTTP check against `http://<server>:8500/v1/status/leader` on each server, with `interval` set to 10s.
C.A UDP check with `udp` set to the server's address on port 8301, registered on each client agent.
D.A script check that runs `consul members -status=alive` and fails if any server is missing from the output.
AnswerA

A TCP check opens a connection to the target host and port and reports success only if the socket is accepted. Pointing it at each server's Serf LAN port (8301) from the client agent directly tests the gossip path that matters, so a server that answers HTTP on 8500 but has a blocked or broken 8301 port is correctly marked critical.

Why this answer

Testing reachability of the Serf LAN port from each client agent requires a check that actually opens a connection to that port on the server host. A TCP check pointed at port 8301 does exactly that, and because it is registered on the client agent, the health status reflects the client's own network path rather than the server's self-assessment. HTTP or script checks that exercise the API can pass while gossip connectivity is broken.

Exam trap

The trap here is assuming that any check which contacts the server, such as an HTTP check on the API port, proves the server is reachable for cluster gossip traffic.

95
Multi-Selectmedium

A platform engineer is defining a TTL health check for a batch worker that cannot be polled by the Consul agent. The check must be considered healthy only when the worker actively reports in, and must become unhealthy if the worker stops reporting. Which two configuration elements are required to make this TTL check functional? (Choose two.)

Select 2 answers
A.A TTL value that defines the maximum interval between reports
B.A status field that maps HTTP response codes to states
C.The worker must periodically call the Consul HTTP API to update the check
D.A script or HTTP endpoint that the agent polls
E.A deregister_critical_service_after value
AnswersA, C

The ttl field is mandatory for a TTL check. It tells Consul how long to wait for the next report before marking the check critical. Without a TTL value, Consul cannot determine when the check has expired, so the check cannot function as intended for the batch worker.

Why this answer

A TTL check requires two things: a ttl value, which sets the expiry window, and periodic updates from the monitored process to the Consul HTTP API. The ttl tells Consul when to mark the check critical, and the API calls tell Consul the service is alive. Optional fields like deregister_critical_service_after and status mapping are not required for the check to function.

Exam trap

The trap here is assuming a TTL check needs a polled script or endpoint, when in fact the monitored process must push updates to Consul.

96
MCQeasy

To verify if two datacenters are connected via WAN, which command shows the remote datacenter's server nodes?

A.consul members
B.consul info
C.consul members -wan
D.consul operator raft list-peers
AnswerC

`consul members -wan` queries the WAN gossip pool, listing servers from every datacenter joined through the WAN federation. This directly satisfies the requirement to see the remote datacenter's server nodes, unlike the LAN pool, which only returns members of the local datacenter.

Why this answer

The `consul members -wan` command queries the WAN gossip pool and lists all Consul servers across every datacenter that are federated via the WAN. It shows the remote datacenter's server nodes, confirming WAN connectivity. This is the only command that explicitly targets the WAN gossip layer, which is used for cross-datacenter communication.

Exam trap

The trap here is confusing local LAN membership with WAN federation; candidates often pick `consul members` because it lists nodes, but it only shows the local datacenter, not remote ones.

How to eliminate wrong answers

Option A is wrong because `consul members` only lists nodes in the local datacenter's LAN gossip pool, not remote datacenters. Option B is wrong because `consul info` provides runtime metrics and configuration details about the local agent, not a list of remote server nodes. Option D is wrong because `consul operator raft list-peers` shows the Raft peers within a single datacenter's server cluster, not WAN federation members.

97
MCQmedium

A developer runs `dig @127.0.0.1 -p 8600 web.service.consul SRV` and receives no records, even though `consul catalog services` lists `web` and `consul members` shows the node as alive. A health check for the `web` service is registered and currently shows a critical status. What is the most likely cause of the empty SRV response?

A.The Consul DNS interface only returns records for services that have at least one passing health check.
B.The DNS query must use the `ANY` type to return SRV records for services with critical checks.
C.The SRV record requires a `tcp` prefix in the query, such as `_tcp.web.service.consul`.
D.The `web` service is registered in a different datacenter, so the local DNS server cannot resolve it.
AnswerA

Consul's DNS interface filters out service instances whose health checks are not passing. Since the `web` service check is critical, no healthy instances exist, so the SRV query returns no records. This is expected behavior and explains why the service appears in the catalog but not in DNS results.

Why this answer

Consul's DNS interface only returns records for service instances that have at least one passing health check. When the `web` service check is critical, Consul considers the instance unhealthy and omits it from DNS responses. This behavior ensures that clients only discover healthy endpoints, which is a core feature of Consul's service discovery.

Exam trap

The trap here is assuming that a service listed in the catalog will always appear in DNS results, forgetting that health status filters DNS responses.

98
Multi-Selecteasy

Which TWO of the following are standard DNS records returned by Consul for service discovery?

Select 2 answers
A.NS
B.SRV
C.A
D.SOA
E.PTR
AnswersB, C

SRV records expose both host and port for a service, plus priority and weight for selection. Consul returns them so clients can discover not just where a service runs but on which port, satisfying the stem's service discovery requirement.

Why this answer

Consul's DNS interface returns SRV records (option B) to advertise the port and target host of a registered service instance, which is essential because service discovery must convey both the address and the port the service listens on. Consul also returns A records (option C) that map a service name to the IP address(es) of the healthy instances, allowing clients to resolve a service directly to an IP. These two record types are the core of Consul's service discovery responses, with SRV providing host+port and A providing the IPv4 address.

The other options are standard DNS record types but are not the service-discovery answers Consul returns for a service lookup: NS (option A) delegates zones to name servers, SOA (option D) holds zone authority metadata, and PTR (option E) is used for reverse DNS lookups.

Exam trap

Consul 1.15 often tests the distinction between DNS record types used for service discovery versus those used for zone administration or reverse lookups, causing candidates to confuse SRV and A records with NS, SOA, or PTR records.

99
MCQhard

You need to perform a canary deployment for a service. What Consul feature should you use?

A.Service splitting via Service Resolver.
B.KV store manual updates.
C.Intentions.
D.Service mesh gateway.
AnswerA

Service splitting uses a service resolver with a splitter configuration to route a defined percentage of traffic to the canary subset while the remainder goes to the stable version, satisfying the gradual, controlled traffic-shifting constraint of a canary deployment.

Why this answer

Consul's service resolver supports service splitting, which allows you to define weighted subsets of service instances for canary deployments. By configuring a service resolver with a split, you can direct a percentage of traffic to a new version (canary) while the rest goes to the stable version. This is the intended feature for gradual rollouts.

Other options like KV store updates, intentions, and mesh gateways do not provide traffic splitting capabilities.

Exam trap

Consul 1.15 often tests the specific features for traffic management, so candidates might choose intentions or gateways thinking they control traffic, but only service resolver provides splitting.

How to eliminate wrong answers

Option B is wrong because manually updating the KV store does not automatically route traffic; it would require custom logic in the application or proxy to read the KV and adjust routing, which is not a built-in feature. Option C is wrong because intentions are for authorization (allowing or denying connections) and do not control traffic distribution. Option D is wrong because a service mesh gateway is for enabling cross-datacenter or external connectivity, not for splitting traffic between versions.

100
Multi-Selecteasy

What information does the Consul HTTP API return for a health check? (Select TWO)

Select 2 answers
A.Service CPU usage
B.Output
C.Service port
D.Check uptime
E.Status
AnswersB, E

The Consul health check HTTP API returns an Output field containing the textual result produced by the check script or HTTP probe. This satisfies the stem's requirement by surfacing diagnostic detail alongside status, letting operators see why a check reported passing, warning, or critical.

Why this answer

The Consul HTTP API health check response includes the Status field (E), which reports the check's current state as "passing", "warning", or "critical", and the Output field (B), which contains the human-readable message or command output produced by the check. These two fields are part of the standard check object returned by endpoints such as /v1/health/checks/<service> and /v1/agent/checks. Service CPU usage (A) is not reported by Consul health checks, as Consul does not collect resource metrics.

Service port (C) is part of the service definition, not the health check object returned by the health API. Check uptime (D) is not a field Consul tracks or returns for health checks.

Exam trap

Consul 1.15 often tests whether candidates confuse health check response fields with service definition fields, leading them to select port or CPU usage instead of Output and Status.

101
MCQeasy

A DevOps engineer runs a Consul 1.15 agent on a VM and registers a web service with a script health check that executes a local shell script. The script returns exit code 0 when the service is healthy and exit code 1 when unhealthy. After the script runs, Consul reports the check status as passing. Which statement best describes how Consul interprets the script's exit code for this check?

A.Exit code 0 indicates passing, exit code 1 indicates critical, and exit code 2 indicates warning.
B.Exit code 0 indicates passing, and exit code 1 indicates maintenance mode.
C.Exit code 0 indicates passing, and any non-zero exit code indicates critical.
D.Exit code 0 indicates passing, exit code 1 indicates warning, and any other code indicates critical.
AnswerC

For script health checks, Consul interprets exit code 0 as passing and any non-zero exit code as critical. This binary behavior is standard for script checks in Consul 1.15. The engineer's script returning 1 correctly results in a critical status when unhealthy.

Why this answer

Consul script checks map exit code 0 to passing and any non-zero exit code to critical. There is no intermediate warning state based on exit codes for script checks. The engineer's script returning 1 will correctly cause the check to be marked critical, which can then trigger alerts or service deregistration if configured.

Exam trap

The trap here is assuming that Consul uses multiple exit codes to represent warning and critical, similar to some other monitoring systems.

102
Multi-Selecteasy

What is true about Consul health checks? (Select TWO)

Select 2 answers
A.They run on the local agent
B.They can be associated with a service
C.They only support GET requests
D.They always run on the server
E.They cannot be disabled
AnswersA, B

Health checks execute on the Consul agent running on each node, not centrally on the servers. This satisfies the stem's requirement that checks are agent-local: the agent owns the check definition, performs the probe, and reports status to the servers via the catalog. Server-side execution would not scale to thousands of nodes.

Why this answer

They run locally on the agent and can be associated with specific services.

103
Multi-Selecteasy

Which TWO of the following are valid ways to configure Consul Connect?

Select 2 answers
A.Directly modifying the Envoy binary.
B.Modifying the Consul source code.
C.Editing the agent binary.
D.JSON service definition files.
E.Consul HTTP API.
AnswersD, E

Consul accepts JSON service definition files as a first-class configuration method, loaded via the agent's config directory or the /agent/service/register endpoint. This satisfies the stem's requirement for a valid Connect configuration mechanism alongside HCL definitions.

Why this answer

Option D (JSON service definition files) is correct because Consul Connect is configured by declaring a service with a `connect` block (e.g., `"connect": {"sidecar_service": {}}`) inside a service registration JSON file, which the agent reads to enable the sidecar proxy and intentions. Option E (Consul HTTP API) is correct because the same service registration, including the `connect` stanza, can be submitted programmatically via the `/v1/agent/service/register` endpoint, and intentions can be managed through the `/v1/connect/intentions` endpoints. Options A, B, and C are not valid configuration methods: modifying the Envoy binary, the Consul source code, or the agent binary are unsupported hacks that alter the software itself rather than configuring Connect through its documented interfaces, and they would break upgrades and support.

Exam trap

Consul exams often test the supported configuration methods for Connect, tricking candidates into selecting unsupported methods like modifying binaries or source code.

104
MCQhard

A Consul service check is configured with `deregister_critical_service_after: "10m"`. The service enters a critical state due to a failed check. What happens after 10 minutes if the check remains critical?

A.The service is marked as maintenance mode and removed from DNS.
B.The service is moved to a warning state and remains registered.
C.The check is disabled but the service remains registered.
D.The service is deregistered from the Consul catalog.
AnswerD

The `deregister_critical_service_after` field specifies a duration after which a service that remains in a critical state is automatically deregistered from the Consul catalog. After 10 minutes of continuous critical status, Consul will remove the service registration. This helps prevent stale entries for failed services. The service must be re-registered to become available again.

Why this answer

When a service check is critical for the duration specified in `deregister_critical_service_after`, Consul automatically deregisters the service from the catalog. This prevents dead services from lingering in service discovery. The service must be re-registered to reappear.

Other options describe different behaviors such as maintenance mode, check disabling, or status change, none of which are caused by this field.

Exam trap

The trap here is confusing automatic deregistration with maintenance mode or check disabling, when the field specifically removes the service from the catalog.

105
MCQmedium

When multiple agents are in a cluster, how does Consul ensure that service discovery information is consistent across all nodes?

A.Using a centralized database like PostgreSQL.
B.By polling the leader every second.
C.Via the Raft consensus protocol for catalog changes.
D.By broadcasting all service updates to every node.
AnswerC

Catalog changes are replicated through the Raft consensus protocol, which elects a leader and commits entries only once a quorum of servers acknowledges them. This guarantees all nodes converge on identical service discovery data despite concurrent writes or failures.

Why this answer

Consul uses the Raft consensus protocol to replicate catalog changes across server nodes, ensuring that service discovery information is consistent and fault-tolerant. Raft elects a leader that handles writes and replicates log entries to followers, guaranteeing that all servers converge on the same state. This is how Consul maintains a consistent service catalog across the cluster.

Exam trap

The trap is confusing Consul's internal consistency mechanism (Raft) with external databases or gossip-based broadcast; candidates must know that Raft handles catalog consistency while gossip handles membership.

How to eliminate wrong answers

Option A is wrong because Consul does not rely on an external centralized database like PostgreSQL; it uses its own embedded Raft-based state store. Option B is wrong because polling the leader every second is not how Consul achieves consistency; it uses log replication, not polling. Option D is wrong because broadcasting updates to every node is not the mechanism; Raft replicates through the leader to followers in an ordered log, not via broadcast.

106
MCQhard

A platform team is running Consul Connect with Envoy sidecar proxies. They need to ensure that a service named 'payments' can only be accessed by services in the 'frontend' namespace, and all other access must be denied. They have Consul Enterprise with namespaces enabled. Which intention configuration achieves this requirement with the least administrative overhead?

A.Create an intention that allows 'frontend/*' to 'payments' and set the default intention behavior to deny.
B.Use a service-resolver configuration to restrict access to 'payments' based on the source namespace.
C.Configure the Envoy proxy for 'payments' with a network filter that allows only traffic from the 'frontend' namespace.
D.Create an intention that denies all sources to 'payments', then create individual allow intentions for each service in the 'frontend' namespace.
AnswerA

Using a wildcard source intention for the 'frontend' namespace allows all services within that namespace to access 'payments', while setting the default intention behavior to deny ensures that any other source is blocked. This is efficient because it requires only one intention and a global default, rather than creating individual intentions for every service in the frontend namespace. It leverages Consul Enterprise namespaces to group services logically.

Why this answer

The most efficient way to allow only services from the 'frontend' namespace to access 'payments' is to create a single intention that allows 'frontend/*' to 'payments', and set the default intention behavior to deny. This leverages Consul Enterprise namespaces and wildcard intentions to minimize the number of intentions required. Other options either require many intentions, use the wrong feature, or are not supported.

Exam trap

The trap here is assuming that service-resolver or Envoy filters can enforce authorization, when intentions are the dedicated mechanism for service-to-service access control.

107
MCQeasy

A platform team is deploying a new service 'payments' on a Consul 1.15 cluster with Connect enabled. They want to ensure that only the 'checkout' service can initiate connections to 'payments', and all other services are denied by default. Which intention should they create?

A.An intention from '*' to 'payments' with action 'allow', and an intention from 'checkout' to 'payments' with action 'deny'.
B.An intention from '*' to 'payments' with action 'deny', and an intention from 'checkout' to 'payments' with action 'allow'.
C.An intention from 'payments' to 'checkout' with action 'deny', and an intention from 'checkout' to 'payments' with action 'allow'.
D.An intention from 'checkout' to 'payments' with action 'allow', and no other intentions.
AnswerB

Creating a wildcard deny intention for all sources to 'payments' blocks any service by default. Then a specific allow intention for 'checkout' to 'payments' overrides the deny for that source. Consul evaluates intentions with specificity, so the more specific allow takes precedence. This achieves the desired least-privilege access control.

Why this answer

Consul intentions are evaluated based on specificity, with exact matches taking precedence over wildcards. A wildcard deny intention sets a default deny posture for the destination service, while a specific allow intention grants access to the authorized source. This pattern enforces least privilege and is a common security practice in Consul Connect.

Exam trap

The trap here is forgetting that Consul's default intention behavior is to allow, so a wildcard deny is required to block unauthorized services.

108
MCQeasy

A Consul operator wants to ensure that if the primary datacenter becomes unavailable, the secondary datacenter can continue to operate for existing services and intentions. Which statement best describes Consul's behavior in this scenario?

A.The secondary datacenter will continue to serve existing services and enforce replicated intentions, but new ACL tokens or intention changes cannot be made until the primary is restored.
B.The secondary datacenter will switch to using its local ACLs and intentions, ignoring the primary's configuration entirely.
C.The secondary datacenter will immediately stop all services and return errors until the primary datacenter is reachable again.
D.The secondary datacenter will automatically promote itself to primary and continue operating without interruption.
AnswerA

In a federated setup, the secondary datacenter maintains its own state and can continue to serve existing services using local data. Replicated ACLs and intentions are enforced based on the last successful replication. However, any changes to ACLs or intentions must be made in the primary, so new changes cannot be applied until the primary is back online.

Why this answer

Consul's multi-datacenter design allows secondary datacenters to remain operational for existing services and enforce replicated intentions even if the primary is down. However, administrative changes to ACLs or intentions require the primary, so they are blocked until connectivity is restored. This provides high availability for data plane operations while maintaining centralized control.

Exam trap

The trap here is assuming that the secondary datacenter can automatically take over the primary role or that it becomes completely independent, when in reality it continues to rely on replicated data and cannot make changes without the primary.

109
MCQhard

A service is registered with a check that has deregister_critical_service_after set to 30m. The service's check enters the critical state due to a transient network partition. The partition is resolved after 20 minutes, and the check returns to passing. What is the effect on the service registration?

A.The service remains registered because the check returned to passing before the 30-minute deregistration timer expired
B.The service is deregistered immediately when the check becomes critical
C.The service is deregistered after 30 minutes from the initial registration, regardless of check state
D.The service is deregistered because it was critical at any point
AnswerA

The deregister_critical_service_after timer is reset when the check leaves the critical state. Since the check returned to passing after 20 minutes, well before the 30-minute threshold, the service is not deregistered. The timer only triggers deregistration if the check stays critical continuously for the configured duration.

Why this answer

The deregister_critical_service_after field starts a timer when a check becomes critical and resets that timer if the check leaves the critical state. In this scenario, the check returned to passing after 20 minutes, before the 30-minute threshold, so the service remains registered. Deregistration only happens if the check stays critical continuously for the full configured duration.

Exam trap

The trap here is thinking that any period of critical status counts toward deregistration, when the timer actually resets on recovery.

110
MCQeasy

A developer has stored the database connection string under the Consul KV path `config/db/primary`. A configuration management script needs to fetch this value as raw text so it can be exported directly into an environment variable. Which Consul CLI command retrieves only the value of that key?

A.consul kv get -detailed config/db/primary
B.consul kv get config/db/primary
C.consul kv export config/db/primary
D.consul kv get -raw config/db/primary
AnswerD

The -raw flag prints the value exactly as stored, with no key name, no metadata, and no JSON wrapper. That makes it the correct choice when a script must capture the value verbatim, for example with command substitution into an environment variable.

Why this answer

The -raw flag suppresses the key name and all metadata, emitting only the stored bytes of the value. When a script needs to assign a KV value directly to a shell variable, any extra formatting breaks the assignment, so the raw form is required. The other commands either add metadata or wrap the value in JSON.

Exam trap

The trap here is assuming that a plain get already returns only the value, when it actually prefixes the key name and may include formatting that breaks direct variable assignment.

111
MCQhard

A team is running Consul 1.15 with Connect and wants to expose a TCP service through an ingress gateway so external clients can reach it over mTLS. They define the gateway and a listener on port 8443. External clients report TLS handshake failures. The gateway logs show no matching certificate. Which configuration element must be present for the listener to serve TLS?

A.A TLS certificate and private key must be provided for the listener, either inline or via an SDS or file reference.
B.The gateway's service registration must include the 'connect: { gateway: {} }' stanza and a matching intention for the external client.
C.The listener must set 'protocol = "tcp"' and rely on the client to perform mTLS directly to the backend service.
D.The listener must reference a service-resolver that includes a 'tls' subset before it can accept TLS connections.
AnswerA

Ingress gateway listeners that terminate TLS require a server certificate and key. Without them the listener cannot complete the handshake, which matches the observed failures. Consul can source these from inline configuration, a file path, or an external SDS provider such as Vault, and the gateway then presents the certificate to clients.

Why this answer

Ingress gateway listeners that terminate TLS must be given a certificate and private key. Consul supports inline certificates, file-based references, and SDS integrations such as Vault. Without this material the gateway cannot complete the TLS handshake, producing the handshake failures and missing-certificate log entries.

Routing and intention configuration are separate concerns from certificate provisioning.

Exam trap

The trap here is assuming that registering the gateway and defining intentions is sufficient, when TLS termination additionally requires explicit certificate material.

112
MCQeasy

A Consul operator registers a web service on a node with a service-level health check that uses the HTTP type and points to http://127.0.0.1:8080/health. The check has been passing for weeks, but the team now wants to stop advertising the service in DNS and the service catalog when the /health endpoint returns HTTP 500. Which Consul check status will the service health be reported as when the endpoint returns 500?

A.warning
B.critical
C.passing
D.maintenance
AnswerB

For HTTP checks, Consul marks the check critical when the monitored endpoint returns any HTTP status other than 200, or when the connection fails or times out. A 500 response therefore immediately puts the check into the critical state, which removes the service from healthy DNS results and from the passing portion of the catalog.

Why this answer

HTTP health checks in Consul treat only HTTP 200 as passing. Any other response, including 500, connection refused, or timeout, is reported as critical. This is why the service will be removed from healthy DNS and catalog queries when the endpoint fails.

The warning state requires explicit configuration or a script exit code, and maintenance mode is operator-initiated.

Exam trap

The trap here is assuming that any HTTP response received from the endpoint, including a 500, proves the service is reachable and therefore passing.

113
MCQmedium

What is the benefit of using a Mesh Gateway in a multi-datacenter deployment with overlapping IP space?

A.It allows cross-datacenter traffic without routing overlapping networks.
B.It reduces the server memory usage.
C.It eliminates the need for ACLs.
D.It increases the gossip speed.
AnswerA

Mesh gateways route service traffic through a shared gateway rather than exposing pod or node addresses, so datacentres with identical CIDR ranges never need direct IP reachability. This satisfies the stem's overlapping-IP constraint without renumbering either network.

Why this answer

A mesh gateway in Consul enables service-to-service communication across datacenters by routing traffic through a gateway that terminates and re-originates the connection, rather than relying on direct IP routing between datacenters. This is essential when two datacenters have overlapping CIDR ranges, because the mesh gateway provides a single, routable entry point that abstracts the underlying overlapping addresses. Without it, Consul's native cross-datacenter routing (which uses the remote datacenter's IPs) would fail due to routing conflicts.

Exam trap

The trap here is confusing mesh gateways with other Consul features like ACLs or gossip optimization; candidates may think mesh gateways are about security or performance rather than solving the routing problem of overlapping IP spaces.

How to eliminate wrong answers

Option B is wrong because mesh gateways do not reduce Consul server memory usage; they are data-plane proxies that handle traffic, not a mechanism for optimizing server resource consumption. Option C is wrong because ACLs are still required and enforced independently of mesh gateways; mesh gateways do not eliminate the need for access control policies. Option D is wrong because gossip protocol speed is related to network latency and configuration (e.g., LAN/WAN gossip), not to the presence of a mesh gateway, which operates at the service mesh data plane.

114
MCQeasy

Which HTTP status code range does Consul interpret as a passing state for an HTTP health check?

A.3xx
B.Any code less than 500
C.1xx
D.2xx
AnswerD

Consul's HTTP health check treats any response in the 2xx range as passing, marking the service healthy. Other ranges (3xx redirects, 4xx client errors, 5xx server errors) are interpreted as failing or warning states, so 2xx is the only range that satisfies the passing-state requirement.

Why this answer

Consul's HTTP health check considers the check passing only when the endpoint returns an HTTP status code in the 2xx range (200-299). Any other status — including 3xx redirects — is treated as critical/failing. This strict interpretation ensures the monitored service is actually serving content, not redirecting or erroring.

Exam trap

Consul 1.15 often tests the misconception that any non-5xx response is passing, when in fact only 2xx is treated as passing and 3xx redirects fail the check.

How to eliminate wrong answers

Option A is wrong because 3xx redirects indicate the resource moved and Consul does not follow redirects by default; a 301/302 is treated as failing. Option B is wrong because 'any code less than 500' would incorrectly include 3xx and 4xx responses, which Consul marks as critical. Option C is wrong because 1xx informational responses are not final and are not treated as passing by Consul's HTTP check.

115
Multi-Selectmedium

When troubleshooting a failing health check, which tools are recommended? (Select TWO)

Select 2 answers
A.Consul UI
B.Agent logs
C.DNS query
D.Consul key-value store
E.System metrics
AnswersA, B

The Consul UI displays each service's health check status, output and last-updated timestamp, letting you identify which check is failing and why. This directly satisfies the troubleshooting scenario by exposing the check's current state without command-line inspection.

Why this answer

The Consul UI (A) is recommended because it visually displays the current health status of each service and node, showing which checks are passing, warning, or critical, and it lets you drill into the specific check output to identify the failure. Agent logs (B) are recommended because the Consul agent records detailed health check execution results, errors, and state transitions, which reveal why a check is failing (e.g., script exit codes, timeouts, or connection errors). DNS query (C) is not appropriate here because DNS only resolves service names to addresses and does not expose health check diagnostics.

The Consul key-value store (D) holds arbitrary configuration data and is unrelated to health check troubleshooting. System metrics (E) provide resource usage data but do not show Consul health check status or failure reasons.

Exam trap

Consul 1.15 often tests whether candidates reach for tangential tools (DNS, KV, metrics) instead of the two authoritative sources — the UI for state and agent logs for the underlying error output.

116
MCQhard

When configuring mTLS in Consul Connect, how are certificates distributed to the sidecar proxies?

A.They are hardcoded in the service definition.
B.Via an external secret management service only.
C.The agent fetches them from the server and provides them via the Envoy xDS API.
D.Via a shared disk volume.
AnswerC

Consul's client agent obtains the leaf certificate and key from the server via the Connect CA, then serves them to the local Envoy sidecar through the xDS API. This satisfies the requirement that certificates reach proxies without manual distribution.

Why this answer

In Consul Connect mTLS, the Consul agent on each node acts as the local certificate authority client: it fetches leaf certificates and the CA bundle from the Consul servers and delivers them to the sidecar proxy (Envoy) dynamically through the xDS API. This means certificates are rotated automatically without restarting the proxy or editing service definitions.

Exam trap

Consul 1.15 often tests the mTLS distribution path — the trap is assuming certificates are configured statically or via an external vault, when in fact the agent-to-Envoy xDS/SDS channel is the native mechanism.

How to eliminate wrong answers

Option A is wrong because hardcoding certificates in a service definition would break automatic rotation and expose private keys in config files, which Consul Connect explicitly avoids. Option B is wrong because while external secret managers can be integrated, Consul Connect's native mTLS does not require or default to an external secrets service — the built-in CA handles issuance. Option D is wrong because sharing certificates via a disk volume is insecure and not how Connect distributes identities; each proxy gets its own SPIFFE-based leaf cert delivered over the local agent's xDS stream.

117
MCQhard

You need to ensure that a read operation from the KV store is strongly consistent. Which consistency mode should you specify?

A.default
B.consistent
C.quorum
D.stale
AnswerB

Consistent forces a leader check for strong consistency.

Why this answer

The 'consistent' mode forces the Consul server handling the request to forward it to the leader, which then verifies it still holds leadership via a quorum of followers before serving the read. This guarantees linearizable (strongly consistent) reads, ensuring you never see stale data. In contrast, 'default' and 'stale' allow reads from any server and may return outdated values, while 'quorum' is not a valid consistency mode for KV reads.

Exam trap

Consul 1.15 often tests the misconception that 'quorum' is a valid consistency mode, when in fact it is not; candidates must remember the three valid modes: default, consistent, and stale.

How to eliminate wrong answers

Option A is wrong because 'default' uses the same consistency as 'stale' for most reads, permitting any server to respond and potentially returning stale data. Option C is wrong because 'quorum' is not a supported consistency mode for Consul KV reads; the valid modes are 'default', 'consistent', and 'stale'. Option D is wrong because 'stale' explicitly allows reads from any server without leader verification, sacrificing strong consistency for lower latency and higher availability.

118
MCQmedium

A platform engineer is adding a new service to Consul. The service must appear in the catalog with the name 'billing', be reachable over DNS at billing.service.consul, and be associated with the tag 'prod'. Which registration block correctly achieves this when using the HTTP API?

A.{"Service": "billing", "Tag": "prod", "IP": "10.0.0.5", "Port": 8080}
B.{"Name": "billing", "Tags": "prod", "Address": "10.0.0.5", "Port": 8080}
C.{"Name": "billing", "Tags": ["prod"], "Host": "10.0.0.5", "Port": 8080}
D.{"Name": "billing", "Tags": ["prod"], "Address": "10.0.0.5", "Port": 8080}
AnswerD

The /v1/agent/service/register endpoint accepts a JSON body where Name sets the catalog service name, Tags is an array of strings, and Address/Port define the reachable endpoint. Consul uses Name to build billing.service.consul and exposes the tags for filtering. This body registers the service on the local agent, making it discoverable via DNS and catalog queries immediately.

Why this answer

The agent service registration API requires a JSON object with Name for the catalog service identifier, Tags as an array of strings, and Address plus Port for the reachable endpoint. That combination makes the service resolvable at billing.service.consul and allows tag-based filtering such as prod. Any deviation in field naming or tag type causes registration failure or missing discovery data.

Exam trap

The trap here is assuming the registration JSON accepts singular or alternative field names like Service, Tag, or Host instead of the exact Consul schema fields Name, Tags, and Address.

119
MCQmedium

You want to ensure that specific services in a remote datacenter are only accessible to certain local services. How can you achieve this?

A.Use Consul Intentions.
B.Use firewall rules on all nodes.
C.Modify DNS resolution.
D.Use ACL tokens.
AnswerA

Consul intentions define L4 authorisation rules that permit or deny connections between specific services, enforced via sidecar proxies or Connect. They restrict which local services may reach the remote datacenter services, satisfying the access-control requirement.

Why this answer

Consul Intentions define allow/deny rules for service-to-service communication, including across datacenters. They are the correct mechanism to restrict access to specific services in a remote datacenter based on the source service's identity.

Exam trap

Consul 1.15 often tests service mesh security; candidates may choose ACL tokens or firewall rules, but Intentions are specifically designed for service-to-service authorization.

How to eliminate wrong answers

Option B is wrong because firewall rules operate at the network layer and cannot enforce service-level identity without Consul's service mesh. Option C is wrong because DNS resolution only affects discovery, not authorization. Option D is wrong because ACL tokens control access to Consul's API and KV, not service-to-service communication.

120
MCQeasy

An engineer needs a service check that simply confirms a TCP port on the same host is accepting connections, without sending any application payload. Which Consul check configuration accomplishes this?

A.check { name = "db-port" script = "nc -z localhost 5432" interval = "10s" }
B.check { name = "db-port" ttl = "10s" }
C.check { name = "db-port" tcp = "localhost:5432" interval = "10s" }
D.check { name = "db-port" http = "localhost:5432" interval = "10s" }
AnswerC

The tcp check type opens a TCP connection to the specified address and port and considers the check passing if the connection is established. It sends no application-level data, which matches the requirement exactly. The interval schedules repeated connection attempts, and the check fails when the socket cannot be opened.

Why this answer

The tcp check type is designed for exactly this purpose: Consul dials the given host and port and marks the check passing when the connection succeeds. It requires no payload exchange and no helper binaries. HTTP checks expect an HTTP conversation, TTL checks rely on the service to push status, and script checks add an external process dependency that the native TCP probe avoids.

Exam trap

The trap here is reaching for a script check with a netcat command when Consul already provides a native check type that performs the TCP connection test directly.

121
MCQmedium

You have a service that needs to talk to a service in a different datacenter. What configuration is required?

A.Direct VPC peering.
B.An external service definition.
C.A global intention.
D.A mesh gateway deployment.
AnswerD

Cross-datacenter service-to-service traffic traverses the WAN through mesh gateways, which proxy Consul's mTLS connections between datacenters. Deploying a mesh gateway in each datacenter is required so the local sidecar can reach the remote service without direct network peering.

Why this answer

To allow services in different datacenters to communicate over Consul's service mesh, you must deploy a mesh gateway in each datacenter. Mesh gateways proxy mTLS traffic between datacenters, enabling sidecar proxies to reach services in remote datacenters without direct network peering. Without a mesh gateway, cross-datacenter service-to-service traffic cannot traverse the WAN through Consul's mesh.

Exam trap

The trap here is confusing authorization (intentions) with connectivity (mesh gateways); candidates often pick 'global intention' because it sounds like it enables cross-datacenter communication, but intentions only permit or deny traffic that already has a path.

How to eliminate wrong answers

Option A is wrong because VPC peering is a network-layer solution that does not integrate with Consul's identity-based mTLS mesh and is not required by Consul itself. Option B is wrong because an external service definition registers a service that lives outside Consul, not a mechanism for cross-datacenter mesh traffic. Option C is wrong because a global intention controls authorization between services across datacenters but does not provide the data path; you still need a mesh gateway for the traffic to flow.

122
MCQhard

A Consul operator needs to deregister a specific service instance named 'web-01' from a node without affecting other instances of the same service. The service was registered with the ID 'web-01'. Which action accomplishes this?

A.Run consul services deregister -id=web-01
B.Send a PUT request to /v1/agent/service/deregister with the service name 'web' in the body
C.Send a PUT request to /v1/catalog/deregister with the service name 'web'
D.Send a PUT request to /v1/agent/service/deregister/web-01
AnswerD

The agent service deregister endpoint accepts the service ID in the path and removes only that instance from the local agent and catalog. Because web-01 is the unique service ID, other instances remain registered. This is the precise, targeted way to remove a single instance without impacting the rest of the service's endpoints.

Why this answer

Deregistering a single instance requires the unique service ID, which is web-01. The agent endpoint /v1/agent/service/deregister/<serviceID> removes exactly that instance from the local agent and propagates the change to the catalog. Targeting the service name or using a nonexistent command leaves other instances intact but fails to remove the intended one.

Exam trap

The trap here is confusing the service name with the service ID and assuming that the deregister endpoint accepts a name in the body rather than the unique ID in the URL path.

123
MCQhard

If you are using SPIRE for certificate management, how does this interact with Consul Connect?

A.Consul Connect can delegate CA operations to an external provider like SPIRE.
B.Only static certificates can be used.
C.Consul must be disabled.
D.SPIRE replaces the Consul agent.
AnswerA

Consul Connect's CA interface is pluggable, so it can delegate certificate signing and issuance to an external provider such as SPIRE rather than using the built-in CA. This lets SPIRE-issued identities secure service mesh mTLS without replacing Connect.

Why this answer

Consul Connect supports pluggable CA providers, and SPIRE is one of the supported external CA integrations. When configured, Consul delegates certificate signing and issuance for service mesh identities to SPIRE, allowing organizations already standardized on SPIFFE/SPIRE to unify workload identity across Consul and non-Consul workloads.

Exam trap

The trap is thinking external CA integration replaces Consul components — candidates assume SPIRE substitutes for the Consul agent or disables Consul, when it only swaps out the certificate authority function.

How to eliminate wrong answers

Option B is wrong because Connect uses short-lived, auto-rotated certificates issued by the CA — static certificates are not the model, and SPIRE integration specifically enables dynamic issuance. Option C is wrong because Consul must be running to provide the mesh data plane and service registry; SPIRE only replaces the CA function, not Consul itself. Option D is wrong because SPIRE does not replace the Consul agent — the agent still runs on each node to register services, perform health checks, and configure Envoy sidecars; SPIRE only supplies identities.

124
MCQhard

A company runs a primary datacenter and a secondary datacenter with ACL replication enabled. During a maintenance window the primary's servers are taken offline for several hours while the secondary remains fully operational. What is the expected behavior in the secondary during the outage?

A.The secondary continues serving catalog and DNS queries using its replicated ACL data, but new ACL tokens or policy changes cannot be created or replicated until the primary returns.
B.The secondary purges its replicated ACL data to avoid serving stale policies, forcing a full re-replication when the primary returns.
C.The secondary automatically promotes itself to primary and begins accepting ACL writes, then demotes itself when the primary returns.
D.The secondary immediately stops accepting all requests because ACL authorization depends on a live connection to the primary.
AnswerA

A secondary keeps its replicated ACL state and continues authorizing requests and answering catalog queries locally. What stops is the replication stream: any new token or policy must be created in the primary and cannot be propagated while it is offline, so ACL changes made in the secondary would not be authoritative or replicated.

Why this answer

A secondary datacenter relies on locally replicated ACL data, so it continues authorizing requests and serving queries while the primary is offline. The outage blocks the replication stream, meaning new tokens and policy changes cannot be created or propagated until the primary is reachable again. No automatic promotion or data purge occurs.

Exam trap

The trap here is assuming ACL enforcement requires a live primary, when the secondary authorizes from locally replicated data and only replication stalls.

125
MCQmedium

You are deploying a service that must store a critical configuration value in Consul KV. The value must only be visible to services with a token that has read access to that specific key. You also need to ensure that any write to the key can only be performed by a token with write access. Which Consul feature should you use?

A.Consul namespaces with a default policy that allows all operations.
B.Consul ACLs with a policy that restricts access to the KV path.
C.Consul KV key-level encryption using the gossip encryption key.
D.Consul intentions that define which services can communicate with the KV store.
AnswerB

ACLs with a policy specifying rules for the KV path allow fine-grained control over read and write access. By attaching a token with that policy, you restrict who can read or write the key. This directly satisfies the requirement that only authorized tokens can access the key.

Why this answer

The requirement is to restrict read and write access to a specific KV key based on tokens. Consul ACLs with policies that define rules for the KV path are the correct mechanism. They allow you to specify exact permissions for tokens, ensuring that only authorized clients can read or write the key.

Other options do not provide this level of access control.

Exam trap

The trap here is confusing encryption or network segmentation with authorization; ACLs are the only way to enforce token-based read/write permissions on KV paths.

126
MCQhard

A Consul 1.15 operator configures an HTTP health check for a service with the following settings: http = "https://api.example.com/health", tls_skip_verify = false, and method = "GET". The check is failing with a certificate error. Which configuration change should the operator make to allow the check to succeed while maintaining security?

A.Set tls_skip_verify to true.
B.Set the method to HEAD instead of GET.
C.Provide a valid CA certificate using the ca_file or ca_path option in the check configuration.
D.Change the check type to TCP on port 443.
AnswerC

By specifying a trusted CA certificate with ca_file or ca_path, Consul can verify the server's certificate against that CA. This resolves the certificate error while maintaining proper TLS verification. This is the secure and correct approach when the service uses a certificate signed by a private or internal CA.

Why this answer

When an HTTP health check fails due to a certificate error, it means Consul cannot verify the server's TLS certificate. To resolve this securely, the operator should provide the appropriate CA certificate using ca_file or ca_path. This allows Consul to trust the certificate while still performing verification, unlike disabling verification with tls_skip_verify.

Exam trap

The trap here is to disable TLS verification by setting tls_skip_verify to true, which would make the check succeed but at the cost of security and is not a proper fix.

127
MCQmedium

You are configuring a new Consul datacenter named 'dc2' to join an existing WAN federation with primary datacenter 'dc1' that uses mesh gateways. The WAN is not directly routable between datacenters. Which configuration allows dc2's servers to establish WAN federation through the mesh gateways?

A.Set retry_join_wan in dc2's servers to the private IPs of dc1's servers and enable connect.enable_mesh_gateways only on dc2.
B.Configure dc2's servers with retry_join_wan pointing to dc1's server LAN addresses and set acl.tokens.default to the replication token.
C.Set primary_gateways in dc2's server configuration to the addresses of dc1's mesh gateways and enable connect.enable_mesh_gateways on both datacenters.
D.Enable connect.enable_mesh_gateways on dc2 and set primary_datacenter to dc1, then use the consul join -wan command with dc1's mesh gateway addresses.
AnswerC

When WAN traffic cannot route directly, Consul 1.15 supports WAN federation via mesh gateways. You set primary_gateways on the secondary servers to the primary's mesh gateway addresses and enable mesh gateways in both datacenters, allowing the secondary servers to establish the WAN gossip and RPC connections through the gateways.

Why this answer

WAN federation through mesh gateways requires setting primary_gateways on the secondary datacenter's servers to the primary's mesh gateway addresses, and enabling mesh gateways in both datacenters. This lets the secondary servers form the WAN gossip pool and perform RPCs over the gateways when direct WAN routing is unavailable.

Exam trap

The trap here is assuming that retry_join_wan or manual consul join -wan can traverse mesh gateways, when gateway-based federation instead relies on primary_gateways plus mesh gateways enabled on both sides.

128
MCQeasy

An operator registers a web service with a TTL health check and forgets to send periodic updates. After the TTL expires, the service appears as critical in the Consul UI. Which behavior explains why the check transitioned to critical automatically?

A.The service was deregistered because the TTL expired, and the missing service is shown as critical.
B.The Consul agent restarted and reset all check states to critical.
C.Consul requires TTL checks to be updated by an external monitoring system, and the absence of that system caused the critical state.
D.TTL checks automatically transition to critical when their TTL elapses without an update.
AnswerD

TTL health checks require the service to periodically report its status using the /v1/agent/check/pass endpoint or equivalent. If no update is received within the configured TTL, Consul marks the check critical automatically. This is the intended behavior to detect unresponsive services, and it explains the observed transition in the scenario.

Why this answer

TTL checks are passive: the service or an external process must periodically report health. When the TTL elapses without a report, Consul automatically marks the check critical. This design detects services that have stopped reporting, which is exactly what happened when the operator forgot to send updates.

Exam trap

The trap here is assuming that a TTL check stays in its last known state indefinitely or that deregistration is the default, when in fact an expired TTL always forces the check into critical.

129
MCQeasy

A developer needs to register a service named 'api' with Consul and ensure that it is only discoverable by consumers that explicitly request the 'v2' tag. Which Consul feature should be used?

A.Service tags
B.ACLs
C.Health checks
D.Service meta
AnswerA

Service tags are used to attach metadata to a service instance for filtering during discovery. By registering the service with the tag 'v2', consumers can query for 'v2.api.service.consul' to retrieve only instances with that tag. This allows for version-based routing. Tags are not automatically applied; they must be specified in the service definition and can be used in DNS queries or API calls.

Why this answer

Service tags are the correct mechanism to allow consumers to filter service instances by a specific label such as 'v2'. By registering the service with the tag 'v2', the developer enables discovery queries that include that tag to return only the desired instances. This is a common pattern for versioned services or canary deployments.

Exam trap

The trap here is confusing service meta with service tags; meta is for descriptive metadata, while tags are used for filtering in discovery.

130
Multi-Selecthard

Which TWO of the following statements are true about the 'passing' parameter in DNS queries?

Select 2 answers
A.It requires manual service registration.
B.It returns only services with passing health checks.
C.It forces the DNS server to restart.
D.It is a permanent configuration setting.
E.It can be used in the DNS query URL.
AnswersB, E

The passing parameter filters DNS results to endpoints whose Consul health checks currently report passing status, excluding any critical or warning instances. This satisfies the stem's requirement for returning only services with passing health checks, rather than all registered instances regardless of health.

Why this answer

Option B is correct because the 'passing' parameter filters DNS query results so that only service instances whose health checks are currently passing are returned, which is essential for service discovery in tools like Consul. Option E is correct because 'passing' is appended as a query string parameter in the DNS query URL, for example when querying a service name with ?passing to restrict results to healthy instances. Option A is incorrect because the 'passing' parameter does not require manual service registration; services are registered through the service registry or API, not through this query parameter.

Option C is incorrect because 'passing' is a query-time filter and has no effect on restarting the DNS server. Option D is incorrect because 'passing' is a per-query parameter, not a permanent configuration setting.

Exam trap

The trap is thinking that 'passing' is a permanent setting or requires manual registration, but it's a query parameter for filtering DNS results.

131
MCQmedium

You are deploying a new service 'api' in a Consul Connect mesh. You want to ensure that all incoming connections to 'api' are logged for auditing purposes. Which Consul feature should you configure?

A.Use Consul's built-in traffic capture feature to record all connections to 'api'.
B.Set the intention action to 'allow' and enable audit logging in Consul's ACL system.
C.Enable access logs on the sidecar proxy for 'api'.
D.Configure a service mesh gateway to log all traffic passing through it.
AnswerC

Sidecar proxies can be configured to emit access logs that record each incoming connection, including source service identity and timestamp. This provides the necessary audit trail for connections to 'api'. Configuring access logs on the proxy is the standard way to achieve connection logging in Consul Connect.

Why this answer

To log incoming connections to a service in Consul Connect, you should enable access logs on the sidecar proxy. The proxy handles all incoming traffic and can be configured to write logs that include details such as the source service, destination, and timestamp. This is the correct approach for auditing service-to-service communication.

Exam trap

The trap here is thinking that ACL audit logging or mesh gateways can provide connection-level auditing, when actually the sidecar proxy's access logs are the correct source.

132
MCQeasy

What happens to the gossip protocol if the 'encrypt' key is mismatched between two datacenters trying to join via WAN?

A.The join proceeds with warnings.
B.The join fails.
C.The connection defaults to unencrypted.
D.Only metadata is encrypted.
AnswerB

Consul's gossip protocol uses the encryption key to authenticate and encrypt Serf messages; if the WAN key differs between datacenters, members cannot decrypt each other's traffic, so the join attempt fails rather than silently forming a split cluster.

Why this answer

If the gossip encryption key ('encrypt' for LAN or 'encrypt_wan' for WAN) is mismatched between two datacenters attempting to join via WAN, the join fails because Serf cannot decrypt the gossip messages from the remote cluster. Encryption keys must match exactly for the WAN gossip pool to form. There is no fallback to unencrypted communication.

Exam trap

The trap is assuming Consul will gracefully degrade to unencrypted gossip or only encrypt metadata — candidates often think encryption is optional or partial, but Serf enforces full-message encryption, so a key mismatch is a hard failure.

How to eliminate wrong answers

Option A is wrong because the join does not proceed with warnings — Serf rejects messages it cannot decrypt, so the join fails outright. Option C is wrong because Consul does not default to unencrypted communication when keys mismatch; if encryption is configured, it is enforced, and mismatched keys cause failure. Option D is wrong because the entire gossip payload is encrypted, not just metadata — Serf encrypts the full message body, so a key mismatch prevents any communication, not just metadata exchange.

133
Multi-Selecthard

Which TWO of the following are valid ways to monitor Consul Connect performance?

Select 2 answers
A.Envoy stats endpoint.
B.Modifying Consul log levels to 'debug'.
C.Prometheus metrics.
D.Checking the system RAM.
E.Directly querying the database.
AnswersA, C

Envoy's `/stats` endpoint exposes per-sidecar metrics for every proxied connection, including request rates, latency histograms and upstream health. Since Consul Connect injects Envoy as the data-plane proxy, scraping these endpoints directly satisfies the requirement to monitor service-mesh performance at the connection level.

Why this answer

Option A (Envoy stats endpoint) is correct because Consul Connect uses Envoy sidecar proxies for its service mesh data plane, and each Envoy proxy exposes a /stats endpoint (typically on port 19000 via the admin interface) that reports detailed metrics such as upstream request counts, latency histograms, and connection errors, making it a valid way to monitor Connect performance. Option C (Prometheus metrics) is correct because Consul and Envoy both expose metrics in Prometheus format — Consul's /v1/agent/metrics endpoint and Envoy's /stats/prometheus endpoint — which can be scraped to monitor Connect proxy and mesh health. Option B is not a valid monitoring method because changing Consul log levels to 'debug' only increases log verbosity for troubleshooting; it does not provide performance metrics.

Option D is not specific to Consul Connect, as checking system RAM is a generic host resource check rather than a Connect performance monitoring technique. Option E is incorrect because Consul Connect does not involve directly querying a database; it is a service mesh feature for securing service-to-service communication.

Exam trap

The trap is selecting log-level changes or host resource checks as 'monitoring' — the exam expects you to distinguish between observability mechanisms (metrics endpoints) and troubleshooting aids (debug logs).

134
MCQeasy

When joining a new datacenter to an existing WAN pool, what is the best practice for server versions?

A.The new DC must run a newer version.
B.The new DC must run an older version.
C.Versions should be consistent across all datacenters.
D.Version doesn't matter at all.
AnswerC

Consul's gossip protocol and RPC compatibility depend on matching versions; mixed server versions across WAN-federated datacenters can break Serf membership and cause failed joins or inconsistent catalog replication. Uniform versions across every datacenter keep the WAN pool stable during and after the join.

Why this answer

Consul best practice is to keep server versions consistent across all datacenters in a WAN pool. Version skew can cause protocol incompatibilities, inconsistent behavior, and upgrade complications, so the official guidance is to run the same version everywhere. This is why option C is correct.

Exam trap

Consul 1.15 often tests upgrade best practices — candidates may assume newer is always better or that version doesn't matter, but the exam expects you to know that consistency across datacenters is the documented best practice.

How to eliminate wrong answers

Option A is wrong because running a newer version in the new DC creates version skew that can break WAN gossip compatibility and Raft protocol negotiation. Option B is wrong because running an older version in the new DC also creates skew and may lack features or security fixes required by the existing pool. Option D is wrong because version consistency absolutely matters — Consul's WAN federation and Raft protocol have version-dependent behaviors, and ignoring version alignment is a documented anti-pattern.

135
MCQeasy

A new engineer is configuring a Consul server agent for a datacenter named 'west' and wants the agent to automatically rejoin the WAN federation after a restart without manual intervention. Which configuration setting should they use?

A.'retry_join' with the LAN addresses of servers in the same datacenter, which also covers WAN rejoin as a side effect.
B.'retry_join_wan' with the addresses of server agents in the other datacenter, so the agent retries WAN join attempts on startup and after failures.
C.'translate_wan_addrs' set to true, which causes the agent to discover and join the WAN pool automatically.
D.'start_join_wan' with a single remote server address, which retries only once at startup and then stops.
AnswerB

'retry_join_wan' provides a list of WAN addresses that the server agent attempts to join, retrying indefinitely with backoff. It is the standard way to make WAN federation resilient across restarts, because the agent re-establishes the WAN gossip link automatically rather than requiring an operator to run 'consul join -wan' again.

Why this answer

'retry_join_wan' is the supported mechanism for resilient WAN federation membership. It lists remote server addresses and retries joins with backoff, so a restarted or temporarily disconnected server agent rejoins the WAN pool without operator action. Options that address LAN joins or address translation do not restore cross-datacenter membership.

Exam trap

The trap here is confusing LAN rejoin settings with WAN rejoin settings, when only the WAN-specific option restores cross-datacenter membership.

136
MCQhard

A Consul cluster is used for service discovery across multiple datacenters. A service named 'api' is registered in both datacenter 'dc1' and 'dc2'. A client in 'dc1' needs to discover instances of 'api' in 'dc2' using DNS. Which DNS query format should the client use?

A.api.service.dc2.consul
B.api.service.consul?dc=dc2
C.api.dc2.service.consul
D.api.service.consul.dc2
AnswerA

Consul DNS supports datacenter-specific queries by inserting the datacenter name as a subdomain before 'consul'. The format 'api.service.dc2.consul' resolves to instances of 'api' in 'dc2'. This is the correct way to query a remote datacenter via DNS.

Why this answer

Consul DNS allows querying services in other datacenters by including the datacenter name in the domain. The correct format is '<service>.service.<datacenter>.consul'. For example, 'api.service.dc2.consul' returns instances of 'api' in 'dc2'.

Other formats either misplace the datacenter or use unsupported query parameters. This feature enables cross-datacenter service discovery without direct API calls.

Exam trap

The trap here is assuming that datacenter selection is done via a query parameter or by placing the datacenter in the wrong position in the domain name.

137
MCQmedium

A platform team operates a Consul 1.15 cluster with a primary datacenter in us-east-1 and a secondary datacenter in eu-west-1. After configuring ACLs for replication, they update a token policy in the primary datacenter. A security engineer in the secondary datacenter immediately checks the ACL token and finds the old policy still in effect. What is the most likely reason the policy change has not propagated yet?

A.ACL replication only works in one direction from secondary to primary, so changes made in the primary are not replicated.
B.The secondary datacenter has not yet received the updated policy because ACL replication is asynchronous and may take time to propagate.
C.The secondary datacenter must be restarted to pick up the new ACL policy from the primary datacenter.
D.The updated policy must be manually copied to each secondary datacenter using the consul acl policy create command.
AnswerB

ACL replication in Consul is asynchronous. Changes made in the primary datacenter are replicated to secondary datacenters on a periodic basis, so there can be a delay before the updated policy is visible. This scenario matches that behavior: the security engineer checked immediately, before the next replication cycle completed.

Why this answer

ACL replication between datacenters is asynchronous, so changes made in the primary datacenter are not instantly visible in secondary datacenters. The security engineer checked before the next replication cycle, which explains why the old policy was still in effect. The other options describe mechanisms that are not part of Consul's ACL replication model.

Exam trap

The trap here is assuming ACL replication is instantaneous, when in fact it is asynchronous and can take time to propagate to secondary datacenters.

138
MCQeasy

A team configures a script health check on a client agent with `interval` set to 30s and `timeout` set to 5s. The script normally finishes in under a second, but during a nightly batch job it occasionally blocks on a lock for over a minute. The team wants Consul to mark the service unhealthy when the script exceeds the timeout instead of waiting indefinitely. What does Consul do when the script has not exited by the timeout value?

A.The agent pauses the check and marks it as maintenance until the script returns.
B.The agent waits for the script to exit, then records the result with a warning status.
C.The agent marks the check critical and retries the script at the next configured interval.
D.The agent marks the check critical immediately and attempts to terminate the running process.
AnswerC

When a script check exceeds its `timeout`, the agent reports the check as critical and moves on, running the script again when the next `interval` elapses. This gives operators the unhealthy signal they asked for while keeping the check loop on schedule, though the still-running process from the previous attempt is not forcibly stopped.

Why this answer

A script check that outlives its configured `timeout` is failed: the agent records the check as critical without blocking the check loop, and the script runs again at the next interval. This is the mechanism that turns a hung batch job into a visible unhealthy status. The agent does not kill the stray process, so overlapping executions are possible if scripts routinely exceed the timeout.

Exam trap

The trap here is assuming the agent kills a script that exceeds its timeout, when in fact it only stops waiting and reports the check as failed.

139
MCQeasy

An administrator needs to query service information. Which DNS record type is commonly used by Consul to return service addresses?

A.TXT
B.MX
C.CNAME
D.SRV
AnswerD

Consul's DNS interface publishes SRV records that carry both the target hostname and the service port, letting clients discover where a service listens. A records return only addresses, so SRV is the record type that answers service-address queries.

Why this answer

Consul's DNS interface primarily uses SRV records to return service addresses because SRV records include both the hostname and the port number of the service instances. This allows clients to discover not just the IP address but also the port on which the service is listening, which is essential for dynamic service discovery. While A records can return IP addresses, they lack port information, making SRV the preferred record type for querying service information in Consul.

Exam trap

The trap here is confusing DNS record types: candidates might think A records are used because they return IP addresses, but Consul specifically uses SRV records to include port information, which is crucial for service discovery.

How to eliminate wrong answers

Option A is wrong because TXT records are used for arbitrary text data, not for returning service addresses; Consul may use TXT records for metadata but not for the primary service address query. Option B is wrong because MX records are for mail exchange servers, which are unrelated to Consul's service discovery. Option C is wrong because CNAME records are used for aliasing one domain name to another, not for returning service addresses with port information; Consul does not use CNAME for service queries.

140
MCQmedium

A service has a TTL check configured with a 30-second TTL. If the application crashes and stops sending heartbeats, when will the service status change to 'critical'?

A.After 60 seconds
B.Once the agent restarts
C.Immediately
D.After 30 seconds
AnswerD

A TTL check expects a heartbeat within its TTL window. Once 30 seconds elapse without one, Consul marks the check critical, so the service status changes immediately at that expiry rather than after a further grace period.

Why this answer

A TTL check in Consul marks the service as critical when the TTL interval elapses without a heartbeat update. Since the TTL is set to 30 seconds, the check will transition to critical exactly 30 seconds after the last successful heartbeat. The application crashing means no further heartbeats are sent, so the timer expires and Consul updates the service status to critical.

Exam trap

Consul 1.15 often tests the misconception that TTL checks expire immediately or after double the TTL, but the correct behavior is that the status changes to critical exactly after the TTL period elapses without a heartbeat.

How to eliminate wrong answers

Option A is wrong because 60 seconds would only be correct if the TTL were 60 seconds or if there were a doubling mechanism, which Consul does not have for TTL checks. Option B is wrong because the agent restarting is unrelated to TTL expiration; the check status is based on the last heartbeat time, and a restart would not delay the critical status if the TTL has already expired. Option C is wrong because Consul does not immediately mark a TTL check as critical upon missing a heartbeat; it waits for the full TTL duration to elapse before changing the status.

141
Multi-Selectmedium

Which TWO of the following are valid ways to troubleshoot inter-datacenter communication issues?

Select 2 answers
A.Change the datacenter name in the config.
B.Inspect server logs for RPC errors between datacenters.
C.Restart all clients in the datacenter.
D.Use 'consul members -wan' to verify remote server visibility.
E.Use 'consul kv export' to sync data.
AnswersB, D

Inspecting server logs surfaces RPC errors that reveal failed cross-datacenter RPCs, directly satisfying the need to diagnose inter-datacenter communication faults. Consul's server-to-server RPC traffic carries replication and forwarding requests, so logged RPC failures pinpoint connectivity or TLS problems between datacenters.

Why this answer

Option B is correct because inter-datacenter communication in Consul relies on the WAN gossip pool and RPC forwarding between servers, so inspecting server logs for RPC errors (such as failed RPCs to remote datacenters or WAN gossip issues) is a valid diagnostic step to identify connectivity or federation problems. Option D is correct because 'consul members -wan' lists the members of the WAN gossip pool, allowing you to verify that servers in remote datacenters are visible and participating in cross-datacenter communication. Option A is not a valid troubleshooting method because changing the datacenter name alters the identity of the cluster and would break existing federation rather than diagnose it.

Option C is not appropriate because restarting all clients does not address server-to-server WAN communication and could cause unnecessary disruption. Option E is incorrect because 'consul kv export' only exports key/value data and does not test or repair inter-datacenter connectivity.

Exam trap

The trap is picking disruptive or unrelated actions like restarting clients or exporting KV data as 'troubleshooting' — the exam tests whether you know that federation diagnostics focus on WAN gossip membership and server RPC logs, not on client restarts or KV operations.

142
MCQeasy

What is the purpose of the 'service-tag' in a Consul service definition?

A.To provide additional categorization or versioning for services.
B.To define the physical location of the server.
C.To set the priority of the service in DNS.
D.To encrypt communication between services.
AnswerA

Service tags supply arbitrary metadata labels that Consul exposes through the catalog and DNS interface, enabling categorisation, versioning and filtered queries. This satisfies the stem's requirement to describe the tag's purpose: attaching non-functional identifiers to a service registration for discovery and grouping, rather than configuring health checks or routing behaviour.

Why this answer

Service tags in Consul are arbitrary string labels attached to a service registration that enable additional categorization, versioning, and filtering. They are commonly used with DNS queries (e.g., tag.service.consul) and in prepared queries or Connect intentions to select subsets of service instances. Tags do not affect the service's network location, DNS priority, or encryption.

Exam trap

The trap here is confusing service tags with other service definition fields like address, port, or meta, or assuming tags control DNS priority or encryption.

How to eliminate wrong answers

Option B is wrong because the physical location of a server is defined by the service's address and port fields, not by tags. Option C is wrong because Consul DNS does not use tags to set priority; DNS SRV records may include priority and weight, but these are separate fields in the service definition, not tags. Option D is wrong because encryption between services is handled by Consul Connect (mTLS) and is unrelated to service tags.

143
Multi-Selecthard

Which TWO of the following are true regarding Consul KV watches?

Select 2 answers
A.Watches can only monitor keys that exist
B.Watches use blocking queries internally
C.Watches automatically restart after a script failure
D.Watches can be defined in agent configuration files
E.Watches are only available in the Enterprise edition
AnswersB, D

Consul KV watches rely on blocking queries, where the client sends a request with an index and the server holds it open until data changes or the wait timeout expires. This satisfies the stem's requirement for a true statement about watch internals, avoiding polling overhead through long-poll semantics.

Why this answer

Option B is correct because Consul watches are implemented on top of blocking queries: the watch issues a request with an index and the Consul server holds the connection open until the data changes or the wait time expires, then returns a new index. Option D is correct because watches can be declared in the agent's configuration files (a `watches` block in HCL/JSON) so the agent starts them automatically, in addition to being startable via the `consul watch` CLI command. Option A is wrong because a watch can target a key that does not yet exist and will fire when it is created.

Option C is wrong because Consul does not automatically restart a watch handler script that fails; the handler is simply invoked on each change. Option E is wrong because watches are available in the open-source edition, not only Consul Enterprise.

Exam trap

Consul 1.15 often tests the distinction between watches and blocking queries — candidates forget that watches are built on blocking queries and may incorrectly assume watches require the key to pre-exist or that failed handlers auto-restart.

144
MCQeasy

When defining a TCP health check, what is the primary indicator that the check is 'passing'?

A.The port is listed in netstat
B.The service responds with a specific string
C.The service returns a 200 OK
D.The agent receives a successful TCP handshake
AnswerD

A successful TCP handshake confirms the target port is open and accepting connections, which is the sole pass criterion for Consul's TCP health check. Unlike HTTP checks, no status code or payload is evaluated, so the SYN-ACK response itself satisfies the check's passing condition.

Why this answer

For a TCP health check, Consul considers the check passing if it can successfully establish a TCP connection to the specified port. This is indicated by a successful TCP handshake (SYN, SYN-ACK, ACK). No application-level response is required.

Exam trap

The trap here is confusing TCP checks with HTTP checks, leading candidates to expect an HTTP status code or specific string, when TCP checks only verify connectivity.

How to eliminate wrong answers

Option A is wrong because the port being listed in netstat only shows that the service is listening, not that it is accepting connections; the port could be firewalled or the service unresponsive. Option B is wrong because expecting a specific string is typical of an HTTP or script check, not a TCP check. Option C is wrong because a 200 OK is an HTTP status code, not applicable to TCP checks.

145
MCQmedium

You are using a Consul Watch to monitor KV changes. What does the 'handler' field specify?

A.The path to the executable to trigger.
B.The address of the Consul server.
C.The filter criteria for the watch.
D.The KV key to watch.
AnswerA

The handler field names the external executable Consul invokes when watched KV data changes, satisfying the requirement to trigger a program on updates. Consul runs this process directly, passing change details via environment variables and stdin, rather than performing any in-process callback or HTTP notification.

Why this answer

In a Consul watch configuration, the `handler` field specifies the path to an executable that Consul invokes when the watched data changes. Consul passes the watch results as JSON on stdin to the handler, and the handler can act on the change (e.g., reload a service, update a config file). It is not a filter, server address, or key path.

Exam trap

The trap is confusing the `handler` (the executable to run) with the watch's `data` fields (what to watch) — candidates often pick the key or filter option because they misread what `handler` controls.

How to eliminate wrong answers

Option B is wrong because the Consul server address is configured via the `-http-addr` flag or `CONSUL_HTTP_ADDR`, not the `handler` field. Option C is wrong because filter criteria are expressed in the watch's `data` block (e.g., `key`, `prefix`, `name`), not in `handler`. Option D is wrong because the KV key to watch is specified in the watch's `data` section (e.g., `key = "foo/bar"`), while `handler` is the executable to run.

146
MCQmedium

What is the purpose of the 'datacenter' field in the Consul agent configuration?

A.To limit the number of clients.
B.To segment the cluster into logical datacenters.
C.To enable encryption.
D.To identify the node for metrics.
AnswerB

The datacenter field labels which Consul datacenter an agent belongs to, letting servers, services and queries be scoped to that logical segment. Agents in different datacenters form separate clusters joined only through WAN gossip, enabling multi-region segmentation.

Why this answer

The 'datacenter' field in the Consul agent configuration assigns the agent to a named logical datacenter, which segments the cluster into independent failure domains. Each datacenter has its own LAN gossip pool, its own Raft consensus group of servers, and its own catalog and KV store. Agents in different datacenters communicate only through the WAN gossip pool and cross-datacenter RPC, not through the LAN pool.

Exam trap

Consul 1.15 often tests whether candidates understand that 'datacenter' is a logical segmentation label, not an encryption, capacity, or identity setting — the distractor options borrow features that belong to other config fields.

How to eliminate wrong answers

Option A is wrong because client count is not limited by the datacenter field — it is a naming/segmentation attribute, not a capacity control. Option C is wrong because encryption is enabled via 'encrypt' (gossip) and 'verify_outgoing'/'verify_incoming' (TLS), not via the datacenter name. Option D is wrong because node identity for metrics is set via the 'node_name' field and telemetry tags, not the datacenter field.

147
MCQmedium

A service is registered with a health check that has the field deregister_critical_service_after set to "10m". The service's check has been in the critical state for 15 minutes. What will Consul do?

A.The check will be marked as warning.
B.The service will be deregistered from the catalog.
C.The service will be placed in maintenance mode.
D.The check will be restarted and re-evaluated.
AnswerB

The deregister_critical_service_after field specifies a duration after which a service in critical state is automatically deregistered. Since the check has been critical for 15 minutes, which exceeds the 10-minute threshold, Consul will remove the service from the catalog. This prevents stale unhealthy services from lingering.

Why this answer

When deregister_critical_service_after is set, Consul automatically deregisters a service if its check remains critical for longer than the specified duration. In this case, 15 minutes exceeds the 10-minute threshold, so the service is removed from the catalog. The check status does not change to warning, and maintenance mode is not involved.

Exam trap

The trap here is confusing automatic deregistration with maintenance mode or assuming the check transitions to warning after a timeout.

148
MCQhard

When a health check is failing, which Consul API endpoint would you call to investigate the specific error message provided by the check?

A./v1/agent/services
B./v1/agent/self
C./v1/catalog/nodes
D./v1/health/checks/<service>
AnswerD

The /v1/health/checks/<service> endpoint returns each check's status plus its Output field, which carries the exact error text the check script produced. That message pinpoints why the check is failing, unlike the aggregated node or service health endpoints.

Why this answer

The /v1/health/checks/<service> endpoint returns the health checks for a given service, including the status and output of each check. This output often contains the specific error message from the check, making it the correct endpoint to investigate a failing health check.

Exam trap

Consul 1.15 often tests the distinction between agent-level and catalog-level endpoints, causing candidates to choose /v1/agent/services for health check details when it only lists services.

How to eliminate wrong answers

Option A is wrong because /v1/agent/services lists services registered with the agent but does not include health check details. Option B is wrong because /v1/agent/self returns the agent's configuration and status, not service health checks. Option C is wrong because /v1/catalog/nodes lists nodes in the catalog but does not provide health check error messages.

149
MCQeasy

A Consul 1.15 operator is defining a TTL-based health check for a batch job that only reports in when it completes a run. The job must be marked critical if it has not checked in within 30 minutes. The operator wants the check to start in the passing state so a freshly registered job is not immediately flagged. Which configuration block accomplishes this?

A.check = { id = "batch", ttl = "30m", status = "passing" }
B.check = { id = "batch", ttl = "30m", deregister_critical_service_after = "30m" }
C.check = { id = "batch", ttl = "30m", fail_fast = true }
D.check = { id = "batch", interval = "30m", status = "passing" }
AnswerA

A TTL check uses the ttl field to define how long Consul waits for a check-in before marking the check critical, and the status field seeds the initial state so the new registration begins as passing. This matches the requirement of a 30-minute window and a non-critical initial state for the batch job.

Why this answer

TTL checks are passive: the service must periodically call the pass, warn, or fail endpoints, and the ttl field sets the deadline after which Consul flips the check to critical. The status field is the documented way to seed the initial reported state, so a newly registered batch job can start as passing and only become critical if it misses its 30-minute check-in window.

Exam trap

The trap here is reaching for interval on a check that has no executable target, when a passive check-in deadline requires the ttl field.

150
MCQhard

An operator wants to create a distributed lock using the Consul KV store and sessions. They create a session with `consul session create` and obtain a session ID. They then attempt to acquire a lock on the key `locks/primary` by running `consul kv put -acquire locks/primary leader1`. The command fails with an error indicating the lock is already held. Which of the following best explains why the lock acquisition failed?

A.The operator did not specify a value for the key, and Consul requires a non-empty value to acquire a lock.
B.The key `locks/primary` already has an associated session that holds the lock, and the session is still active.
C.The session ID used for the `-acquire` operation was not created with the `-behavior=release` flag, so it cannot acquire locks.
D.The key `locks/primary` does not exist yet, and Consul requires the key to be created before acquiring a lock.
AnswerB

In Consul, a lock is acquired by associating a session with a key. If the key already has a `Session` field set to an active session, the lock is held. The `-acquire` flag will fail if the lock is already held by a different active session. This is the most likely cause of the error, as it directly reflects the lock semantics.

Why this answer

Lock acquisition in Consul KV uses sessions. When a key has an active session associated with it, that session holds the lock. A new `-acquire` attempt with a different session will fail because the lock is already held.

The other options describe incorrect requirements or behaviors that do not match Consul's lock semantics.

Exam trap

The trap here is assuming that a lock can be acquired on a key that already has an active session, or misattributing the failure to session behavior flags or key existence.

Page 1

Page 2 of 4

Page 3

All pages