Courseiva

HashiCorp Certified: Consul Associate (Consul 1.15) (Consul 1.15) (Consul 1.15) — Questions 1–75

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

Page 1 of 4

Page 2
1
MCQmedium

An operator wants to list every key beneath the `services/web/` prefix, including nested paths, and see each key's associated flags and modify index. Which command returns that information?

A.consul catalog services services/web/
B.consul kv get services/web/
C.consul kv export services/web/
D.consul kv get -recurse services/web/
AnswerD

The `-recurse` flag makes the get operation return every key sharing the given prefix, including nested paths, along with each key's value, flags, and modify index. This single command satisfies the requirement to enumerate the subtree and inspect metadata for each entry, which is why it is the standard way to audit a KV prefix.

Why this answer

Listing a KV subtree with metadata requires recursion. The `-recurse` flag on `consul kv get` returns every key under the prefix, each with its value, flags, and modify index, which is precisely the audit view the operator needs. A non-recursive get targets a single key, export targets backup workflows, and the catalog command serves a different subsystem.

Exam trap

The trap here is assuming that passing a prefix to a plain get returns the subtree, when Consul only enumerates children when recursion is explicitly requested.

2
MCQmedium

A platform team runs a Consul 1.15 cluster where a legacy VM service registers its health check through the /v1/agent/check/register HTTP API rather than a service definition file. The check is a script check that takes about 40 seconds to finish on a busy host. Operators notice the check flaps to critical roughly every minute even though the script always exits 0 when run manually. The agent's check_update_interval is left at the default. Which change most directly resolves the flapping without altering the script itself?

A.Increase the agent's check_update_interval to a value larger than the check interval.
B.Set the check's status field to passing so the agent stops executing the script.
C.Raise the check's timeout value so it exceeds the script's worst-case runtime.
D.Change the check type from script to TTL and have the script call the TTL endpoint on success.
AnswerC

Consul kills a script check that does not return before its timeout and marks it critical, so a 40-second script under the default 10-second timeout will be terminated and reported as failing. Setting timeout to a value above the observed worst-case runtime lets the script finish and report its real status, stopping the flap without touching the script or the host.

Why this answer

Consul enforces the check's timeout when executing script checks; a script that runs longer than the timeout is terminated and the check reports critical. Because the observed runtime of roughly 40 seconds exceeds the default timeout, the check fails on schedule, producing the regular flapping. Increasing the timeout to exceed the worst-case runtime lets the script complete and report its genuine result.

Exam trap

The trap here is assuming the check interval controls how long a script may run, when it is actually the timeout that terminates a slow script check.

3
MCQeasy

You are deploying Consul servers in a new datacenter that will be a secondary in a federated environment. The primary datacenter is already configured with ACLs enabled and replication is working. You need to ensure the new secondary datacenter can replicate ACLs from the primary. Which configuration must be set on the new secondary's servers?

A.acl_replication_token with a token that has acl:write privileges in the primary datacenter.
B.primary_datacenter set to the name of the primary datacenter and acl_replication_token with acl:read privileges.
C.acl_datacenter set to the primary datacenter name and acl_replication_token with acl:read privileges.
D.acl_replication_enabled set to true and acl_replication_token with acl:write privileges.
AnswerB

The secondary datacenter must know which datacenter is the primary by setting primary_datacenter. Additionally, it needs a token with acl:read privileges in the primary to read ACL data. This token is configured using acl_replication_token. Both settings are required for ACL replication to function in a secondary datacenter.

Why this answer

To enable ACL replication in a secondary datacenter, you must set primary_datacenter to the name of the primary datacenter and provide acl_replication_token with a token that has acl:read privileges in the primary. These two settings allow the secondary servers to authenticate to the primary and read ACL policies, roles, and tokens. Without primary_datacenter, the agent does not know where to replicate from.

Exam trap

The trap here is confusing the deprecated acl_datacenter parameter with the current primary_datacenter, and assuming the replication token needs write privileges instead of read.

4
MCQeasy

What is the default value for the Consul KV flags field if not provided during a write?

A.1
B.null
C.0
D.-1
AnswerC

Consul's KV write API defaults the Flags field to 0 when the request omits it. Flags is an opaque 64-bit unsigned integer reserved for client-side use, so Consul stores zero rather than rejecting the write.

Why this answer

When a KV pair is written without specifying the flags field, Consul defaults the flags value to 0. The flags field is a 64-bit unsigned integer used for application-specific metadata, and its zero value indicates no flags set.

Exam trap

The trap is assuming flags defaults to null or 1 because it is optional metadata; candidates forget that Consul uses a zero-value integer default for unset numeric fields.

How to eliminate wrong answers

Option A is wrong because 1 is not a default — it would imply a specific flag bit is set, which Consul does not assume. Option B is wrong because null is not a valid value for the flags field; Consul stores it as an integer, not a nullable type. Option D is wrong because -1 is not valid for an unsigned 64-bit integer and is not the default.

5
MCQmedium

You need to perform a write operation to the Consul KV store that only succeeds if the current ModifyIndex of the key is zero. Which parameter should you include in your API call?

A.acquire=0
B.cas=0
C.flags=0
D.index=0
AnswerB

Consul's check-and-set parameter makes the write conditional on the key's current ModifyIndex. Supplying cas=0 means the operation succeeds only when the key does not yet exist, since a fresh key has ModifyIndex zero. Any existing key returns a conflict, satisfying the stem's requirement exactly.

Why this answer

The Consul KV write API supports a 'cas' (Check-And-Set) parameter that performs an atomic compare-and-swap against the key's ModifyIndex. Setting cas=0 means the write only succeeds if the key does not currently exist (ModifyIndex is zero), which is the standard way to implement create-if-not-exists semantics.

Exam trap

Consul 1.15 often tests the difference between 'cas' (compare-and-swap on ModifyIndex) and 'acquire' (session-based lock acquisition) — candidates confuse the two because both are conditional write parameters.

How to eliminate wrong answers

Option A is wrong because 'acquire' is used with Consul sessions to acquire a lock on a key, not to compare against ModifyIndex. Option C is wrong because 'flags' is an opaque unsigned integer stored alongside the KV pair for client use and has no role in conditional writes. Option D is wrong because 'index' is a blocking-query parameter used on reads to wait for changes beyond a given index, not a write precondition.

6
MCQmedium

A security team stores application secrets under the Consul KV prefix `app/prod/`. They want to be notified whenever any key under that prefix changes, without repeatedly polling the entire prefix. They have access to the Consul HTTP API and the `consul watch` command. Which approach should they use?

A.Use `consul watch -type=checks -service=app` to monitor the health of the application service.
B.Use `consul watch -type=keyprefix -prefix=app/prod/` to monitor all keys under the prefix.
C.Use `consul watch -type=event -name=app/prod/` to watch for custom events with that name.
D.Use `consul watch -type=key -key=app/prod/` to monitor the prefix as a single key.
AnswerB

The `consul watch` command supports the `keyprefix` watch type, which monitors all keys under a given prefix. When any key under `app/prod/` is added, modified, or deleted, the watch fires and returns the current state of the prefix. This avoids polling and efficiently notifies the team of any change.

Why this answer

The `keyprefix` watch type is designed to monitor all keys under a given prefix and trigger notifications on any change. It uses blocking queries internally, so it is efficient and immediate. The other watch types target single keys, health checks, or events, none of which would detect changes across the entire `app/prod/` prefix.

Exam trap

The trap here is confusing the `key` watch type with the `keyprefix` watch type, assuming that specifying a prefix with `key` will automatically monitor all nested keys.

7
MCQeasy

A developer is deploying a new service called 'inventory' with a Connect sidecar proxy. They want to verify that the sidecar is running and registered correctly. Which command should they use to check the status of the Connect-enabled service?

A.consul catalog nodes -service=inventory
B.consul health service inventory
C.consul services status inventory
D.consul connect status inventory
AnswerB

The 'consul health service' command displays the health checks associated with a service, including the sidecar proxy if it is registered as a service. For a Connect-enabled service, the sidecar proxy is registered as a separate service named 'inventory-sidecar-proxy'. Running 'consul health service inventory' shows the health of the main service, and you can also check the sidecar proxy's health. This command is the standard way to verify service and proxy status.

Why this answer

To check the status of a Connect-enabled service, you should use 'consul health service' because it returns the health checks for the service and its sidecar proxy. The sidecar proxy is registered as a separate service, so you can also query it directly. Commands like 'consul catalog nodes' only show node placement, not health or proxy status.

Exam trap

The trap here is assuming there is a dedicated 'consul connect status' command or that 'consul services status' exists, when in fact health checks are queried via 'consul health service'.

8
MCQeasy

Which interface would you use to register a service dynamically using standard tools like 'curl'?

A.HTTP API
B.DNS interface
C.Gossip protocol
D.CLI agent command
AnswerA

The HTTP API exposes REST endpoints that accept service definitions via PUT requests, so standard tools like curl can register services without installing the Consul CLI or agents. This directly satisfies the stem's requirement for dynamic registration using generic HTTP clients rather than Consul-specific tooling.

Why this answer

The HTTP API is the primary programmatic interface for Consul and exposes RESTful endpoints such as PUT /v1/agent/service/register, which can be invoked with standard tools like curl. This makes it the correct choice for dynamically registering a service without using the CLI or configuration files. The DNS interface is read-only for service discovery, and gossip is an internal membership protocol, not a registration mechanism.

Exam trap

The trap here is confusing the DNS interface (read-only discovery) with the HTTP API (read-write management), leading candidates to pick DNS because it is a familiar Consul feature.

How to eliminate wrong answers

Option B is wrong because the DNS interface only resolves service names to IP addresses and cannot register or modify services. Option C is wrong because the gossip protocol is used for Serf-based cluster membership and failure detection, not for service registration. Option D is wrong because the CLI agent command (e.g., consul services register) is a wrapper around the HTTP API and is not the interface itself; the question asks for the interface usable with standard tools like curl.

9
Multi-Selectmedium

A DevOps engineer is configuring a Consul service `payment-processor` that must be discoverable only when its health check is passing. The service is registered with a script health check that runs every 10 seconds. The engineer wants to ensure that DNS queries for `payment-processor` return only healthy instances. Which two actions should the engineer take? (Choose two.)

Select 2 answers
A.Include the `passing` parameter in the DNS query.
B.Use the `?near` parameter in the DNS query to prioritize local instances.
C.Set the `"status": "passing"` field in the service registration.
D.Register the service with a health check that is associated with the service.
E.Configure the service with `"enable_tag_override": true`.
AnswersA, D

The `passing` parameter in a DNS query explicitly filters results to only instances with passing health checks. For `payment-processor`, using `payment-processor.service.consul?passing` ensures that only healthy instances are returned. This is a direct way to enforce health-based filtering in DNS queries, which is exactly what the engineer needs.

Why this answer

To ensure DNS queries return only healthy instances of `payment-processor`, the service must have an associated health check, and the DNS query must include the `passing` parameter. The health check association allows Consul to track the service's health, while the `passing` parameter filters results to only passing instances. Together, these actions guarantee that only healthy instances are discoverable via DNS.

Exam trap

The trap here is assuming that simply registering a health check is enough, or that other parameters like `near` or `enable_tag_override` affect health filtering, when in fact the `passing` parameter and proper health check association are required.

10
MCQhard

A platform team stores service configuration under the Consul KV prefix `config/web/`. An operator runs `consul kv put config/web/timeout 30` at a time when the key already exists with value `45` and ModifyIndex `812`. The operator later needs to update the value only if no one else has changed the key since that write. Which Consul CLI invocation correctly performs this compare-and-swap using the index returned by the prior write?

A.consul kv put -index=812 config/web/timeout 60
B.consul kv put -cas=812 config/web/timeout 60
C.consul kv put -lock=812 config/web/timeout 60
D.consul kv put -modify-index=812 config/web/timeout 60
AnswerB

The `-cas` flag performs a check-and-set using the supplied ModifyIndex. Passing `812`, the index observed from the prior read or write, tells Consul to apply the new value only if the key's current ModifyIndex still equals 812. If another client changed the key in the meantime, Consul returns HTTP 409 Conflict and the write is rejected, which is exactly the compare-and-swap behavior required here.

Why this answer

Consul KV supports optimistic concurrency through the check-and-set parameter, exposed on the CLI as `-cas`. Supplying the ModifyIndex observed from a previous operation makes the write succeed only when the key has not been modified since that index was read. If any other client wrote to the key in between, Consul rejects the update with a conflict, letting the operator re-read and retry rather than silently overwriting another change.

Exam trap

The trap here is assuming any index-like flag can make a KV write conditional, when only the check-and-set parameter compares the supplied index against the key's current ModifyIndex.

11
MCQhard

An operator manages a Consul 1.15 cluster where Connect is enabled and mTLS is active. They need to rotate the Connect CA root certificate for the datacenter. The new root must be distributed to all sidecar proxies without dropping existing connections, and the old root must remain trusted during the transition. Which sequence of actions accomplishes this?

A.Disable Connect, replace the CA, re-enable Connect, and re-register all services with new sidecar proxies.
B.Use 'consul connect ca set-config' to update the root certificate and private key, then restart all sidecar proxies to pick up the new root.
C.Generate a new CA, cross-sign the new intermediate with the old root, update the CA configuration with the cross-signed bundle, then allow proxies to rotate leaf certificates via the existing CA provider.
D.Set 'connect.enable_mtls' to false, update the CA, then set it back to true to force proxies to fetch new certificates.
AnswerC

Cross-signing the new intermediate with the old root creates a chain of trust that both old and new proxies can validate. Updating the CA configuration with the bundle lets Consul distribute the new root while the old root remains trusted. Leaf certificates are rotated automatically by the CA provider, so existing connections are not forcibly broken and the transition is seamless.

Why this answer

The safe rotation path uses cross-signing: the new intermediate is signed by the old root so both roots are trusted during the transition. Updating the CA configuration with the cross-signed bundle lets Consul distribute the new root, and leaf certificates rotate automatically through the CA provider. This avoids downtime and preserves existing connections, unlike replacing the root outright or toggling mTLS.

Exam trap

The trap here is thinking that updating the CA root directly is sufficient, when existing proxies would reject the new chain unless the old root remains trusted via cross-signing.

12
MCQmedium

You are configuring a Consul Connect service mesh and need to enable mTLS for all services in the datacenter. Which configuration setting must be enabled in the Consul server agent configuration to turn on Connect and enforce mTLS globally?

A.connect { enabled = true }
B.tls { defaults { verify_incoming = true } }
C.ports { https = 8501 }
D.acl { enabled = true, default_policy = "deny" }
AnswerA

The 'connect' stanza with 'enabled = true' in the Consul agent configuration enables the Connect feature on that agent. When enabled on servers, it allows the datacenter to issue and manage certificates for Connect. This is the correct setting to globally enable Connect and mTLS. Without it, Connect features are not active.

Why this answer

To enable Consul Connect and mTLS globally, the 'connect' stanza with 'enabled = true' must be set in the Consul agent configuration, typically on all servers and clients. This activates the Connect subsystem, allowing services to obtain certificates and use sidecar proxies. Other settings like TLS verification for the agent, HTTPS port, or ACLs do not enable Connect.

Exam trap

The trap here is confusing Consul agent TLS settings with Connect mTLS, assuming that enabling TLS for the agent automatically enables service mesh encryption.

13
MCQhard

A team stores rolling deployment state under `deploy/current`. To avoid a race where two operators both believe they own the release, the application must acquire the key only if it is not already held, and it must automatically release the key if the holding process dies. Which combination of Consul primitives achieves this?

A.Use consul kv put with the -cas flag set to the current ModifyIndex on every write attempt.
B.Create a session, then call the KV acquire endpoint with that session and the key; the lock is released automatically when the session expires.
C.Write the key with consul kv put, then poll the key every second to detect a competing writer.
D.Register a service check for the operator and rely on the catalog health status to block duplicate writes.
AnswerB

Acquire is atomic and succeeds only when the key is unheld or already held by the same session. Binding the key to a session means Consul releases it when the session is invalidated, whether by TTL expiry or a failed health check, giving automatic release on process death.

Why this answer

Mutual exclusion with automatic release requires a session-bound acquisition. The acquire operation is atomic, so only one session can hold the key, and because the key is tied to a session it is freed when that session ends. This pairs contention safety with failure recovery, which plain writes or check-and-set alone cannot provide.

Exam trap

The trap here is assuming check-and-set alone provides locking, when it only prevents lost updates and never releases a key after a process dies.

14
MCQmedium

A platform team runs a Consul 1.15 cluster where a critical payment service is registered with a TTL health check. The service owner wants Consul to mark the check as critical if the application fails to renew the TTL for more than one minute. Which configuration field should be set in the service definition to enforce this behavior?

A.ttl
B.deregister_critical_service_after
C.interval
D.timeout
AnswerA

For a TTL check, the ttl field specifies the duration after which the check becomes critical if no successful update is received. Setting it to 1m ensures that if the application does not renew the TTL within one minute, Consul marks the check critical, exactly matching the requirement.

Why this answer

TTL health checks are passive: the application must periodically renew the check via the HTTP API. The ttl field defines the maximum time allowed between renewals before Consul transitions the check to critical. Other fields like interval or timeout apply to active checks, and deregister_critical_service_after controls removal, not the critical transition.

Exam trap

The trap here is confusing passive TTL checks with active checks and assuming that interval or timeout governs TTL expiry.

15
MCQmedium

A Consul operator observes that a web service registered on two nodes is only reachable through the DNS interface on one node. The service definition on both nodes is identical, including the same service name and port. What is the most likely cause?

A.The node that is not returning results has not been configured with the correct datacenter.
B.The service definition is missing the 'tags' field, causing the DNS query to return only one instance.
C.The DNS interface requires the 'passing' parameter to be set to true to return all instances.
D.The service on the unreachable node is failing its health check, so it is excluded from DNS results.
AnswerD

Consul's DNS interface by default returns only healthy instances of a service. If the health check on one node's service is failing, that instance is omitted from DNS responses. This is the most common reason for a service appearing on one node but not another when definitions are identical. The operator should verify the health check status using the HTTP API or Consul UI.

Why this answer

Consul's DNS interface only returns service instances that are passing their health checks. When two identical service definitions exist but only one appears in DNS results, the most probable cause is that the other instance is failing its health check. The operator should inspect the health check status for that service instance using the Consul UI or the /health/service API endpoint.

Exam trap

The trap here is assuming that identical service definitions guarantee both instances are healthy and discoverable, overlooking the impact of health check status on DNS results.

16
Multi-Selecteasy

Which TWO of the following are benefits of using Consul Connect?

Select 2 answers
A.Centralized authorization policies.
B.Automatic mTLS management.
C.Increased application latency.
D.Elimination of firewalls.
E.Automatic database replication.
AnswersA, B

Intentions provide this.

Why this answer

Consul Connect is HashiCorp's service mesh feature, and one of its core benefits is centralized authorization policies (Option A): intentions define which services may communicate with which others, and these policies are managed centrally in Consul and enforced by sidecar proxies, giving consistent, identity-based access control across the mesh. Option B is also correct because Consul Connect automatically manages mTLS: it provides built-in certificate authority functionality that issues, rotates, and distributes certificates to sidecar proxies, so service-to-service traffic is encrypted and mutually authenticated without application changes. Option C is wrong because Connect's sidecar proxies add only minimal overhead and are not intended to increase latency as a benefit.

Option D is wrong because firewalls are still required for network segmentation and host-level security; Connect complements rather than eliminates them. Option E is wrong because Consul Connect is a service mesh for secure service communication, not a database replication tool.

Exam trap

Consul 1.15 often tests the core benefits of Connect versus its operational costs, so candidates might mistakenly select 'elimination of firewalls' as a benefit when it's actually a misconception.

17
Multi-Selecthard

Which THREE of the following represent potential bottlenecks for Consul KV performance?

Select 3 answers
A.Very large number of keys
B.Very high write throughput
C.High read frequency
D.Very large value sizes
E.Using HTTP instead of RPC
AnswersA, B, D

A very large number of keys inflates the key space that Consul must track, replicate and index across servers, raising memory pressure and Raft log overhead. This directly bottlenecks KV performance, since every write must be consistently replicated to the cluster's followers.

Why this answer

Option A is correct because Consul's KV store keeps all keys in memory and replicates them via Raft, so a very large number of keys increases memory pressure, snapshot size, and Raft log/replication overhead, degrading performance. Option B is correct because every KV write must be committed through the Raft consensus protocol and replicated to a quorum of servers, so very high write throughput becomes a bottleneck as the leader serializes and replicates each write. Option D is correct because very large value sizes inflate Raft log entries, snapshot transfers, and network replication traffic, and Consul enforces a maximum KV value size (512 KB) precisely because oversized values harm performance.

Option C is not a primary bottleneck because reads can be served by any server (including non-leaders) and stale reads can be served locally, so high read frequency scales better than writes. Option E is not a bottleneck because HTTP is the standard Consul KV API transport and the RPC layer is used internally; the protocol choice itself is not a performance-limiting factor compared to key count, write volume, and value size.

Exam trap

Consul 1.15 often tests whether candidates misidentify read frequency or transport protocol as bottlenecks, when the real constraints are write volume, key count, and value size on the Raft-replicated store.

18
MCQeasy

A cloud engineer is setting up a new Consul 1.15 datacenter that will join an existing WAN federation. The existing datacenter uses a specific gossip encryption key for the WAN pool. Which configuration parameter must be set on the new datacenter's servers to ensure they can participate in WAN gossip?

A.primary_datacenter
B.acl_replication_token
C.retry_join_wan
D.encrypt
AnswerD

The encrypt parameter specifies the gossip encryption key used for both LAN and WAN gossip. For a new datacenter to join the WAN federation, its servers must use the same gossip encryption key as the existing datacenter's WAN pool. Setting encrypt correctly is essential for secure and successful WAN gossip communication.

Why this answer

The encrypt parameter sets the gossip encryption key. For WAN gossip to function between datacenters, all servers in the WAN pool must use the same encryption key. Configuring encrypt on the new datacenter's servers with the existing key allows them to securely join the WAN gossip pool.

Exam trap

The trap here is confusing parameters used for ACL replication or join addresses with the gossip encryption key, which is set by encrypt.

19
MCQhard

You are monitoring service health using Consul and want to ensure that a service is automatically removed from the catalog if it remains in a 'critical' state for more than 24 hours. Which configuration key supports this?

A.cleanup_interval
B.critical_timeout
C.deregister_critical_service_after
D.remove_service_after
AnswerC

deregister_critical_service_after specifies the duration a service may remain critical before Consul automatically removes it from the catalog. Setting it to 24h satisfies the requirement, unlike checks or timeouts that only affect health status without deregistering the service.

Why this answer

The deregister_critical_service_after setting in a Consul service definition tells Consul to automatically deregister a service instance if its health check remains in the critical state for longer than the specified duration (e.g., '24h'). This is exactly the built-in mechanism for automatic removal of persistently unhealthy services.

Exam trap

The trap is choosing a plausible-sounding but non-existent key like critical_timeout or remove_service_after — candidates must recall the exact Consul key name deregister_critical_service_after.

How to eliminate wrong answers

Option A is wrong because cleanup_interval is a Consul agent configuration for how often the agent cleans up dead/expired entries (e.g., failed nodes, expired sessions), not a per-service critical-state timeout. Option B is wrong because critical_timeout is not a valid Consul service configuration key. Option D is wrong because remove_service_after is not a valid Consul key — the correct key is deregister_critical_service_after.

20
MCQhard

An operator needs to update the value of `config/database/url` in Consul KV, but only if the current value is exactly `postgres://old:5432`. They want to use the Consul CLI to perform a compare-and-swap operation. Which command should they use?

A.consul kv put -cas=123 config/database/url postgres://new:5432
B.First retrieve the current ModifyIndex of `config/database/url` and verify the value is `postgres://old:5432`, then use `consul kv put -cas=<index> config/database/url postgres://new:5432`.
C.consul kv put -cas -value=postgres://old:5432 config/database/url postgres://new:5432
D.consul kv put -cas -modify-index=123 config/database/url postgres://new:5432
AnswerB

Consul's compare-and-swap is based on the ModifyIndex, not the value. To ensure the value is as expected, the operator must first read the key to check its value and obtain its ModifyIndex, then use `-cas` with that index. If the key changes between the read and the write, the CAS operation fails, preventing race conditions.

Why this answer

Consul KV does not support value-based compare-and-swap directly. The `-cas` flag uses the ModifyIndex to ensure atomic updates. The correct approach is to read the key, verify the value, and then use the ModifyIndex with `-cas`.

This prevents lost updates if another client modifies the key in between.

Exam trap

The trap here is assuming Consul's CAS operation compares the value itself, when it actually compares the ModifyIndex.

21
MCQmedium

You need to register a health check that triggers an alert when memory usage is high. Which type of check is most appropriate?

A.gRPC Check
B.HTTP Check
C.Script Check
D.TCP Check
AnswerC

A script check runs an external command on the node and evaluates its exit code, so a script reading memory usage can return non-zero when a threshold is exceeded. This suits alerting on high memory, unlike TCP or HTTP checks.

Why this answer

A Script check runs an arbitrary executable on the Consul client at a defined interval and interprets its exit code (0 = passing, 1 = warning, other = critical), making it the only check type that can inspect local system metrics like memory usage. HTTP, TCP, and gRPC checks only verify reachability or protocol-level responses and cannot read OS-level resource counters.

Exam trap

Consul 1.15 often tests check-type selection by describing a metric (memory, disk, CPU) that only a Script check can observe — the trap is picking HTTP or TCP because they sound more 'standard' or 'lightweight'.

How to eliminate wrong answers

Option A is wrong because a gRPC check only performs a gRPC health-check probe against a service endpoint; it has no visibility into host memory. Option B is wrong because an HTTP check merely issues a GET and evaluates the status code or body match — it cannot measure memory. Option D is wrong because a TCP check only confirms a socket can be opened on a port, which says nothing about resource consumption.

22
MCQmedium

An operator configures a TCP health check for a database service on port 5432, specifying tcp = "localhost:5432" and interval = "10s". The database process is running and accepting connections, but the check is reported as critical. What is the most likely explanation?

A.The check is being executed from a different network namespace than the database process.
B.The interval is too short; Consul requires a minimum interval of 30 seconds for TCP checks.
C.The Consul agent does not have network permissions or the database is bound only to a specific interface not matching localhost.
D.The TCP check requires an explicit timeout value, and without it the check immediately fails.
AnswerC

The TCP check attempts a connection to the specified address. If the database is bound only to a specific IP (e.g., 127.0.0.1 vs ::1) or the agent lacks permissions, the connection fails. The scenario says the database is accepting connections, but not necessarily on the exact address the check uses. This is the most likely cause.

Why this answer

A TCP health check succeeds only if the agent can establish a TCP connection to the specified address and port. Even if the database is running, it might be listening on a different interface (e.g., only on a specific IP, not localhost) or the agent might lack the necessary permissions. The configured address localhost:5432 must match where the database is actually listening.

Therefore, the most likely explanation is a mismatch in the listening address or a permission issue preventing the connection.

Exam trap

The trap here is assuming that a running service automatically means the TCP check will succeed, overlooking that the service must be listening on the exact address and port specified in the check.

23
MCQmedium

An operator is configuring a new Consul datacenter that must be able to resolve services in a remote datacenter using the DNS interface. The remote datacenter is already federated and reachable. Which query format should the operator use to resolve a service named 'web' in the remote datacenter 'dc2'?

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

Consul's DNS interface supports cross-datacenter lookups by including the datacenter as a label before the domain. The format is <service>.service.<datacenter>.consul. Querying web.service.dc2.consul asks the local Consul agent to resolve the 'web' service in dc2 via the WAN federation, returning healthy instances from that remote catalog.

Why this answer

Consul DNS encodes the datacenter as a label positioned directly after the 'service' label. The canonical form is <service>.service.<datacenter>.consul. Other label orders or query parameters are not recognized by the DNS interface, so only the format with the datacenter immediately following 'service' will trigger a WAN-forwarded lookup to the remote catalog.

Exam trap

The trap here is assuming the datacenter label position is flexible or that query parameters can select a datacenter, when Consul requires a fixed label order.

24
MCQhard

You are troubleshooting a partition between two datacenters. The WAN gossip shows high latency. Which Consul CLI tool provides the best insight into the WAN gossip state?

A.consul operator raft list-peers
B.consul members -wan
C.consul monitor
D.consul kv get
AnswerB

`consul members -wan` queries the WAN gossip pool directly, listing every datacenter's server agents with their gossip status and round-trip latency. That satisfies the stem's need for insight into WAN gossip state under high latency, unlike LAN-scoped commands or RPC-based tooling that bypass the gossip layer entirely.

Why this answer

The consul members -wan command lists all members of the WAN gossip pool, showing their status, address, port, protocol, and build. It is the primary CLI tool for inspecting the health and membership of the WAN gossip layer that connects datacenters in a federation. High latency or partition issues in WAN gossip will be visible as failed or left members in this output, making it the best diagnostic choice.

Exam trap

The trap is confusing Raft peer listing with gossip membership; candidates may pick consul operator raft list-peers because it sounds like it shows cluster state, but it only covers the Raft consensus layer within one datacenter, not the WAN gossip pool.

How to eliminate wrong answers

Option A is wrong because consul operator raft list-peers shows the Raft consensus peers within a single datacenter's server cluster, not the WAN gossip state across datacenters. Option C is wrong because consul monitor streams recent logs from the local agent, which may contain gossip-related messages but does not provide a structured view of WAN membership. Option D is wrong because consul kv get retrieves a key from the KV store and has no bearing on gossip or network state.

25
MCQhard

You observe that a session lock is being released unexpectedly. What is the most likely cause?

A.The Consul agent is in leader mode.
B.The index was not incremented.
C.The session TTL is too low, causing premature expiration.
D.The KV key was deleted.
AnswerC

A session lock is released when its TTL elapses, so a TTL set too low expires the session prematurely and frees the lock without any explicit release call. This directly satisfies the stem's unexpected-release constraint: Consul's lock is tied to session lifetime, not to client intent.

Why this answer

Consul sessions are tied to a TTL (Time-To-Live) that must be periodically renewed by the owning agent. If the TTL is set too low and the agent fails to renew in time—due to network latency, agent overload, or misconfiguration—the session expires, and any locks held by that session are automatically released. This is the most common cause of unexpected lock releases in Consul.

Exam trap

Consul 1.15 often tests the misconception that session locks are released only when the key is deleted or the agent crashes, but the most common cause is TTL expiration due to missed renewals.

How to eliminate wrong answers

Option A is wrong because leader mode is a property of the Consul server cluster (Raft leader), not a client agent; an agent being in leader mode does not affect session locks. Option B is wrong because the index is a monotonically increasing value used for blocking queries and consistency; it does not cause session expiration or lock release. Option D is wrong because deleting the KV key would remove the lock entry, but the question asks about the lock being released, which implies the session ended; key deletion is a separate action and not the most likely cause of an unexpected release.

26
MCQmedium

Which command displays all active intentions in the Consul mesh?

A.consul connect intentions
B.consul kv get intentions
C.consul intention list
D.consul services intentions
AnswerC

`consul intention list` queries the intention endpoint directly, returning every active intention across the mesh with source, destination and action. It satisfies the stem's requirement to display all active intentions without filtering by service name, unlike `consul intention check`, which tests a single source-destination pair.

Why this answer

The command 'consul intention list' displays all active intentions in the Consul mesh. Intentions define which services are allowed to communicate with which other services when Connect is enabled. The list command shows the source, destination, action (allow/deny), and precedence.

Exam trap

Consul 1.15 often tests the exact CLI syntax for intentions; candidates may confuse 'consul intention' with 'consul connect' or 'consul services', leading to invalid commands.

How to eliminate wrong answers

Option A is wrong because 'consul connect intentions' is not a valid command; 'consul connect' has subcommands like 'envoy', 'proxy', but not 'intentions'. Option B is wrong because 'consul kv get intentions' would attempt to retrieve a key named 'intentions' from the KV store, which is unrelated to intentions. Option D is wrong because 'consul services intentions' is not a valid command; 'consul services' has subcommands like 'register', 'deregister', but not 'intentions'.

27
MCQmedium

A Consul operator is using the HTTP API to register a web service with an external health check script. The operator wants to ensure that if the service process fails but the node remains up, the service is marked unhealthy and removed from DNS query results. Which of the following API endpoints should the operator use to register the service and its check together?

A.PUT /v1/agent/service/deregister
B.PUT /v1/agent/service/register
C.PUT /v1/catalog/register
D.PUT /v1/agent/check/register
AnswerB

This endpoint registers a service with the local agent and allows including a check definition in the same payload. The check can be an external script that the agent executes periodically. If the script fails, the service is marked critical, and DNS queries will not return it. This is the correct way to atomically register a service and its health check.

Why this answer

The agent service register endpoint accepts a JSON payload that can include both the service definition and an associated check. This allows the agent to manage the check and update the service's health status. When the external script fails, the check becomes critical, and the service is excluded from DNS results.

Other endpoints either register checks separately or bypass the agent's health monitoring.

Exam trap

The trap here is assuming that any registration endpoint can associate a check with a service, but only the agent service register endpoint allows atomic registration of both.

28
MCQmedium

What is the purpose of the 'Behavior' field when creating a Consul session?

A.To specify what happens to locks on session invalidation.
B.To define the node affinity.
C.To determine if the session can be renewed.
D.To set the session priority.
AnswerA

The Behaviour field controls session invalidation semantics, determining whether locks held by the session are released or remain, directly answering what happens to locks when a session becomes invalid. This governs the release behaviour rather than lock acquisition.

Why this answer

The 'Behavior' field in a Consul session controls what happens to locks held by the session when the session is invalidated (e.g., due to TTL expiry or explicit destruction). The two valid values are 'release' (default), which releases all locks, and 'delete', which deletes the locks. This determines the fate of held locks upon session invalidation.

Exam trap

Consul 1.15 often tests the specific purpose of the Behavior field, and candidates may confuse it with session renewal or node affinity, when it actually controls lock handling on session invalidation.

How to eliminate wrong answers

Option B is wrong because node affinity is not controlled by the Behavior field — it is determined by the session's node and service checks. Option C is wrong because session renewal is governed by the TTL and the session's renewability, not the Behavior field. Option D is wrong because session priority is not a configurable field in Consul sessions.

29
MCQmedium

A platform team runs a service on a VM and wants Consul to automatically remove the service instance from the catalog if its health check remains critical for more than 10 minutes. The service is registered via the agent's configuration directory. Which check definition field accomplishes this?

A.ttl
B.critical_timeout
C.deregister_critical_service_after
D.deregister_after
AnswerC

The deregister_critical_service_after field specifies a duration after which a service in a critical state is automatically deregistered from the catalog. Setting it to 10m meets the requirement of removing the instance after 10 minutes of critical health. This is the exact field designed for this scenario and is valid in service check definitions.

Why this answer

Consul provides deregister_critical_service_after specifically to remove a service from the catalog after it has been critical for a configured duration. This prevents stale service instances from remaining discoverable. The other options are either invalid field names or serve unrelated purposes such as TTL check timing.

Exam trap

The trap here is selecting a plausible-sounding but nonexistent field like critical_timeout instead of the actual deregister_critical_service_after field.

30
Multi-Selecteasy

Which TWO are common use cases for Consul Connect?

Select 2 answers
A.Managing server hardware.
B.Creating virtual machines.
C.Zero-trust networking.
D.Secure service-to-service communication.
E.Configuring network switches.
AnswersC, D

Consul Connect enforces mutual TLS between services, issuing SPIFFE-based identities via its built-in CA, so every connection is authenticated and encrypted regardless of network location. That satisfies zero-trust networking, where trust derives from verified service identity rather than perimeter defences.

Why this answer

Consul Connect is HashiCorp's service mesh feature within Consul, and option C (Zero-trust networking) is correct because Connect enforces identity-based authorization via mutual TLS (mTLS) between services, so no service is trusted by default based on network location. Option D (Secure service-to-service communication) is also correct because Connect provides automatic mTLS encryption, sidecar proxies (Envoy), and intention-based access control for east-west traffic between services. Options A (Managing server hardware), B (Creating virtual machines), and E (Configuring network switches) are incorrect because those are infrastructure provisioning and physical/virtual network device tasks handled by tools like Terraform, hypervisors, or switch management software, not by Consul Connect's service mesh capabilities.

31
MCQeasy

A developer needs to remove an obsolete configuration key `app/legacy/timeout` from Consul's KV store so the application no longer reads it. Which command deletes this single key?

A.consul kv delete app/legacy/timeout
B.consul kv put app/legacy/timeout ""
C.consul kv get app/legacy/timeout
D.consul kv export app/legacy/timeout
AnswerA

`consul kv delete` removes the specified key from the KV store. Given the exact path, it deletes only that key, which is precisely what the developer needs to stop the application from reading the obsolete timeout value. This is the direct, idiomatic way to remove a single key.

Why this answer

Removing a specific key is done with `consul kv delete` pointed at the exact path. That command eliminates the entry so the application stops seeing the obsolete timeout. Reading, overwriting with an empty value, or exporting the key all leave it in place, so none of them achieve the intended removal.

Exam trap

The trap here is assuming that writing an empty value deletes a key, when Consul keeps the key present with a zero-length value until it is explicitly deleted.

32
MCQmedium

When configuring ACL replication, where must the 'acl_replication_token' be defined?

A.In the secondary datacenter's server agents.
B.In the primary datacenter's client agents.
C.In the Consul Enterprise license file.
D.On all nodes in both datacenters.
AnswerA

The acl_replication_token is configured on the secondary datacenter's server agents, which use it to authenticate to the primary datacenter and receive replicated ACL data. Defining it there satisfies the requirement that secondary servers can pull token-protected ACL updates.

Why this answer

ACL replication flows from the primary datacenter to secondary datacenters, and the token that authorizes this replication must be configured on the server agents in the secondary datacenter. The secondary servers use this token to authenticate to the primary and pull ACL data. Client agents do not perform ACL replication, so the token is not needed there.

Exam trap

Consul 1.15 often tests the direction and location of ACL replication — candidates confuse primary vs. secondary and server vs. client, picking 'all nodes' or 'primary clients' when only secondary servers need the token.

How to eliminate wrong answers

Option B is wrong because client agents never perform ACL replication — only servers do, and the token belongs on the secondary datacenter's servers, not the primary's clients. Option C is wrong because the Consul Enterprise license file governs feature entitlements, not ACL replication credentials; the replication token is a Consul ACL token, not a license artifact. Option D is wrong because placing the token on all nodes in both datacenters is unnecessary and a security risk — only secondary server agents need it, and broad distribution violates least privilege.

33
MCQmedium

A developer stores a feature flag at the key `config/features/new-ui` in Consul KV and wants to atomically create it only if it does not already exist, failing the write if the key is present. Which Consul CLI command accomplishes this?

A.consul kv put -flags=0 config/features/new-ui true
B.consul kv put -cas=0 config/features/new-ui true
C.consul kv put -acquire config/features/new-ui true
D.consul kv put -modify-index=0 config/features/new-ui true
AnswerB

The `-cas` flag performs a check-and-set operation. Passing `-cas=0` tells Consul to only write the key if its current ModifyIndex is 0, which is the case for a key that does not exist. If the key is already present, the write fails with a conflict, achieving the atomic create-if-absent behavior the developer needs.

Why this answer

Atomic create-if-absent writes in Consul KV are performed with the check-and-set flag. Supplying a CAS value of zero conditions the write on the key not yet existing, because a missing key reports a ModifyIndex of zero. If another client created the key first, its ModifyIndex becomes non-zero and the conditional write returns an error rather than overwriting it.

Exam trap

The trap here is assuming that a plain `consul kv put` is create-only or that `-flags` enforces uniqueness, when in fact only the `-cas` parameter provides conditional write behavior.

34
MCQeasy

An operator needs to delete the single KV entry `app/temp/cache-ttl` but must leave every other key under `app/temp/` untouched. Which command performs exactly that deletion?

A.consul kv delete -cas=0 app/temp/cache-ttl
B.consul kv delete -recurse app/temp/
C.consul kv put app/temp/cache-ttl ""
D.consul kv delete app/temp/cache-ttl
AnswerD

Supplying the full key path without any recursion flag deletes only that exact entry. Consul treats the argument as a literal key, so sibling keys under `app/temp/` remain intact. This is the precise, least-destructive command for removing one entry while preserving the rest of the prefix.

Why this answer

Deleting a single KV entry requires passing its full path to `consul kv delete` with no recursion flag. Consul then removes only that exact key, leaving all siblings under the same prefix intact. Recursion, check-and-set conditions, and empty-value writes all change behavior in ways that either over-delete, fail, or merely blank the value.

Exam trap

The trap here is confusing deletion with writing an empty value, since a zero-length write leaves the key present and visible to reads and watches.

35
MCQmedium

An operator is configuring a new Consul 1.15 datacenter 'dc3' to join an existing WAN federation with primary datacenter 'dc1'. The operator wants to ensure that dc3 can automatically rejoin the WAN gossip pool after a restart. Which configuration parameter should be set in dc3's server configuration?

A.retry_join_wan
B.start_join_wan
C.join_wan
D.retry_join
AnswerA

retry_join_wan specifies a list of WAN addresses of servers in other datacenters that the agent should attempt to join. Setting this in dc3 ensures that on startup or after a restart, the server will automatically attempt to join the WAN gossip pool, maintaining federation without manual intervention. This is the correct parameter for automatic WAN rejoin.

Why this answer

retry_join_wan is the correct parameter to configure automatic rejoining of the WAN gossip pool. It accepts a list of WAN addresses and continuously retries until successful. This ensures that dc3 remains federated with dc1 even after restarts or network interruptions.

The other parameters either apply to LAN joining or are deprecated or invalid.

Exam trap

The trap here is confusing retry_join_wan with retry_join, which is used for LAN gossip; only the WAN variant ensures automatic rejoin of the cross-datacenter gossip pool.

36
MCQmedium

A service definition includes a 'meta' block. What is the intended use of this block?

A.To configure service discovery timeouts.
B.To define arbitrary key/value metadata for the service.
C.To override the default health check interval.
D.To store authentication credentials.
AnswerB

The meta block stores arbitrary user-defined key/value pairs attached to a service, such as version, owner or environment labels. It is purely descriptive metadata, not configuration, and does not affect health checking, routing or service discovery behaviour.

Why this answer

The 'meta' block in a service definition is used to define arbitrary key/value metadata for the service. This metadata is not used by Consul for routing or health checks but can be used by external tools, for filtering in the UI, or for custom logic in service discovery. It is a flexible way to attach additional information to a service.

Exam trap

Consul 1.15 often tests the purpose of the 'meta' block versus 'tags' or 'check' settings; candidates may incorrectly assume it configures timeouts or health checks.

How to eliminate wrong answers

Option A is wrong because service discovery timeouts are configured via DNS or agent settings, not the 'meta' block. Option C is wrong because health check intervals are defined in the 'check' block, not 'meta'. Option D is wrong because storing authentication credentials in 'meta' is insecure and not the intended use; Consul provides ACLs and Connect for security.

37
MCQhard

You are configuring a Consul secondary datacenter to replicate ACLs from the primary. You have set 'primary_datacenter' and 'acl_replication_token' on the servers. However, replication is failing. Which of the following is the most likely cause?

A.The secondary datacenter does not have 'verify_outgoing' enabled for TLS.
B.The 'encrypt' key is different between the primary and secondary datacenters.
C.The 'acl_replication_token' is set on the client agents instead of the servers.
D.The 'acl_replication_token' does not have 'acl:read' permissions on the primary datacenter.
AnswerD

For ACL replication to work, the replication token must have 'acl:read' permissions on the primary datacenter. Without this, the secondary servers cannot read the ACL policies, tokens, and intentions from the primary, causing replication to fail. This is a common misconfiguration.

Why this answer

ACL replication requires a token with 'acl:read' permissions on the primary datacenter. Without it, the secondary servers cannot fetch ACL data, leading to replication failure. Other issues like encryption key mismatch would prevent WAN communication entirely, but the scenario indicates that the token and primary datacenter are configured, pointing to a permissions problem.

Exam trap

The trap here is focusing on encryption or TLS settings when the most direct cause of replication failure, given the configuration, is insufficient permissions on the replication token.

38
MCQeasy

Which status indicates that a health check is successfully passing according to Consul?

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

Consul's health check states are passing, warning, and critical. A passing status means the check's defined script, HTTP, or TCP probe returned success within its interval, confirming the service instance is healthy and should remain in the load-balancing rotation.

Why this answer

In Consul, a health check status of 'passing' means the check is succeeding — the service is healthy according to that check. This is the positive status that indicates the check's success condition is met, whether it's an HTTP 200, a script exit code 0, or a TTL being renewed.

Exam trap

Consul 1.15 often tests the four health check statuses and their meanings, with candidates confusing 'warning' (degraded but not failing) with 'critical' (failing) or 'unknown' (not yet reported).

How to eliminate wrong answers

Option B is wrong because 'unknown' indicates the check has not yet reported a status, often because the service or check was just registered or the agent cannot determine the state. Option C is wrong because 'critical' means the check is failing, indicating the service is unhealthy and should be removed from load balancing. Option D is wrong because 'warning' indicates the check is in a degraded state — it is not fully passing but not critical either, often used for non-fatal issues.

39
MCQmedium

A developer uses the Consul KV store to coordinate a rolling deployment. They write a key `deploy/status` with the value `in-progress` using `consul kv put deploy/status in-progress`. Later, they want to check the current value of that key without any blocking or long-polling behavior. Which command should they run?

A.consul kv put deploy/status
B.consul kv get deploy/status
C.consul kv export deploy/status
D.consul watch -type=key -key=deploy/status
AnswerB

The `consul kv get` subcommand retrieves the value of a single key from the Consul KV store. It returns the value, and optionally metadata such as flags and CreateIndex/ModifyIndex when using `-detailed`. This directly answers the developer's need to read the current value of `deploy/status` without blocking or watch behavior, making it the correct choice.

Why this answer

The correct command is the one that performs a simple read of a single key. `consul kv get` retrieves the value and optional metadata for the specified key, matching the developer's requirement to check the current value without blocking. The other commands either write, watch, or export data, none of which satisfy a straightforward read.

Exam trap

The trap here is confusing a read operation with a watch or export, which may also display the key but do not provide a simple one-shot value retrieval.

40
MCQmedium

A Consul operator defines a service check with the following HCL block: check { id = "web-api" name = "Web API HTTP" http = "http://localhost:8080/health" interval = "10s" timeout = "1s" }. The endpoint consistently responds in 1.4 seconds but returns HTTP 200. What status will Consul report for this check?

A.maintenance, because the check is temporarily unavailable
B.warning, because the response was slower than the check interval
C.passing, because the endpoint returned HTTP 200
D.critical, because the check exceeded its configured one-second timeout
AnswerD

Consul treats a check whose HTTP request does not complete within the timeout field as a failure and sets the status to critical. The endpoint answering slowly with HTTP 200 does not override the timeout; the request is abandoned and the check goes critical until a subsequent probe completes inside the timeout window.

Why this answer

The HTTP check fails when the request cannot complete within the configured timeout, even if the endpoint eventually returns a success code. Because the probe takes 1.4 seconds against a one-second timeout, Consul abandons the request and marks the check critical. The interval governs probe frequency, not latency evaluation, and HTTP 200 alone cannot keep the check passing when the timeout is breached.

Exam trap

The trap here is assuming that an HTTP 200 response always yields a passing check, ignoring the separate timeout that governs how long Consul waits for that response.

41
MCQhard

A Consul cluster has three server nodes and multiple client agents. A service 'db' is registered on two nodes, each with a health check that includes 'DeregisterCriticalServiceAfter' set to '1h'. One of the nodes experiences a network partition and becomes unreachable. After 2 hours, the node rejoins the cluster. What happens to the service instance on that node?

A.The service instance is deregistered after 1 hour of the check being critical, even if the node is still unreachable.
B.The service instance is only deregistered if the node is permanently removed from the cluster.
C.The service instance remains registered indefinitely because the node is part of the Consul cluster.
D.The service instance is immediately deregistered when the node becomes unreachable.
AnswerA

The 'DeregisterCriticalServiceAfter' field on the health check causes Consul to deregister the service instance if the check remains critical for the specified duration. Once the node becomes unreachable, the check will eventually be marked critical (after the check interval and timeout). After 1 hour of critical status, Consul will deregister the service instance, regardless of whether the node has rejoined. When the node rejoins, it will re-register the service if it is still configured to do so.

Why this answer

When a node becomes unreachable, the health check for the service will eventually be marked critical. With 'DeregisterCriticalServiceAfter' set to 1h, Consul will deregister the service instance after it has been critical for that duration. This happens even if the node is still partitioned.

When the node rejoins, if the service is still running and registered with the local Consul agent, it may be re-registered. The other options are incorrect because they misstate the timing or conditions for deregistration.

Exam trap

The trap here is thinking that a node rejoining the cluster prevents deregistration, when the timer is based solely on the check's critical duration.

42
MCQeasy

What is the function of the 'consul intention check' command?

A.To list all intentions.
B.To verify if traffic is allowed between two services.
C.To create a new intention.
D.To delete an intention.
AnswerB

The `consul intention check` command evaluates the intention rules governing a connection between a specified source and destination service, returning whether that traffic is permitted or denied. It directly satisfies the stem's requirement to verify authorisation between two services, without modifying any configuration.

Why this answer

The 'consul intention check' command verifies whether traffic is allowed between two services based on the current intentions. It takes a source and destination service and returns whether the connection is allowed or denied, along with the matching intention. This is useful for troubleshooting connectivity issues in the mesh.

Exam trap

Consul 1.15 often tests the difference between 'consul intention check' and other intention subcommands; candidates may confuse it with 'list' or 'create' due to similar naming.

How to eliminate wrong answers

Option A is wrong because listing all intentions is done with 'consul intention list', not 'check'. Option C is wrong because creating a new intention is done with 'consul intention create', not 'check'. Option D is wrong because deleting an intention is done with 'consul intention delete', not 'check'.

43
MCQmedium

A platform team runs Consul 1.15 with Connect enabled. Their service 'api' is registered with a sidecar proxy, and its upstream 'database' is also mesh-enabled. The team wants 'api' to resolve 'database' through the mesh without hard-coding an IP address in the application. Which configuration in the service registration enables the sidecar to expose a stable local listener for the upstream?

A.Define a 'connect' block in the 'database' service registration with a 'sidecar_service' stanza.
B.Create a service-resolver config entry that maps 'database' to a fixed IP address.
C.Add an 'upstreams' block inside api's 'connect.sidecar_service' stanza with a 'destination_name' of 'database'.
D.Register 'database' with a 'tagged_addresses' entry containing a LAN address.
AnswerC

Upstreams are declared on the consuming service's sidecar proxy. Specifying destination_name (and optionally a local_bind_port) instructs the sidecar to open a local listener that forwards to the database through the mesh, so the application uses a stable local address rather than a hard-coded IP.

Why this answer

For a mesh-enabled consumer, upstreams are declared on the consuming service's sidecar proxy. The upstream block names the destination service and optionally sets a local bind port, causing the sidecar to listen locally and forward to the destination over the mesh. This gives the application a stable local address and avoids hard-coded IPs.

Exam trap

The trap here is assuming that the destination service's registration creates the client-side listener, when upstreams must be declared on the consuming service's sidecar.

44
Multi-Selecteasy

Which THREE of the following are valid check types in Consul?

Select 3 answers
A.TCP
B.HTTP
C.SSH
D.Script
E.FTP
AnswersA, B, D

A TCP check opens a socket to the registered address and port, succeeding only if the connection completes. This satisfies the stem by being a genuine Consul check type, distinct from script-based checks that execute local commands and report status via exit codes.

Why this answer

Consul supports HTTP, TCP, and Script (external) health checks.

45
MCQhard

A platform team runs a gRPC service and wants Consul to use the standard gRPC health checking protocol rather than a custom script. The service listens on port 50051 and exposes the standard health service. Which check definition should they use?

A.check { name = "grpc-api" tcp = "127.0.0.1:50051" interval = "10s" }
B.check { name = "grpc-api" http = "127.0.0.1:50051" interval = "10s" }
C.check { name = "grpc-api" h2ping = "127.0.0.1:50051" interval = "10s" }
D.check { name = "grpc-api" grpc = "127.0.0.1:50051" interval = "10s" }
AnswerD

The grpc check type implements the standard gRPC health checking protocol against the given address. The agent calls the health service and treats a SERVING response as passing. This avoids writing custom probe logic and matches the requirement to use the protocol the service already exposes on port 50051.

Why this answer

Consul's grpc check type natively implements the standard gRPC health checking protocol, calling the health service and interpreting SERVING as passing. The http check cannot speak the gRPC wire format, h2ping only validates HTTP/2 connectivity without consulting the health service, and tcp merely opens a socket. Only the grpc check actually queries the service's reported health status.

Exam trap

The trap here is confusing h2ping, which only proves HTTP/2 connectivity, with the grpc check, which actually calls the standard health service and reads its status.

46
MCQhard

A security team requires that a service 'reporting' only accept connections from services presenting a valid mesh certificate issued by the Connect CA, and that all other traffic be rejected. They have registered reporting with a sidecar proxy. Which combination ensures this behavior?

A.Set 'protocol' to 'tcp' in a service-defaults entry and create a deny intention for all other services.
B.Rely on the default deny behavior of intentions and create allow intentions only for the intended callers.
C.Create a wildcard allow intention for all sources, then use ACLs to restrict which services can obtain a certificate.
D.Disable TLS verification on the sidecar by setting verify_outgoing to false.
AnswerB

Connect uses a default-deny posture for inbound mesh traffic, so a service with a sidecar rejects any connection that is not explicitly authorized by an intention. Creating allow intentions for the specific callers grants exactly the required access. The sidecar also requires mTLS, so callers without a valid Connect certificate cannot complete the handshake in the first place.

Why this answer

Connect's built-in default-deny behavior means a sidecar rejects any inbound connection without a matching allow intention, and mTLS ensures only holders of valid Connect certificates can attempt the handshake. Explicit allow intentions for the intended callers complete the configuration. Protocol settings, agent TLS flags, and wildcard allows do not provide the required selective access.

Exam trap

The trap here is thinking that a deny rule is needed for every unwanted caller, when Connect already denies by default and only allow intentions are required.

47
MCQmedium

A platform team stores feature-flag values under the prefix `config/features/`. They need to read the single key `config/features/checkout` and receive its value along with metadata such as `CreateIndex` and `ModifyIndex` in the response. Which Consul CLI command accomplishes this?

A.consul kv put config/features/checkout
B.consul kv delete config/features/checkout
C.consul kv export config/features/checkout
D.consul kv get config/features/checkout
AnswerD

The `consul kv get` command retrieves a single key and, by default, returns the value plus metadata fields like CreateIndex, ModifyIndex, LockIndex, Flags, and Session. Because the request targets one exact key path, the response includes that key's metadata without needing any extra flag such as `-detailed`, which is only required for listing operations.

Why this answer

Reading one exact key path with `consul kv get` returns the stored value together with the key's metadata, including CreateIndex and ModifyIndex, which the team needs for change tracking. The other commands either modify or delete the key or export a prefix in a different JSON format, so they cannot deliver a single-key read with its index fields.

Exam trap

The trap here is assuming that metadata such as CreateIndex only appears when listing keys with a recursive flag, when in fact a direct single-key read already includes it.

48
MCQmedium

You are using a Consul KV entry to store a feature flag. You want the flag to be automatically deleted if the node that owns it becomes unhealthy. Which Consul API operation should you use?

A.Call PUT /v1/kv/feature/flag?cas=0 with the flag value, then configure a watch to delete the key when the node fails.
B.Call PUT /v1/kv/feature/flag?flags=1 with the flag value, then rely on Consul's garbage collector to remove it when the node fails.
C.Create a session with the node's checks, then call PUT /v1/kv/feature/flag?acquire=<session> with the flag value.
D.Call PUT /v1/kv/feature/flag?release=<session> with the flag value, then create a session for the node.
AnswerC

Acquiring a KV key with a session creates a lock. If the session is invalidated—for example, because the node's health check fails—Consul automatically releases the lock and deletes the key. This directly ties the flag's lifetime to the node's health, matching the requirement.

Why this answer

Acquiring a KV entry with a session establishes a lock. When the session's health checks fail, Consul invalidates the session and releases the lock, deleting the key. This is the intended mechanism for tying a KV entry's lifetime to node health.

The other operations either set metadata, perform conditional writes, or attempt to release a lock that was never acquired.

Exam trap

The trap here is confusing the flags or cas query parameters with session-based locking, which is the only way to make a KV entry automatically delete when a node becomes unhealthy.

49
MCQeasy

A service 'inventory' is registered in Consul 1.15 with Connect enabled. You need to verify that the sidecar proxy for 'inventory' is running and healthy. Which command should you use?

A.consul health service inventory-sidecar-proxy
B.consul connect proxy -sidecar-for inventory
C.consul services status inventory
D.consul intention check inventory
AnswerA

The sidecar proxy for a service named 'inventory' is registered as 'inventory-sidecar-proxy'. The 'consul health service' command queries the health of a specific service, returning checks and node information. This directly verifies that the sidecar proxy is running and healthy, which is the required task.

Why this answer

Consul registers a sidecar proxy for each Connect-enabled service with a naming convention of '<service>-sidecar-proxy'. The 'consul health service' command retrieves the health checks and status for that proxy, confirming it is running and passing checks. This is the standard way to verify sidecar health in Consul.

Exam trap

The trap here is using the service name without the '-sidecar-proxy' suffix, which would check the application service rather than its sidecar proxy.

50
MCQeasy

How do you enable WAN federation between two Consul datacenters that do not share a network?

A.By disabling ACLs.
B.By increasing the gossip interval.
C.By using a load balancer in front of the servers.
D.By deploying Mesh Gateways.
AnswerD

Mesh gateways route server-to-server RPC traffic between datacenters over the WAN, so datacenters without direct network connectivity can still federate. Each gateway proxies traffic on behalf of its local servers, satisfying the stem's no-shared-network constraint without requiring VPN tunnels or routed peering.

Why this answer

Mesh Gateways are the correct solution for enabling WAN federation between datacenters that do not share a network, such as when they are behind NAT or firewalls with no direct WAN gossip connectivity. Mesh gateways relay WAN gossip and service traffic over the LAN, allowing federation without direct server-to-server WAN links. This is the standard Consul pattern for isolated datacenters.

Exam trap

The trap is thinking that network-level fixes like load balancers or ACL changes can solve isolation — candidates often pick load balancer because it sounds like a connectivity solution, but only mesh gateways are designed to relay WAN gossip when no direct path exists.

How to eliminate wrong answers

Option A is wrong because disabling ACLs does not address network connectivity — ACLs control authorization, not whether packets can flow between datacenters. Option B is wrong because increasing the gossip interval only changes timing, not reachability; it cannot overcome a lack of network path. Option C is wrong because a load balancer in front of servers can distribute traffic but does not solve the problem of no direct network path between datacenters for WAN gossip — mesh gateways are specifically designed to relay that traffic.

51
MCQeasy

Which HTTP method is used to create or update a key in the Consul KV store?

A.GET
B.PUT
C.DELETE
D.POST
AnswerB

Consul's KV store uses PUT to create or update a key, since the operation is idempotent and supplies the value in the request body. POST is not used for KV writes, satisfying the stem's create-or-update requirement.

Why this answer

The Consul KV store uses the PUT HTTP method to create or update a key. A PUT to /v1/kv/<key> with the value in the request body either creates the key if it does not exist or overwrites it if it does, making PUT the idempotent write operation for KV entries.

Exam trap

The trap is assuming POST is the generic 'create' verb for REST APIs; Consul specifically uses PUT for KV writes, and candidates who default to POST without checking the API reference will miss this.

How to eliminate wrong answers

Option A is wrong because GET is a read-only method used to retrieve the value of an existing key, not to create or modify it. Option C is wrong because DELETE removes a key or recursively removes a key prefix, which is the opposite of creating or updating. Option D is wrong because POST is not the documented method for writing KV values in Consul; while POST is used for other Consul API operations like registering services, KV writes specifically use PUT.

52
MCQmedium

You need to verify if a node has successfully joined the cluster for service discovery. Which tool confirms this?

A.consul members
B.consul catalog nodes
C.consul info
D.consul services
AnswerA

The consul members command queries the gossip protocol on the local agent and returns every node the cluster currently recognises, along with its status and role. A node appearing in this output confirms it has successfully joined and is participating in service discovery.

Why this answer

The `consul members` command queries the gossip protocol (LAN/WAN) and lists all nodes that are currently part of the Consul cluster, showing their status (alive, left, failed) and role. This directly confirms whether a node has successfully joined the cluster, as it relies on the Serf gossip layer that manages cluster membership. Other commands like `consul catalog nodes` query the catalog, which may not reflect real-time membership status if the node is unreachable or has not synced.

Exam trap

Consul 1.15 often tests the distinction between gossip membership (real-time) and catalog data (eventually consistent), so candidates may incorrectly choose `consul catalog nodes` thinking it shows live cluster members.

How to eliminate wrong answers

Option B is wrong because `consul catalog nodes` returns nodes registered in the Consul catalog, which is populated by the anti-entropy sync and may include nodes that are not currently active or have failed, so it does not confirm live membership. Option C is wrong because `consul info` provides runtime metrics and configuration details about the local agent, not a list of cluster members. Option D is wrong because `consul services` lists services registered in the catalog, not nodes, and does not indicate whether a specific node has joined the cluster.

53
MCQhard

You are implementing a distributed semaphore using Consul KV and sessions. You create a session with a TTL of 60 seconds and use the 'acquire' parameter to lock a key. After acquiring the lock, the application holding the session experiences a 90-second pause due to a garbage collection stop-the-world event. The Consul agent on the node is healthy and continues to renew the session. What happens to the lock?

A.The lock is released because the session TTL expires after 60 seconds without renewal from the application.
B.The lock is released immediately when the garbage collection pause begins because Consul detects the application is unresponsive.
C.The lock remains held because the Consul agent renews the session, and the application's pause does not affect the session.
D.The lock is released after 90 seconds when the application resumes and fails to renew the session in time.
AnswerC

The session is kept alive by the Consul agent's renewals. The application's pause does not impact the session because the agent operates independently. The lock remains held until the session is explicitly destroyed or the agent fails to renew. This is a common pitfall in distributed locking with Consul: the lock can outlive the application process.

Why this answer

Session TTL renewal is handled by the Consul agent, not the application. Even if the application is paused, the agent continues to renew the session, keeping the lock held. This can lead to a situation where a lock is held by a session whose application is not actively using it.

To avoid this, applications should explicitly release locks or use health checks that reflect application liveness.

Exam trap

The trap here is assuming that the application is responsible for renewing the session TTL, when in fact the Consul agent performs this task independently.

54
Multi-Selecthard

Which THREE of the following are valid ways to register a service in Consul?

Select 3 answers
A.Kubernetes Custom Resource Definitions.
B.Configuration files in the agent's config directory.
C.HTTP API 'v1/agent/service/register'.
D.Directly modifying the Consul database file.
E.Manual editing of the Raft log.
AnswersA, B, C

The Consul Kubernetes controller watches Kubernetes Custom Resource Definitions such as ServiceDefaults and ServiceResolver, syncing them into Consul's catalog. This makes CRDs a supported registration path in Kubernetes environments, alongside agent config and the HTTP API.

Why this answer

Option A is correct because Consul supports Kubernetes Custom Resource Definitions (CRDs) such as ServiceRegistration (and previously ServiceDefaults/ServiceResolver via CRDs) as a declarative way to register services when running Consul on Kubernetes with the official Helm chart and CRDs enabled. Option B is correct because services can be defined in agent configuration files (HCL or JSON) placed in the agent's config directory, using a service block or services array, and Consul loads them at agent startup or reload. Option C is correct because the Consul HTTP API exposes the endpoint PUT /v1/agent/service/register, which accepts a JSON service definition and registers the service with the local agent.

Option D is not valid because Consul stores state in a Raft-replicated log and snapshot files, not in a directly editable database file; modifying internals would corrupt state and is unsupported. Option E is not valid because the Raft log is an internal replicated log managed by the Raft consensus protocol, and manually editing it would break consistency and is not a supported registration method.

Exam trap

The trap is including plausible-sounding but unsupported methods like editing the database or Raft log; candidates must recognize that Consul only accepts registration through agents, the HTTP API, or Kubernetes CRDs — never direct datastore manipulation.

55
MCQhard

When configuring a Service-specific health check, what is the impact of setting the 'expose' field to true?

A.The service is automatically registered with a Load Balancer
B.The check is bypassed
C.The check status is exposed on the HTTP interface
D.The agent automatically upgrades the check to HTTP
AnswerC

Setting expose to true publishes the service-specific check's status through Consul's HTTP health endpoint, allowing external tooling to query it. Without it, the check runs but its result stays internal to the agent, so only the API interface reveals the state.

Why this answer

Setting 'expose' to true allows the service to expose its health checks via the local agent's HTTP interface, enabling external access to the health check status.

56
MCQmedium

What is the role of a Consul server in a non-primary datacenter regarding ACLs?

A.They ignore all ACLs.
B.They can write new ACL policies independently.
C.They become the primary if the original primary fails.
D.They replicate the ACL state from the primary.
AnswerD

Non-primary datacenters do not originate ACL tokens or policies; they forward token writes to the primary and asynchronously replicate the resulting ACL state. This replication ensures consistent authorisation decisions locally, satisfying the requirement that servers in secondary datacenters enforce the same ACLs without holding the authoritative token store.

Why this answer

In a multi-datacenter Consul deployment, ACL state is authoritative only in the primary datacenter. Non-primary datacenters, including their servers, do not accept ACL writes; instead, they replicate the ACL state (tokens, policies, roles, and bindings) from the primary datacenter. This ensures a single source of truth for ACLs and prevents conflicting policies across datacenters.

The replication is one-way, from primary to secondary, and is performed by the Consul servers in the secondary datacenter.

Exam trap

The trap here is confusing the role of non-primary servers with that of the primary, leading candidates to incorrectly assume they can write ACLs or that they automatically take over as primary; Consul 1.15 often tests the one-way replication model and the manual nature of primary datacenter failover.

How to eliminate wrong answers

Option A is wrong because non-primary servers do not ignore ACLs; they enforce ACLs locally using the replicated state, and if ACLs are enabled, they require tokens for operations. Option B is wrong because only the primary datacenter can accept ACL writes; non-primary servers cannot independently create or modify ACL policies, as this would break the single authoritative source. Option C is wrong because Consul does not automatically promote a non-primary datacenter to primary upon failure of the original primary; failover of the primary datacenter is a manual process, and non-primary servers do not become primary automatically.

57
MCQmedium

What is the recommended approach for running health checks on a service that is part of a non-containerized, multi-process architecture?

A.Only check the parent process
B.Run one check per service definition
C.Use only TCP checks
D.Use a single script check that kills the service
AnswerB

In a non-containerised, multi-process architecture, each process runs independently, so Consul cannot infer health from a single aggregate check. Defining one check per service ensures each process is monitored separately, satisfying the requirement to detect individual process failures.

Why this answer

For a non-containerized, multi-process service, Consul's recommended approach is to define one health check per service definition so each process or component can be independently verified. This gives accurate per-process health visibility and avoids the false 'passing' state that a single coarse check can produce when one subprocess dies while another stays up.

Exam trap

The trap is thinking one check can cover a multi-process service — Consul expects per-process checks so a dead worker isn't hidden behind a healthy parent.

How to eliminate wrong answers

Option A is wrong because checking only the parent process can report healthy even when critical child workers have crashed, masking partial failures from service discovery. Option C is wrong because TCP checks only confirm that a port is open — they cannot verify application-level health, so a hung or degraded process still passes. Option D is wrong because a check script that kills the service is destructive and defeats the purpose of health monitoring; checks should observe, not terminate, the service.

58
MCQhard

A Consul 1.15 operator registers a service with an alias health check that points to another service's check. The aliased check is currently in a warning state. What status will the alias check report?

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

The alias check directly inherits the status of the aliased check. Since the aliased check is in a warning state, the alias check will also report warning. This allows services to depend on the health of other services without duplicating check logic. The alias check does not modify the status in any way.

Why this answer

An alias health check in Consul mirrors the status of another check. When the aliased check is in a warning state, the alias check will also report warning. This allows services to depend on the health of other services without reimplementing the same check logic.

The alias check does not alter the status; it simply reflects it.

Exam trap

The trap here is assuming that an alias check might escalate a warning to critical or that it has its own logic, but it strictly mirrors the aliased check's status.

59
MCQhard

If a service has multiple health checks associated with it, when is the service itself considered 'critical'?

A.When any check is critical
B.When a majority of checks are critical
C.When all checks are critical
D.Only if the primary check is critical
AnswerA

Consul aggregates all health checks attached to a service; if any single check reports critical, the service's overall status becomes critical. This aggregation means one failing check is sufficient to mark the whole service unhealthy, regardless of the other checks passing.

Why this answer

In Consul, a service is considered 'critical' if any of its associated health checks are in a critical state. This is because the service's overall health is an aggregation where the worst status among all checks determines the service status. Therefore, a single critical check makes the entire service critical.

Exam trap

The trap is thinking that all checks must fail for the service to be critical, but Consul uses the worst-case status, so any single critical check suffices.

How to eliminate wrong answers

Option B is wrong because Consul does not use a majority rule; it uses the most severe status. Option C is wrong because the service becomes critical as soon as one check fails, not only when all fail. Option D is wrong because there is no concept of a 'primary' check; all checks contribute equally to the service's health status.

60
MCQmedium

You are operating a Consul 1.15 cluster with Connect enabled. A service named 'api' is registered with a sidecar proxy. You need to ensure that only the 'web' service can initiate connections to 'api'. You have created an intention that allows 'web' to connect to 'api', but you have not created any other intentions. What is the default behavior for other services trying to connect to 'api'?

A.They are allowed because the default intention behavior is 'allow'.
B.They are allowed only if they have a valid mesh certificate.
C.They are denied only if the 'api' service has a specific intention denying them.
D.They are denied because the default intention behavior is 'deny'.
AnswerD

Consul Connect uses a default-deny model for intentions. When no intention explicitly allows a connection, it is denied. In this scenario, only 'web' is allowed to connect to 'api', so all other services are denied by default. This ensures a secure zero-trust network. The default behavior applies unless overridden by a higher-priority intention or a wildcard allow.

Why this answer

In Consul Connect, intentions are deny by default. When you create an intention allowing 'web' to connect to 'api', that is the only allowed path. All other services are denied because there is no intention permitting them.

This default-deny model is fundamental to Consul's security posture, ensuring that only explicitly authorized services can communicate, which reduces the attack surface.

Exam trap

The trap here is assuming that because one intention allows a connection, other connections are also allowed unless explicitly denied, when in fact the default is deny.

61
MCQeasy

What does the 'kind' field in a service definition specify for a Consul Connect service?

A.The proxy type (e.g., 'connect-proxy').
B.The service version.
C.The datacenter location.
D.The language of the application.
AnswerA

The `kind` field declares the service registration type, with `connect-proxy` marking a sidecar proxy instance rather than a standard service. This satisfies Consul's requirement to distinguish proxy registrations from application services, enabling Connect to route traffic through the correct proxy for mTLS enforcement.

Why this answer

In a Consul Connect service definition, the `kind` field declares the type of service registration — most commonly `connect-proxy` for a sidecar proxy, but also `connect-native`, `terminating-gateway`, `ingress-gateway`, and `mesh-gateway`. It tells Consul how to treat the service in the service mesh, not what version or language it is. This is required for proxies and gateways so Consul can wire them into the mesh correctly.

Exam trap

The trap is assuming `kind` describes metadata like version or environment; it actually declares the service's mesh role, and confusing it with tags or meta causes wrong answers.

How to eliminate wrong answers

Option B is wrong because service version is expressed via `meta` or tags, not `kind`. Option C is wrong because datacenter placement is determined by the agent's `datacenter` configuration, not a service-level field. Option D is wrong because the application language is irrelevant to Consul's service model — Consul is language-agnostic and only cares about the service's role in the mesh.

62
Multi-Selecthard

Which TWO of the following are features of Consul Connect native integration?

Select 2 answers
A.The app handles its own mTLS handshake.
B.The app uses the Consul agent API to obtain certificates.
C.The app must be written in Go.
D.The sidecar proxy is still required for routing.
E.It supports only non-secure traffic.
AnswersA, B

Consul Connect native integration embeds the mTLS handshake directly into the application, which manages its own certificates and identity rather than delegating to a sidecar proxy. This app-managed handshake is the defining feature distinguishing native integration from proxy-based service mesh.

Why this answer

Consul Connect native integration means the application itself participates directly in the service mesh rather than relying on a sidecar proxy, so option A is correct: the app performs its own mTLS handshake to establish mutually authenticated, encrypted connections with other services. Option B is also correct because a natively integrated app uses the Consul agent's local HTTP API (e.g., the /v1/agent/connect/ca/leaf/ endpoint) to obtain its leaf certificate and CA roots for that mTLS handshake. Option C is wrong because native integration is language-agnostic — Consul provides client libraries for multiple languages and the API can be called from any runtime, not just Go.

Option D is wrong because the whole point of native integration is that no sidecar proxy is required for routing or encryption. Option E is wrong because native integration specifically enables secure mTLS traffic, not merely non-secure traffic.

Exam trap

The trap here is confusing native integration with sidecar proxy integration: candidates might think a sidecar is always required or that native integration is language-specific, but the key is that the app itself handles mTLS and uses the Consul API for certificates.

63
Multi-Selectmedium

Which THREE of the following fields are returned in a typical Consul KV API GET response?

Select 3 answers
A.ModifyIndex
B.Key
C.Value
D.SessionTTL
E.CreateTime
AnswersA, B, C

ModifyIndex is the raft index of the last modification to that key, returned alongside CreateIndex, LockIndex, Key, Flags and Value. It satisfies the stem's requirement by being a field the Consul KV API genuinely includes in its GET response.

Why this answer

A Consul KV API GET response (e.g., GET /v1/kv/<key>) returns a JSON array of entries containing the fields Key, Value, Flags, CreateIndex, ModifyIndex, LockIndex, and Session. Option A (ModifyIndex) is correct because it is the index at which the key was last modified and is included in every KV read response. Option B (Key) is correct because the full key path is returned so the client knows which key the entry corresponds to.

Option C (Value) is correct because the base64-encoded value stored at the key is returned (null if the key has no value). Option D (SessionTTL) is not part of the KV response; TTL is a property of sessions (returned by the session API, e.g., /v1/session/info), not of KV entries. Option E (CreateTime) is not a Consul KV field; Consul uses CreateIndex (a Raft index) rather than a timestamp to record when the key was created.

Exam trap

Consul 1.15 often tests whether candidates confuse raft index fields (CreateIndex, ModifyIndex) with timestamp fields (CreateTime), and whether they mistakenly attribute session properties like SessionTTL to KV entries.

64
MCQmedium

A team wants to store structured configuration for several microservices in Consul's KV store and retrieve an entire service's configuration with a single CLI call. They plan to keep all keys for `payments` under `services/payments/`. Which command retrieves every key under that prefix in one invocation?

A.consul kv get services/payments/
B.consul kv get -recurse services/payments/
C.consul kv put -recurse services/payments/
D.consul kv export services/payments/
AnswerB

The `-recurse` flag makes `consul kv get` walk every key beneath the given prefix and return them all in one response. This lets the team fetch the entire `payments` configuration set with a single call, which is exactly the prefix-retrieval behavior they need for loading structured config at startup.

Why this answer

Listing all keys under a prefix requires the recursive read behavior. Passing `-recurse` to `consul kv get` returns every key beneath the specified path in a single call, which is precisely how a service loads its whole configuration subtree. A trailing slash alone does nothing, and the other commands either write data or produce a backup-oriented export format.

Exam trap

The trap here is believing that appending a trailing slash to a key path automatically enumerates the subtree, when Consul instead requires the explicit `-recurse` flag.

65
MCQhard

An engineer registers an external service for a third-party payment gateway that cannot run a Consul agent. The registration uses an alias health check that points at a Consul node named 'edge-proxy-01' and a service named 'payment-gateway'. The external service stays healthy in the catalog as long as the proxy node and service are passing. A second engineer later adds a separate script check directly to the same external service definition. After a deployment, the payment gateway disappears from DNS even though the edge proxy node and its payment-gateway service both report passing. What is the most likely cause?

A.Alias checks cannot coexist with other checks on the same service, so Consul silently discards the alias result when a second check is added.
B.The external service node name collides with the alias target node, causing Consul to overwrite the alias check status with the external node's own health.
C.The added script check is failing on the node running the catalog registration, and any failing check on a service marks the whole service critical.
D.The alias check requires the target service to be registered on the same agent, so it failed once the deployment moved the proxy to another datacenter.
AnswerC

A service's aggregate health is the worst state among all its checks, so adding a script check that fails on the registering node drags the service to critical even though the alias check still passes. Because DNS only returns healthy instances by default, the gateway drops out of resolution. Removing or fixing the failing script check restores the service to passing.

Why this answer

Service health in Consul is the aggregate of every check attached to that service, and the worst state wins. Adding a script check that fails on the registering node therefore pushes the external payment gateway to critical even though the alias check still reflects a passing edge proxy. Since DNS queries filter to passing instances by default, the service vanishes from resolution until the failing check is corrected.

Exam trap

The trap here is focusing on the alias target's health and overlooking that a single failing check on the service overrides all passing checks.

66
Multi-Selecthard

Which THREE factors influence the mTLS handshake in a Consul Connect mesh?

Select 3 answers
A.The identity certificate issued to the service.
B.The CA root certificate.
C.The trust bundle.
D.The intention status.
E.The service health check result.
AnswersA, B, C

The identity certificate, issued by Consul's CA to the service, supplies the client or server leaf credential presented during the TLS exchange. Its embedded SPIFFE URI determines the peer identity verified against intentions, directly shaping the mTLS handshake outcome.

Why this answer

In Consul Connect, the mTLS handshake is driven by the cryptographic material each side presents and validates: option A, the identity certificate issued to the service, is the leaf certificate (with SPIFFE-style URI SAN) that the sidecar proxy presents to prove its service identity, so it directly determines the handshake. Option B, the CA root certificate, is the anchor both proxies use to verify the peer's leaf certificate chain, making it essential to the handshake's trust decision. Option C, the trust bundle, is the set of CA certificates (including roots and any intermediates) that Consul distributes to proxies so they can validate certificates during the handshake, especially across CA rotations.

Option D, the intention status, is enforced by the sidecar proxy as an authorization decision after/around connection establishment and does not alter the TLS handshake cryptography. Option E, the service health check result, affects service discovery and routing but is not part of the mTLS handshake itself.

Exam trap

The trap is confusing authentication (mTLS handshake) with authorization (intentions); candidates may think intentions affect the handshake, but they are evaluated after the TLS connection is established.

67
MCQhard

An operator wants to atomically create a key `locks/leader` only if it does not already exist, so that two competing processes cannot both become leader. Which Consul KV operation should be used?

A.A `consul kv put` using the `-cas` flag set to 0
B.A normal `consul kv put` with no extra flags
C.A `consul kv get` followed by a `consul kv put`
D.A `consul kv put` with the `-flags` option set to a unique value
AnswerA

The `-cas` flag performs a check-and-set operation: the write succeeds only if the key's current ModifyIndex matches the supplied value. Passing 0 asserts that the key does not yet exist, so the first process to write wins and the second receives a failure. This gives the atomic create-if-absent behavior needed to elect a single leader without a race.

Why this answer

Atomic create-if-absent is achieved with the check-and-set mechanism. Supplying `-cas 0` tells Consul to perform the write only when the key's ModifyIndex is zero, meaning the key is absent. The first writer succeeds; any later writer sees a non-zero index and is rejected, ensuring a single leader without a race condition.

Exam trap

The trap here is treating a read-then-write sequence as safe, when only the `-cas` check-and-set flag provides the atomic guarantee Consul actually enforces.

68
MCQeasy

A developer needs to see which intentions currently govern traffic between services in a Consul 1.15 datacenter. Which command lists all intentions stored in the catalog?

A.consul connect intentions
B.consul intention check
C.consul intention list
D.consul catalog services -intentions
AnswerC

The consul intention list command queries the intention endpoint and prints every intention in the current datacenter, including source, destination, action, and precedence metadata. It is the direct, read-only way to audit mesh authorization rules. Operators use it to confirm that expected allow or deny rules exist before troubleshooting connectivity.

Why this answer

Intentions are managed through the consul intention command family, and the list subcommand returns all stored rules for the datacenter. Commands that inspect the catalog or test a single source-destination pair do not enumerate the full set of authorization rules. For a complete audit, listing intentions is the correct operation.

Exam trap

The trap here is confusing the intention check command, which evaluates one source-destination pair, with the intention list command that enumerates every stored rule.

69
Multi-Selecthard

Which THREE network considerations are vital for Consul WAN federation?

Select 3 answers
A.Sufficient bandwidth for gossip heartbeat messages.
B.A shared NAT gateway for all datacenters.
C.Uniform MTU settings across all regions.
D.TCP and UDP traffic on the WAN gossip port (8302).
E.Connectivity between server nodes across datacenters.
AnswersA, D, E

WAN federation relies on the gossip protocol, which exchanges lightweight heartbeat messages between servers in each datacentre. Sufficient bandwidth ensures these periodic probes and suspicion messages propagate reliably across the WAN, preventing false failure detection and maintaining a healthy federated membership.

Why this answer

Option A is correct because Consul WAN federation relies on the gossip protocol (Serf) to exchange heartbeat messages between datacenter servers, and insufficient bandwidth can cause missed heartbeats, false failures, and instability in the federated cluster. Option D is correct because WAN gossip uses port 8302 over both TCP and UDP, so firewall rules must permit both protocols on that port for servers in different datacenters to communicate. Option E is correct because WAN federation fundamentally requires that server nodes in each datacenter can reach server nodes in the other datacenters, typically over the WAN gossip port and the server RPC port (8300), to join and maintain the federation.

Option B is not required because each datacenter can use its own independent NAT or network egress; a shared NAT gateway is not a Consul WAN federation requirement. Option C is not required because while consistent MTU can help avoid fragmentation issues, Consul does not mandate uniform MTU settings across regions for WAN federation to function.

Exam trap

Consul 1.15 often tests WAN federation by including plausible but non-required items (shared NAT, uniform MTU) alongside the true requirements (bandwidth, port 8302 TCP/UDP, server connectivity).

70
MCQmedium

You are configuring a Consul Watch to trigger a script whenever a specific KV key changes. Which type of watch should you define in your configuration file?

A.event
B.service
C.key
D.nodes
AnswerC

A key watch monitors a single KV pair path and fires its handler whenever that key's value changes, matching the requirement to trigger a script on one specific key. Other watch types cover prefixes, services, nodes or checks, not individual key modification.

Why this answer

The 'key' watch type in Consul is specifically designed to monitor a single KV pair for changes. When the value of the specified key changes, the watch triggers the configured handler (e.g., a script). This matches the requirement of triggering a script whenever a specific KV key changes.

Other watch types monitor different Consul resources such as events, services, or nodes, and are not suited for tracking a single KV key.

Exam trap

Consul 1.15 often tests the distinction between watch types and their target resources; candidates may confuse 'key' with 'service' or 'event' watches, especially if they overlook that KV watches are specifically for key-value pairs.

How to eliminate wrong answers

Option A is wrong because an 'event' watch monitors Consul's event system (user events or internal events like leader election), not KV changes. Option B is wrong because a 'service' watch monitors the health and instances of a specific service, not KV data. Option D is wrong because a 'nodes' watch monitors the list of nodes in the catalog, not KV pairs.

71
MCQeasy

Which command-line interface command is used to set a value in the Consul KV store?

A.consul kv write
B.consul kv set
C.consul kv update
D.consul kv put
AnswerD

The consul kv put command writes a key-value pair into the Consul KV store, taking the key path and value as arguments. Other kv subcommands such as get, delete or export read or remove entries, so put is the correct write operation.

Why this answer

The correct Consul CLI command to set a value in the KV store is 'consul kv put'. This command writes a value to the specified key path. For example, 'consul kv put mykey myvalue' stores 'myvalue' at the key 'mykey'.

The other commands do not exist in the Consul CLI.

Exam trap

The trap is assuming that the command follows a common pattern like 'set' or 'write' from other key-value stores; candidates must remember that Consul uses 'put' for writing to the KV store, and the other verbs are not valid.

How to eliminate wrong answers

Option A is wrong because 'consul kv write' is not a valid Consul CLI command; the correct verb is 'put'. Option B is wrong because 'consul kv set' is not a valid command; Consul uses 'put' for writing values. Option C is wrong because 'consul kv update' is not a valid command; while there is a 'consul kv put' with a '-cas' flag for check-and-set, the base command is 'put'.

72
MCQeasy

Which of the following is a key feature of Consul Connect's intentions?

A.Global load balancing.
B.Certificate rotation.
C.Traffic splitting.
D.Service authorization (allow/deny).
AnswerD

Intentions enforce service-to-service authorisation by evaluating allow or deny rules against the source and destination service identities in a mutual TLS session. This directly satisfies the stem's requirement for service authorization, since Consul Connect uses intentions as its mechanism for permitting or refusing connections between services.

Why this answer

Consul Connect's intentions define which services are allowed to communicate with which other services. They are essentially authorization policies that allow or deny connections based on service identity. Intentions are a core feature for enforcing zero-trust security in a service mesh.

Exam trap

Consul exams often test the distinction between intentions (authorization) and other Connect features like traffic splitting or certificate management, tricking candidates into selecting features that are not part of intentions.

How to eliminate wrong answers

Option A is wrong because global load balancing is a feature of service discovery and traffic management, not intentions. Option B is wrong because certificate rotation is handled by Consul's built-in CA and is not a feature of intentions. Option C is wrong because traffic splitting is a feature of service resolvers and routers in Consul's traffic management, not intentions.

73
MCQhard

What is the impact of setting 'enable_tag_override' to true in a service definition?

A.It allows tags to be modified via the API without updating the config file.
B.It ignores all tags in the catalog.
C.It forces all nodes to update their tags.
D.It prevents tags from being used in DNS lookups.
AnswerA

Tag override decouples tags from the service definition's configuration file, permitting registration or catalog updates to alter them through the API. Without it, any tag change requires editing and reloading the config, so this setting enables API-driven tag modification.

Why this answer

Setting 'enable_tag_override' to true in a service definition allows tags to be modified via the API without updating the service's configuration file. This is useful for dynamic tag changes, such as adding a tag for maintenance mode. By default, this is false, meaning tags are managed by the config file and API changes are overwritten on restart.

Exam trap

Consul 1.15 often tests the misconception that 'enable_tag_override' affects all nodes or disables tags, when it actually allows per-instance API tag modifications.

How to eliminate wrong answers

Option B is wrong because 'enable_tag_override' does not ignore tags in the catalog; it allows API overrides. Option C is wrong because it does not force all nodes to update their tags; it only permits API modifications. Option D is wrong because it does not prevent tags from being used in DNS lookups; tags are still used for filtering.

74
MCQhard

When using Consul DNS for a service, what happens if no instances are healthy?

A.It returns a 500 error.
B.It redirects to a standby service.
C.It returns an empty response (NXDOMAIN or empty set).
D.It returns all instances regardless of health.
AnswerC

Consul DNS suppresses unhealthy instances from service lookups, so when every instance fails its health check, the query yields no records — NXDOMAIN or an empty answer set — rather than stale addresses. This satisfies the stem's requirement by preventing clients from receiving unreachable endpoints, letting them fail fast instead of timing out.

Why this answer

Consul DNS returns only healthy service instances. If no instances are healthy, the query returns an empty response — typically NXDOMAIN for the service name or an empty answer set — rather than an error or unhealthy instances. This signals to clients that no healthy backend is available.

Exam trap

Consul 1.15 often tests the misconception that Consul DNS returns all instances or an error code, when it actually returns an empty/NXDOMAIN response for no healthy instances.

How to eliminate wrong answers

Option A is wrong because DNS does not return HTTP 500 errors; Consul DNS returns DNS response codes such as NXDOMAIN or NOERROR with no records. Option B is wrong because Consul has no built-in standby service redirection; failover must be implemented by the client or via prepared queries. Option D is wrong because Consul deliberately filters out unhealthy instances; returning all instances regardless of health would defeat the purpose of health-aware discovery.

75
MCQmedium

You are configuring Consul Connect for a service named 'payments'. You want to allow incoming connections only from services that present a valid client certificate from a specific CA and also enforce that the source service is 'checkout'. What combination of Consul features should you use?

A.Configure an intention with source 'checkout' and action 'allow', and enable mutual TLS in the mesh.
B.Enable ACLs with a token that has 'service:write' for 'payments' and distribute it only to 'checkout'.
C.Configure a service resolver with a subset that includes only 'checkout' and set the default subset to that.
D.Use a network segment to isolate 'payments' and a firewall rule to allow only 'checkout'.
AnswerA

Intentions enforce service-to-service authorization based on service identity, and mTLS ensures that only services with valid certificates from the Consul CA can establish connections. This combination restricts incoming traffic to 'checkout' while requiring certificate validation, meeting both requirements.

Why this answer

To restrict incoming connections to a specific source service, Consul intentions are the correct mechanism. They define which services are allowed to connect based on service identity. Enabling mTLS ensures that connections are authenticated with certificates issued by Consul's CA, providing encryption and identity verification.

Together, they enforce that only 'checkout' can connect to 'payments' and that the connection is secure.

Exam trap

The trap here is confusing network-level controls (firewalls, segments) or ACLs with service-level authorization, which in Consul Connect is handled by intentions and mTLS.

Page 1 of 4

Page 2

All pages