Courseiva

HashiCorp Certified: Consul Associate (Consul 1.15) (Consul 1.15) (Consul 1.15) — Questions 226–265

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

Page 3

Page 4 of 4

226
MCQmedium

When using multiple datacenters, what is the primary role of the 'consul-template' tool?

A.To generate configuration files based on Consul data.
B.To provision infrastructure.
C.To replicate KV stores.
D.To manage the Consul cluster nodes.
AnswerA

Consul-template watches the Consul catalog and KV store, then renders templates into local configuration files and reloads dependent services. Across datacenters it queries the relevant Consul servers, so the stem's requirement for generating configuration from Consul data is met directly.

Why this answer

consul-template is a daemon that watches Consul for changes (KV pairs, services, health checks) and renders configuration files from templates, optionally running commands when files change. Its primary role is dynamic configuration generation based on Consul data, commonly used to configure HAProxy, Nginx, or Vault. It does not provision infrastructure or manage the cluster.

Exam trap

Consul 1.15 often tests the confusion between consul-template (config rendering) and Consul's built-in features like KV replication or cluster management — candidates assume consul-template does more than render files.

How to eliminate wrong answers

Option B is wrong because infrastructure provisioning is the job of tools like Terraform or CloudFormation — consul-template only renders config files and can run a reload command. Option C is wrong because KV replication across datacenters is handled by Consul's native replication (via the WAN gossip and Raft replication of the KV store), not by consul-template. Option D is wrong because cluster node management is done via Consul's own CLI/API and server agents — consul-template is a client-side rendering tool.

227
MCQmedium

A service 'orders' must call an upstream database service through its sidecar proxy. The upstream is registered in the same Consul datacenter and the operator wants the sidecar to discover it dynamically rather than hard-code an address. Which upstream configuration entry in the sidecar_service stanza accomplishes this?

A.A local_bind_port and a destination_name, but with destination_type omitted and datacenter set to a remote value.
B.destination_type set to 'static' with a destination_name equal to the upstream's DNS name.
C.destination_name set to the upstream service name, with no destination_type or fixed address.
D.destination_type set to 'prepared_query' with a destination_name matching the upstream service.
AnswerC

When destination_type is left at its default of service, the sidecar resolves the upstream through Consul's service discovery using destination_name. The proxy watches the catalog for healthy instances and load-balances across them, so IP changes and scaling events are handled automatically. Hard-coding an address would defeat the purpose of dynamic discovery.

Why this answer

Dynamic discovery for a sidecar upstream is achieved by naming the target service and letting the default service destination type drive catalog lookups. The proxy then watches Consul for healthy instances and balances across them. Static addressing, remote datacenter scoping, and prepared queries all change that behavior in ways the scenario does not require.

Exam trap

The trap here is assuming an upstream must specify an address or a special type, when the default service destination type already performs dynamic catalog-based discovery.

228
MCQeasy

An operator registers a web service with Consul using the HTTP API. The registration includes a TTL health check with a 30-second interval, but the application code does not yet call the pass endpoint. Shortly after registration, the service disappears from healthy DNS results. What is the most likely reason?

A.The service was deregistered because Consul automatically removes services after 30 seconds without traffic.
B.The TTL check entered the critical state because no pass heartbeat was received before the TTL expired.
C.The DNS interface only returns services registered with a script-based check, so TTL checks are ignored.
D.The service was never added to the catalog because the HTTP API requires a separate catalog registration call.
AnswerB

A TTL check starts in a critical state and only becomes passing when the service calls the /v1/agent/check/pass/<check_id> endpoint, or when the check is registered with a non-critical initial status. If the application never sends the heartbeat within the TTL window, Consul marks the check critical and excludes the instance from healthy DNS answers. This matches the observed behavior exactly.

Why this answer

TTL checks require the service to actively report health by calling the pass endpoint within the configured TTL. Until that heartbeat arrives, Consul considers the check critical and omits the instance from healthy DNS responses. The described behavior is the expected outcome of a TTL check that was registered but never fed, so the fix is to implement the heartbeat or use an active check type.

Exam trap

The trap here is confusing a service being absent from healthy DNS results with the service being deregistered from the catalog, when in fact the instance remains registered but its TTL check is critical.

229
MCQhard

A Consul cluster spans multiple datacenters. A service `user-auth` is registered in both `dc1` and `dc2`. A client in `dc1` queries the DNS interface for `user-auth.service.consul`. By default, which instances will be returned?

A.Only instances from `dc2` if `dc1` has no healthy instances.
B.Only instances from `dc1`.
C.Instances from both `dc1` and `dc2`, load-balanced.
D.Instances from all datacenters, sorted by latency.
AnswerB

By default, Consul DNS queries are scoped to the local datacenter of the agent handling the query. A client in `dc1` querying `user-auth.service.consul` will receive only instances registered in `dc1`. To query other datacenters, the client must explicitly specify the datacenter, such as `user-auth.service.dc2.consul`. This default behavior ensures locality and reduces cross-datacenter traffic.

Why this answer

By default, Consul DNS queries are limited to the local datacenter of the agent that receives the query. A client in `dc1` querying `user-auth.service.consul` will only get instances from `dc1`. To discover instances in other datacenters, the query must explicitly include the datacenter, such as `user-auth.service.dc2.consul`.

This design promotes locality and avoids unintended cross-datacenter traffic.

Exam trap

The trap here is assuming that Consul automatically aggregates results from all datacenters or fails over to another datacenter, when in fact DNS queries are strictly scoped to the local datacenter unless specified otherwise.

230
MCQeasy

Which command is used to check the status of a registered service?

A.consul check
B.consul health service
C.consul status
D.consul list
AnswerB

The consul health service command queries Consul's health endpoint for a registered service, returning its instances and passing or failing checks. This directly reports service status, matching the requirement to verify a registered service's health.

Why this answer

The 'consul health service' command queries the health of all instances of a named service, returning the nodes, their health check statuses, and associated metadata. It is the standard CLI way to inspect whether a registered service is passing its checks and is reachable through the catalog.

Exam trap

The trap is picking a plausible-sounding but nonexistent command like 'consul status' or 'consul check' — candidates must recall that health inspection is namespaced under 'consul health' with subcommands service, node, checks, and state.

How to eliminate wrong answers

Option A is wrong because 'consul check' is not a valid Consul CLI subcommand — health checks are inspected via 'consul health checks' or through the health service/node commands. Option C is wrong because 'consul status' does not exist; agent status is viewed with 'consul info' or 'consul members'. Option D is wrong because 'consul list' is not a Consul command — listing services is done with 'consul catalog services' or 'consul services'.

231
MCQmedium

You are troubleshooting a health check that seems to be hanging. Which flag, if available, would provide more information about the check's execution within the agent logs?

A.-verbose
B.-log-level=debug
C.-monitor-checks
D.-trace
AnswerB

Raising the agent's log verbosity to debug makes Consul emit detailed health-check execution output, including script invocations and timing, which reveals where a hanging check stalls. The -log-level=debug flag therefore exposes the check's internal behaviour in the agent logs.

Why this answer

Increasing the agent's log level to 'debug' provides detailed information about check execution and processing.

232
Multi-Selecthard

Which THREE of the following are key components of a service definition?

Select 3 answers
A.Secret Key
B.Node BIOS version
C.Check/Health Check
D.Port
E.Service Name
AnswersC, D, E

A health check defines how Consul probes a service instance's availability, determining whether it is registered as passing or failing in the catalogue. It is a core service-definition block, alongside name and port, controlling readiness and DNS or load-balancing eligibility.

Why this answer

In a service definition (as used by service discovery/registry tools such as Consul), the Service Name (E) is the fundamental identifier that registers the service and lets other services and DNS/API lookups discover it, so it is a required key component. The Port (D) is also essential because it tells clients and the registry on which TCP/UDP port the service is listening, enabling correct routing and connection. A Check/Health Check (C) is likewise a core part of the definition, since it defines how the registry verifies the instance is healthy (e.g., an HTTP, TCP, or script check with an interval and timeout) and removes unhealthy instances from discovery.

By contrast, a Secret Key (A) is a credential/security artifact, not a structural element of a service definition, and a Node BIOS version (B) is hardware/firmware inventory data that has no role in describing or discovering a service.

Exam trap

Consul 1.15 often tests the distinction between required and optional fields in a service definition; candidates may incorrectly include unrelated items like secret keys or BIOS versions, or omit the health check as a key component.

233
MCQmedium

What is the recommended number of Consul servers per datacenter to ensure high availability?

A.3
B.2
C.1
D.10
AnswerA

Three servers allow the Raft consensus quorum of two to survive a single node failure while still electing a leader, giving high availability without the write-latency penalty that five or more servers introduce in one datacenter.

Why this answer

The recommended number of Consul servers per datacenter for high availability is three, because it allows the cluster to tolerate the failure of one server while maintaining quorum. Consul uses the Raft consensus algorithm, which requires a majority of servers to be available for writes. With three servers, a single failure leaves two servers, still a majority, so the cluster remains operational.

Exam trap

The trap is thinking that two servers provide high availability, but Raft requires a majority, so two servers cannot tolerate any failure; the exam tests understanding of quorum requirements.

How to eliminate wrong answers

Option B is wrong because two servers cannot tolerate any failure — if one goes down, only one remains, which is not a majority of two, so the cluster loses quorum and becomes read-only. Option C is wrong because a single server is a single point of failure; if it fails, the entire datacenter loses write capability. Option D is wrong because ten servers is excessive and increases Raft consensus overhead, leading to slower writes and more complex operations; odd numbers are preferred, and three or five are typical.

234
MCQeasy

Which protocol do Consul servers use to maintain the WAN gossip pool?

A.gRPC
B.DNS
C.Serf (SWIM)
D.HTTP
AnswerC

Consul servers use the Serf library, which implements the SWIM gossip protocol, to exchange membership and failure-detection messages across the WAN gossip pool. SWIM's infection-style dissemination lets datacentre servers converge on membership state without a central coordinator.

Why this answer

Consul servers use the Serf library, which implements the SWIM gossip protocol, to maintain the WAN gossip pool across datacenters. Serf handles membership, failure detection, and lightweight message dissemination over UDP/TCP. This is distinct from Raft, which handles consensus for the replicated state.

Exam trap

Consul 1.15 often tests the distinction between Serf/SWIM (gossip) and Raft (consensus) — candidates may pick HTTP or gRPC because they associate those with Consul's API, forgetting that membership uses Serf.

How to eliminate wrong answers

Option A is wrong because gRPC is used for Consul's newer service mesh data plane (xDS) and some internal APIs, not for WAN gossip membership. Option B is wrong because DNS is Consul's service discovery interface for clients, not the protocol servers use to gossip. Option D is wrong because HTTP is the client-facing API for KV, catalog, and ACL operations, not the server-to-server WAN gossip mechanism.

235
MCQmedium

What is the function of the 'consul connect envoy' command?

A.To launch and manage the Envoy proxy sidecar for a service.
B.To generate TLS certificates for Envoy.
C.To verify the Envoy binary installation.
D.To update the Envoy configuration via CLI.
AnswerA

The `consul connect envoy` command generates the Envoy bootstrap configuration and starts the sidecar proxy process, registering it with Consul's service mesh. This directly satisfies the stem's requirement by launching and managing the per-service Envoy sidecar, handling its lifecycle and configuration without manual bootstrap files.

Why this answer

This command bootstraps and manages the lifecycle of the Envoy sidecar process.

236
MCQmedium

A service is registered with Consul using the HTTP API, but it is not appearing in DNS queries. The service definition includes a health check that is currently critical. What is the most likely reason for the DNS query failure?

A.The service's health check is critical, so Consul excludes it from DNS results.
B.The service is registered in a different datacenter than the DNS query.
C.The service name contains uppercase letters, which are not allowed in DNS queries.
D.The DNS interface is disabled by default and must be enabled in the agent configuration.
AnswerA

Consul DNS only returns healthy instances by default. If a service's health check is critical, it is considered unhealthy and is omitted from DNS responses. This is the most likely reason the service does not appear in DNS queries, even though it is registered in the catalog.

Why this answer

Consul DNS returns only healthy service instances. When a service's health check is critical, the service is considered unhealthy and is excluded from DNS responses. Even though the service is registered and visible in the catalog, it will not resolve via DNS until the health check passes.

This behavior ensures that clients only receive addresses of healthy instances, which is a core principle of service discovery in Consul.

Exam trap

The trap here is assuming that registration alone guarantees DNS visibility, ignoring that health status filters DNS results.

237
MCQhard

When using the HTTP health check type, how can you verify that a specific header is included in the health check request?

A.By appending it to the URL string
B.It is not possible
C.By adding the 'header' object to the check definition
D.By setting the environment variable
AnswerC

The HTTP check's 'header' object accepts a map of header names to arrays of values, which Consul sends with each probe request. Defining it in the check block lets you assert that the specified header reaches the endpoint, satisfying the verification requirement.

Why this answer

In Consul's HTTP health check definition, you can specify custom headers using the 'header' object, which is a map of header names to arrays of values. This allows the health check request to include specific headers required by the application.

Exam trap

Consul 1.15 often tests whether candidates know that HTTP headers are configured via a dedicated 'header' object, not by modifying the URL or using environment variables.

How to eliminate wrong answers

Option A is wrong because appending a header to the URL string does not set an HTTP header; it would be part of the path or query string, not a header. Option B is wrong because Consul does support custom headers in HTTP checks via the header object. Option D is wrong because environment variables are not used to configure health check headers; that is not a Consul feature.

238
MCQhard

An operator is configuring a Connect sidecar proxy in a service definition so that outbound calls to a dependency are routed through the mesh. The dependency is registered as 'redis' in the same datacenter, listening on port 6379. The application expects to reach it at localhost:6379. Which upstream block in the sidecar_service definition achieves this?

A.upstreams = [{ destination_name = "redis", datacenter = "dc1", local_bind_port = 6379 }]
B.upstreams = [{ destination_name = "redis", local_bind_port = 6379 }]
C.upstreams = [{ destination_name = "redis", destination_port = 6379 }]
D.upstreams = [{ service = "redis", port = 6379 }]
AnswerB

The upstreams block names the destination service and the local port the sidecar listens on. Binding local port 6379 lets the application connect to localhost:6379, and the sidecar transparently forwards to the 'redis' service through mTLS, satisfying the application's expectation without code changes.

Why this answer

Upstreams in a sidecar_service definition require a destination_name and a local_bind_port. The local_bind_port is what the application dials on localhost, and the sidecar handles discovery, mTLS, and load balancing to the destination. Fields such as destination_port or service/port are not valid in this context, and a datacenter field is only needed for cross-datacenter upstreams.

Exam trap

The trap here is confusing the destination's service port with the sidecar's local listening port, which must be specified as local_bind_port.

239
MCQmedium

What is the effect of changing the 'interval' parameter in a service health check?

A.It changes the frequency at which the check runs.
B.It changes the DNS TTL.
C.It changes the weight of the service.
D.It changes the timeout of the check.
AnswerA

The interval parameter defines the duration between consecutive health check executions, so altering it changes how often Consul probes the service. Shorter intervals detect failures faster; longer intervals reduce probe traffic but delay status updates.

Why this answer

The `interval` parameter in a Consul health check definition controls how often the check is executed — for example, `interval = "10s"` runs the check every 10 seconds. It directly governs the polling frequency of the check script, HTTP endpoint, or TCP probe, and therefore how quickly Consul detects a state change.

Exam trap

The trap here is confusing `interval` with `timeout` — both are timing parameters in the same health check block, and candidates who don't read carefully may pick the timeout option.

How to eliminate wrong answers

Option B is wrong because DNS TTL is controlled by the `dns_config.ttl` setting in the Consul agent configuration, not by a health check's interval. Option C is wrong because service weights are set via the `weights` block in the service definition (used for load balancing in prepared queries and DNS SRV), unrelated to check interval. Option D is wrong because the check timeout is governed by the separate `timeout` parameter, which specifies how long to wait for the check to respond before marking it critical.

240
Multi-Selectmedium

Which THREE of the following are benefits of using the Consul DNS interface?

Select 3 answers
A.No application code changes required.
B.Provides advanced traffic shifting.
C.Platform-agnostic discovery.
D.Encrypts all traffic between services.
E.Easy integration with existing service discovery tools.
AnswersA, C, E

Consul's DNS interface resolves services through standard DNS queries, so existing applications discover services without any code modification or SDK integration. This satisfies the stem's benefit criterion by removing development effort entirely from the discovery path.

Why this answer

Ease of use, platform-agnostic, and no application changes are benefits.

241
MCQeasy

An operator runs `consul kv put config/app/timeout 30s` and then `consul kv get config/app/timeout`. The second command prints only `30s` with no metadata. The operator wants to see the key's `CreateIndex`, `ModifyIndex`, and `Flags` from the command line without writing code against the HTTP API. Which command should be used?

A.`consul catalog nodes -service=config/app/timeout`
B.`consul kv export config/app/timeout`
C.`consul kv get -detailed config/app/timeout`
D.`consul kv get -recurse config/app/timeout`
AnswerC

The `-detailed` flag on `consul kv get` prints the key's metadata fields, including `CreateIndex`, `ModifyIndex`, `LockIndex`, `Flags`, and `Session`, in addition to the value. It is the intended CLI way to inspect KV entry metadata without issuing raw HTTP requests, which is precisely what the operator needs here.

Why this answer

The CLI exposes KV metadata through the `-detailed` flag on `consul kv get`, which prints `CreateIndex`, `ModifyIndex`, `LockIndex`, `Flags`, `Session`, and the value. Plain `get` and `-recurse` show only names and values, while `export` emits a JSON tree for backup. To see index and flag fields from the shell, `-detailed` is the correct choice.

Exam trap

The trap here is assuming `-recurse` or `export` reveals metadata, when only the `-detailed` flag on `consul kv get` prints index, lock, flag, and session fields.

242
MCQhard

When troubleshooting a service that fails to start its Envoy proxy, which service definition field should you check for incorrect configuration?

A.proxy
B.checks
C.meta
D.tags
AnswerA

The `proxy` block configures the sidecar's Envoy settings, including upstreams, listeners and bootstrap options. Incorrect values here directly prevent the proxy from starting, so it is the field to inspect first when diagnosing startup failure.

Why this answer

The proxy field in a Consul service definition configures the Envoy sidecar, including upstreams, protocol, and the sidecar's port and configuration. If Envoy fails to start, the proxy stanza is the first place to inspect for malformed upstream definitions, invalid protocol values, or missing sidecar service registration.

Exam trap

The trap is blaming health checks or tags for proxy failures — candidates conflate service health or discovery metadata with the actual Envoy bootstrap configuration, which lives exclusively in the proxy block.

How to eliminate wrong answers

Option B is wrong because checks define health check behavior (HTTP, TCP, TTL, gRPC) and affect service health status, not Envoy startup — a bad check marks the service unhealthy but does not prevent the proxy from launching. Option C is wrong because meta holds arbitrary key-value metadata for filtering and external tooling; it has no bearing on Envoy configuration. Option D is wrong because tags are used for service discovery filtering and intention matching, not for proxy bootstrap; incorrect tags affect routing eligibility, not Envoy process startup.

243
Multi-Selectmedium

What components can affect the outcome of a health check? (Select THREE)

Select 3 answers
A.Network connectivity
B.Client browser
C.Application responsiveness
D.Agent configuration
E.Consul server uptime
AnswersA, C, D

Blocks check traffic.

Why this answer

Network connectivity (A) is correct because a health check must be able to reach the target service or node over the network; if the path is blocked, the check fails regardless of the service's actual state. Application responsiveness (C) is correct because the check's result depends on whether the application actually answers within the configured timeout and returns the expected status. Agent configuration (D) is correct because settings such as check interval, timeout, and the check definition itself determine when and how the check runs and what result is reported.

The client browser (B) is not involved, since health checks are performed by agents or servers, not by end-user browsers. Consul server uptime (E) is not a direct component of an individual health check outcome, as checks are executed by the local agent and only aggregated by the servers.

Exam trap

Consul 1.15 often tests the misconception that Consul servers or client browsers affect health check outcomes, but the exam expects focus on agent-level and service-level factors.

244
Multi-Selectmedium

A developer registers a service named 'orders' on a Consul node and wants DNS queries for orders.service.consul to return the service's SRV records so clients can discover both the address and the port. The developer is verifying that the registration contains everything needed for SRV resolution. Which two registration elements must be present for SRV queries to return usable records? (Choose two.)

Select 2 answers
A.A port value in the service definition
B.An explicit tag on the service
C.A health check attached to the service
D.A DNS-friendly service name with no underscores
E.A service address or a node address that Consul can resolve
AnswersA, E

SRV records include the service port as part of their data, so Consul cannot synthesize a meaningful SRV answer without a port. The service registration must therefore include a port field; if it is omitted or zero, Consul either omits the SRV record or returns a record with port 0, which clients cannot use to connect. This is why the port is essential for SRV-based discovery.

Why this answer

SRV answers combine a target host and a port, so Consul needs both a port from the service definition and a resolvable address, taken from the service address or inherited from the node. Health checks, tags, and naming conventions affect filtering or presentation but are not prerequisites for generating SRV records. The two required elements are therefore the port and the address.

Exam trap

The trap here is assuming a health check or a tag is required for SRV records, when the only structural requirements are a port and a resolvable target address.

245
MCQmedium

Which feature allows you to define a health check that depends on the health of another service?

A.Service dependency field
B.Cross-service monitoring
C.Service grouping
D.You must implement this logic in a script check
AnswerD

Consul's native health checks cannot reference another service's status, so dependency-aware health must be scripted. A script check queries the dependency's health endpoint or Consul API and returns the appropriate exit code, letting the registered service report unhealthy when its dependency fails.

Why this answer

Consul does not have a native 'service dependency' health check type. To make one service's health depend on another, you must implement the logic yourself, typically in a script check that queries the Consul API or DNS for the other service's health and returns an appropriate exit code. This is the documented and practical approach for cross-service health dependencies.

Exam trap

Consul 1.15 often tests the misconception that Consul has a built-in 'service dependency' health check type, when in reality you must implement it via a script check or the limited alias check.

How to eliminate wrong answers

Option A is wrong because there is no 'service dependency field' in Consul's service or check definition — no such configuration parameter exists. Option B is wrong because 'cross-service monitoring' is not a Consul feature; Consul health checks are scoped to a single service or node. Option C is wrong because 'service grouping' is not a Consul construct for health checks — services can be tagged or grouped logically, but that does not create a health dependency.

246
MCQmedium

You want to perform a list operation on a KV prefix to see all keys, but you don't want the values returned. Which API parameter helps reduce payload size?

A.raw=true
B.list=true
C.summarize=true
D.keys=true
AnswerD

Appending `keys=true` to a KV list request returns only key names, omitting values and metadata from the response body. This directly satisfies the stem's payload-reduction constraint, since the default list operation includes values for every key under the prefix, inflating the response unnecessarily.

Why this answer

The `keys=true` query parameter on the Consul KV list endpoint instructs the API to return only the key names under the given prefix, omitting the associated values. This dramatically reduces the response payload size when you only need to enumerate keys rather than retrieve their contents. It is the documented way to perform a lightweight listing operation against a KV prefix.

Exam trap

The trap here is confusing the `keys` parameter with `raw` or inventing non-existent parameters like `list` or `summarize`; candidates who have only skimmed the KV API docs may pick `raw=true` thinking it means 'raw list' rather than 'raw single value'.

How to eliminate wrong answers

Option A is wrong because `raw=true` does the opposite of reducing payload — it returns the raw, un-decoded value of a single key, bypassing the standard JSON envelope, and is only valid on a single-key read, not a list operation. Option B is wrong because `list=true` is not a valid Consul KV API parameter; listing is achieved by appending `?recurse` or using the `/v1/kv/<prefix>?keys` endpoint, so this option invents a parameter that does not exist. Option C is wrong because `summarize=true` is not a Consul KV API parameter — Consul does not offer a summarize flag on KV reads, so this is a fabricated option designed to sound plausible.

247
MCQeasy

Which Consul feature allows you to observe the KV store for changes and run a command in response?

A.KV Hooks
B.Consul Watches
C.Consul Events
D.Consul Connect
AnswerB

Consul Watches monitor a specified KV prefix or key for changes and invoke a handler, such as an executable script, when an update occurs. This satisfies the requirement to observe the KV store and run a command in response.

Why this answer

Consul Watches are a mechanism that allows you to monitor specific Consul data (such as KV pairs, health checks, or service listings) for changes and trigger an external handler (e.g., a script or HTTP endpoint) when a change occurs. The watch polls the Consul API at a specified interval and invokes the handler with the updated data. This is the intended feature for reacting to KV store modifications.

Exam trap

The trap here is confusing Consul Events with Watches; candidates often think Events are used for monitoring KV changes, but Events are for custom broadcasts, while Watches are for observing data changes and triggering actions.

How to eliminate wrong answers

Option A is wrong because 'KV Hooks' is not a Consul feature; it is a fabricated term. Option C is wrong because Consul Events are used for broadcasting custom user events via the event API, not for observing KV changes and running commands. Option D is wrong because Consul Connect provides service-to-service mTLS encryption and authorization, not KV change monitoring.

248
MCQmedium

What is the purpose of the 'check' field inside a 'service' object in a Consul configuration file?

A.To define the health status requirements
B.To provide credentials for the service
C.To enable service discovery
D.To set the service weight
AnswerA

The check field attaches a health check definition to the service, specifying the script, interval and status thresholds Consul uses to determine whether that service instance is healthy and should remain in DNS or catalog results.

Why this answer

In a Consul service definition, the check field (or checks array) declares one or more health checks associated with that service, such as HTTP, TCP, script, TTL, or gRPC checks. Consul uses these checks to determine whether the service instance is healthy and should be returned by DNS or the catalog API. The correct answer is that it defines the health status requirements for the service.

Exam trap

Consul 1.15 often tests the misconception that the check field enables discovery or stores credentials, when it strictly defines health evaluation criteria for the service.

How to eliminate wrong answers

Option B is wrong because credentials are not configured via the check field; authentication for checks is handled through headers, TLS, or ACL tokens, not the check definition itself. Option C is wrong because service discovery is enabled by registering the service with a name and port; the check field only governs health evaluation, not discovery. Option D is wrong because service weights are set in the Weights field of the service definition (used for DNS SRV weighting and load balancing), not in the check field.

249
MCQeasy

You are deploying a new Consul datacenter and need to configure the servers to join the existing WAN gossip pool. Which configuration parameter should you set on the new servers to specify the addresses of the existing WAN servers?

A.`start_join_wan`
B.`retry_join_wan`
C.`join_wan`
D.`retry_join`
AnswerB

`retry_join_wan` is specifically designed to provide addresses of servers in other datacenters to join the WAN gossip pool. When set, the agent will attempt to join the WAN gossip pool using the provided addresses. This is the correct way to federate a new datacenter with existing ones. It is commonly used in multi-datacenter deployments to automate WAN joining.

Why this answer

To join a new datacenter to an existing WAN gossip pool, you must configure `retry_join_wan` on the servers in the new datacenter. This parameter accepts a list of addresses of servers in other datacenters. The agent will continuously attempt to join the WAN pool using these addresses, providing resilience.

This is the standard method for WAN federation in Consul 1.15.

Exam trap

The trap here is confusing `retry_join` (used for LAN gossip within a datacenter) with `retry_join_wan` (used for WAN gossip across datacenters).

250
MCQeasy

What is the consequence of having a service with no health checks registered?

A.The service status is 'passing'
B.The agent will error out
C.The service is ignored by DNS
D.The service is critical
AnswerA

Consul treats a service with no registered health checks as healthy by default, so its status is reported as passing. No check can fail, meaning the service remains in the catalog and receives traffic until checks are defined.

Why this answer

In Consul, a service registered without any health checks is treated as healthy by default, so its status is reported as 'passing'. Consul only marks a service as critical if an associated check fails; with no check defined, there is nothing to fail, so the service remains passing and is returned by DNS and service discovery queries.

Exam trap

The trap is assuming 'no health check' means 'unhealthy' — in Consul, absence of checks defaults to passing, which is the opposite of what many candidates expect.

How to eliminate wrong answers

Option B is wrong because the Consul agent does not error out when a service has no health checks — it simply registers the service with no checks attached, which is a valid configuration. Option C is wrong because the service is not ignored by DNS; with no failing check, it is considered passing and is included in DNS SRV/A records for the service. Option D is wrong because 'critical' status is only assigned when a defined check reports critical — absence of checks does not produce critical status.

251
MCQhard

An operations engineer registers an external PostgreSQL service on a Consul 1.15 client agent. The database listens on 10.20.30.40:5432 and is not managed by Consul, but a co-located exporter on the same VM exposes readiness at http://127.0.0.1:9187/ready. The engineer wants Consul to gate the service on the exporter's readiness signal while still advertising the database's real address and port to consumers. Which registration best achieves this?

A.Register only an http check named postgres-ready and rely on the check ID to imply the backing service.
B.Register the service with address 10.20.30.40 and port 5432, and attach an http check with target http://127.0.0.1:9187/ready.
C.Register the service with address 127.0.0.1 and port 9187, and attach a tcp check on the exporter port.
D.Register the service with address 10.20.30.40 and port 5432, and attach a tcp check to 10.20.30.40:5432 with a short interval.
AnswerB

The service block can advertise the database's genuine address and port independently of the check, and an http check may target any URL the agent can reach, including a loopback exporter. This keeps service discovery accurate while gating catalog health on the exporter. It is the cleanest way to monitor an unmanaged dependency through a sidecar signal without exposing the exporter as a service.

Why this answer

A service definition's address and port fields describe where consumers should connect, while checks are independent probes the agent executes. Pointing an http check at the loopback exporter while advertising the database's real endpoint gives accurate discovery plus a meaningful readiness gate. The other approaches either mispublish the endpoint, detach the check from the service, or substitute a weaker signal.

Exam trap

The trap here is believing the check must target the same address and port that the service advertises, when checks and service endpoints are configured independently.

252
Multi-Selectmedium

Which of the following conditions can cause a health check to transition to the 'critical' state? (Select TWO)

Select 2 answers
A.The HTTP check times out
B.The script returns a non-zero exit code
C.The service is idle
D.The service returns a 200 OK
E.The disk space is 50% full
AnswersA, B

An HTTP check transitions to critical when its request exceeds the configured timeout, since Consul cannot confirm the endpoint is healthy. The timeout constraint in the stem is satisfied because no successful response is received within the allowed interval, marking the service unhealthy.

Why this answer

Option A is correct because a health check that times out — for example, an HTTP/HTTPS check that fails to receive a response within its configured timeout interval — is treated as a failed check and drives the target into the 'critical' state. Option B is correct because a script-based health check that returns a non-zero exit code signals failure (exit code 0 conventionally means success), so the check is marked unhealthy and transitions to 'critical'. Options C, D, and E do not belong: an idle service is not inherently unhealthy, a 200 OK response is a successful HTTP status that keeps the check healthy, and 50% disk usage is well below typical warning/critical thresholds, so none of these would trigger a critical health state.

Exam trap

Consul 1.15 often tests the distinction between active health check failures (timeouts, non-zero exit codes) and passive indicators (idle service, disk usage) that do not directly trigger critical status unless explicitly configured in a custom check.

253
MCQeasy

An operator registers a service with a TTL check and forgets to send periodic updates. After the TTL expires, what status does Consul report for that check, and what is the immediate effect on service discovery?

A.The check becomes warning, and the service remains discoverable but is deprioritized in DNS results.
B.The check becomes critical, and healthy instances of the service are excluded from DNS and health API results.
C.The check remains passing until the agent restarts, because TTL expiry is evaluated lazily.
D.The check transitions to unknown, and the service is still returned by DNS with a warning flag.
AnswerB

When a TTL check is not updated within its TTL, Consul marks it critical. By default, DNS queries and the health API return only passing instances, so the service is effectively removed from the healthy set until an update is sent. This behaviour is the primary reason TTL checks require a reliable heartbeat mechanism from the service or its supervisor.

Why this answer

A TTL check must be updated within its TTL or the agent marks it critical. Because Consul's DNS and health API default to returning only passing instances, the service stops being discoverable as healthy until a new update arrives. This makes heartbeat reliability a critical design consideration for TTL-based checks.

Exam trap

The trap here is assuming an expired TTL degrades gracefully to warning, when it actually flips straight to critical and removes the instance from healthy discovery.

254
Multi-Selecteasy

Which TWO of the following are common use cases for the Consul KV store?

Select 2 answers
A.Traffic routing
B.Distributed locking
C.Service discovery
D.Running custom scripts
E.Distributed configuration management
AnswersB, E

Consul's KV store supports acquire and release operations backed by session-based consensus, letting clients hold a lock key exclusively. This satisfies the distributed locking use case: multiple service instances coordinate leader election or serialised access without an external coordinator.

Why this answer

Option B (Distributed locking) is correct because Consul KV supports acquiring and releasing locks via sessions, using the KV store's compare-and-swap semantics combined with session invalidation to implement distributed locking and leader election. Option E (Distributed configuration management) is correct because Consul KV is commonly used to store application configuration key/value pairs that services read at runtime, with Consul's blocking queries and watches enabling dynamic config updates. Option A (Traffic routing) is not a KV use case; traffic routing is handled by Consul service mesh features such as intentions, service resolvers, and Envoy sidecar proxies.

Option C (Service discovery) is provided by Consul's catalog and DNS/HTTP service registration APIs, not the KV store. Option D (Running custom scripts) is not a Consul KV function; Consul executes scripts only via health checks or watches that trigger external handlers, not as a KV capability.

Exam trap

The trap is confusing KV with service discovery or traffic routing; candidates see 'Consul' and pick service discovery, but the question specifically asks about the KV store's use cases, which are locking and configuration.

255
MCQeasy

A team runs Consul 1.15 with Connect. They want to observe which services are allowed to communicate with a specific service named 'inventory' and confirm whether a particular source is permitted, without sending real traffic. Which command should they use to query the effective intention decision for a source and destination?

A.consul catalog nodes -service inventory
B.consul intention list -destination inventory
C.consul intention check -source billing -destination inventory
D.consul connect envoy -sidecar-for inventory --dry-run
AnswerC

The intention check subcommand evaluates the effective authorization decision between a source and destination, reporting whether the connection is allowed or denied. It accounts for matching intentions and the default policy, making it the right tool to verify permissions without generating actual mesh traffic.

Why this answer

The intention check subcommand evaluates the effective decision for a source and destination pair, factoring in matching intentions and the default policy. It is the direct way to verify whether a source is permitted to reach a destination without generating real traffic, which is exactly what the team needs.

Exam trap

The trap here is confusing listing intentions with evaluating the effective decision, since a list does not resolve wildcard and default-policy interactions for a specific pair.

256
MCQmedium

What is the 'Consul Connect proxy' kind used for?

A.To define a gateway.
B.To mark a service definition as a sidecar proxy.
C.To define the service that the proxy runs in front of.
D.To enable mTLS for the service.
AnswerB

Registering a service with kind = "connect-proxy" and a proxy destination identifies it as the sidecar that fronts another service, so Consul wires the proxy's listeners and upstreams to that target rather than treating it as an ordinary service.

Why this answer

It defines a service that is explicitly a sidecar proxy.

257
MCQeasy

An operator registers a web service with an HTTP health check. The check is configured with http = "http://localhost:8080/health" and method = "GET". The service's health endpoint returns HTTP 500 when the application is running but has a database connection problem. What status will Consul report for this check?

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

Consul's HTTP check marks the service critical for any HTTP response code outside the 2xx range, including 500. Since the endpoint returns 500 when the database connection fails, Consul reports critical. This correctly signals that the service is running but unhealthy and should not receive traffic.

Why this answer

Consul's HTTP health check considers only HTTP 2xx responses as passing. Any other response code, including 500, results in a critical status. The endpoint is reachable, but the server error indicates an unhealthy application state.

Warning and maintenance are not automatically applied based on HTTP status codes.

Exam trap

The trap here is assuming that a reachable HTTP endpoint always yields passing, or that a 500 response maps to warning instead of critical.

258
MCQhard

A microservice uses a Consul session with a 30-second TTL and holds a lock on `locks/leader` via `acquire`. The service process is alive and healthy but its network link to the Consul servers is severed for several minutes. When connectivity is restored, the service finds it no longer owns the lock. Which behavior explains this outcome?

A.The lock was released because Consul applies a fixed maximum lock hold time of 15 seconds regardless of session TTL settings.
B.The session TTL expired because the service failed to renew it within the TTL window, so Consul invalidated the session and released its locks.
C.Consul invalidated the session because the node's health check for the service was marked critical during the outage.
D.The lock moved to another session immediately after the partition began because Consul rebalances locks among active sessions automatically.
AnswerB

Sessions are kept alive only by timely renewal; if the client cannot reach the servers to renew within the TTL, the session expires and Consul deletes it, which releases every lock and invalidates every key held by that session. The severed link prevented renewal, so the lock was freed exactly as designed.

Why this answer

Session-based locks in Consul are leases: the client must renew the session before its TTL elapses, and failure to renew causes the session to expire, which deletes the session and releases all locks and keys it held. A network partition that blocks renewal therefore forfeits the lock, which is the intended safety behavior preventing a partitioned leader from retaining ownership indefinitely.

Exam trap

The trap here is blaming health-check invalidation or an automatic lock rebalance, when the default session behavior releases locks solely because the unrenewed TTL expired.

259
Multi-Selectmedium

A Consul administrator is reviewing how check results propagate and wants to understand which factors determine whether a service instance is considered healthy in the catalog. Which two factors directly determine a service's aggregate health status in Consul? (Choose two.)

Select 2 answers
A.The number of other services registered on the same agent
B.The Consul version running on the server that handles the catalog write
C.The datacenter in which the service is registered
D.The status of the node-level checks associated with the agent hosting the service
E.The status of the checks registered against that specific service instance
AnswersD, E

A service's aggregate health includes the status of the node on which it runs. If a node-level check such as the built-in serfHealth check is critical, the node is unhealthy and every service on that node is reported as unhealthy in catalog queries, even if the service's own check is passing.

Why this answer

Consul determines a service instance's health from two sources: the checks attached to that service and the checks attached to the node hosting it. A critical node check, such as a failed serfHealth, makes every service on that node unhealthy, while a critical service check makes only that instance unhealthy. Other attributes such as sibling service count, datacenter, or server version do not participate in the health computation.

Exam trap

The trap here is overlooking node-level checks and assuming only a service's own checks influence its health, when a failing node check marks every service on that node unhealthy.

260
Multi-Selecthard

Which TWO of the following accurately describe Consul's WAN gossip protocol behavior?

Select 2 answers
A.It involves only the server nodes of each datacenter.
B.It relies on a central hub-and-spoke architecture.
C.It is optimized to handle higher latency than LAN gossip.
D.It includes all client nodes in the gossip pool.
E.It is mandatory for service discovery.
AnswersA, C

The WAN gossip pool contains only Consul server nodes, one per datacentre, which exchange membership and datacentre information across the federation. Clients join only the LAN pool, so this statement accurately describes WAN gossip behaviour.

Why this answer

Option A is correct because Consul's WAN gossip pool is formed exclusively by the server nodes from each datacenter, which federate across datacenters; client agents do not participate in the WAN gossip. Option C is correct because the WAN gossip protocol is specifically tuned for higher latency and lower bandwidth conditions typical of cross-datacenter links, unlike the LAN gossip pool that assumes low-latency local networks. Option B is not correct because Consul's WAN gossip uses a full-mesh among servers rather than a central hub-and-spoke topology.

Option D is not correct because client nodes only join the LAN gossip pool within their own datacenter, not the WAN pool. Option E is not correct because service discovery relies on the catalog and DNS/HTTP interfaces, not on the WAN gossip protocol being mandatory.

Exam trap

Consul 1.15 often tests the distinction between LAN and WAN gossip pools, and candidates commonly assume that all nodes participate in WAN gossip or that it is required for service discovery, leading to incorrect selections.

261
Multi-Selecthard

You are designing a configuration system where multiple instances of a service must coordinate to elect a single leader using Consul KV. Which two statements accurately describe how to implement leader election with sessions? (Choose two.)

Select 2 answers
A.Each instance should create a session with a unique name and then attempt to acquire the same KV key using PUT /v1/kv/service/leader?acquire=<session_id>.
B.To release leadership, the leader can simply delete the KV key, which automatically invalidates its session and allows another instance to acquire the lock.
C.The leader should periodically renew its session using PUT /v1/session/renew/<session_id> to maintain the lock, and if renewal fails, it should assume leadership is lost.
D.All instances should use the same session ID to ensure they can all attempt to acquire the lock simultaneously, and the first one to call acquire becomes the leader.
E.The KV key used for leader election must have a TTL set via the ?ttl= query parameter, so that it expires automatically if the leader fails.
AnswersA, C

This is the correct pattern for leader election. Each candidate creates a session and attempts to acquire a shared key. Only one session can hold the lock at a time. The successful acquirer becomes the leader, and others receive a false response and should retry or wait.

Why this answer

Leader election with Consul KV relies on sessions and the acquire operation. Each candidate creates a unique session and attempts to acquire a shared key. The holder must renew its session to keep the lock; if renewal fails, the session expires and the lock is released.

Deleting the key or sharing sessions does not provide correct coordination, and KV entries do not support TTLs.

Exam trap

The trap here is assuming that deleting the KV key or setting a TTL on the key can replace session renewal, when in fact only session invalidation releases the lock.

262
MCQeasy

You are deploying a legacy application that does not support HTTP or TCP health checks. Which Consul health check type should you configure to allow the application to signal its own health via a heartbeat API call?

A.TTL check
B.HTTP check
C.TCP check
D.Script check
AnswerA

A TTL check inverts the model: the application must periodically call Consul's HTTP pass endpoint to reset the timer, and Consul marks it critical if the heartbeat lapses. This suits legacy apps lacking HTTP or TCP endpoints, since they signal health themselves.

Why this answer

A TTL check is designed exactly for this scenario: the service (or an external script) must periodically call Consul's HTTP API to mark itself healthy, and if the TTL elapses without an update, Consul marks the check critical. This lets a legacy application that cannot expose HTTP/TCP endpoints signal its own health via a heartbeat.

Exam trap

Consul 1.15 often tests the direction of the check — candidates confuse TTL (service pushes to Consul) with HTTP/TCP/script (Consul pulls from the service) and pick an active check for a passive application.

How to eliminate wrong answers

Option B is wrong because an HTTP check requires Consul to actively poll an HTTP endpoint on the service, which the legacy app cannot expose. Option C is wrong because a TCP check requires Consul to open a TCP connection to a port on the service, which the app also cannot provide. Option D is wrong because a script check runs a local command on the Consul agent node and interprets its exit code — it does not let the application push its own heartbeat.

263
MCQhard

An operator is troubleshooting a Consul datacenter that was recently federated with another datacenter. They notice that cross-datacenter service discovery works, but ACL tokens created in the primary datacenter are not being recognized in the secondary datacenter. What is the most likely cause?

A.The primary datacenter's servers are not configured with retry_join_wan pointing to the secondary.
B.The secondary datacenter's servers have a different gossip encryption key than the primary.
C.The secondary datacenter is configured with primary_datacenter set to its own name instead of the primary's name.
D.The secondary datacenter's servers are not configured with a valid acl_replication_token.
AnswerD

ACL replication requires the secondary datacenter to authenticate to the primary using a token with replication permissions. If acl_replication_token is missing, expired, or lacks the necessary policies, the secondary cannot pull token and policy updates. As a result, tokens created in the primary will not be replicated, and the secondary will not recognize them for authorization.

Why this answer

ACL replication in Consul is driven by the secondary datacenter, which uses acl_replication_token to authenticate to the primary and pull updates. Without a valid token, the secondary cannot fetch new tokens or policies, so tokens created in the primary will not be recognized. Other settings like retry_join_wan and gossip encryption affect WAN federation but not the ACL replication process itself.

Exam trap

The trap here is focusing on WAN gossip settings when the symptom points specifically to ACL replication, which depends on a replication token rather than gossip configuration.

264
MCQhard

A Consul operator is troubleshooting a service that intermittently disappears from the catalog. The service is registered with a TTL health check that is updated every 30 seconds by a script. The operator notices that the service is marked as critical and then deregistered. Which configuration change should the operator make to prevent the service from being deregistered?

A.Increase the `deregister_critical_service_after` value in the agent configuration
B.Set the `status` field of the service to `passing` in the service definition
C.Disable the health check by removing the `check` block from the service definition
D.Change the health check to a script check that runs every 30 seconds
AnswerA

The `deregister_critical_service_after` setting controls how long a service can be critical before being automatically deregistered. By default, it is 30 minutes. If the service is intermittently failing health checks, increasing this value gives more time for the service to recover before being removed. This is the correct approach to prevent deregistration due to temporary failures.

Why this answer

The `deregister_critical_service_after` setting defines the duration a service can remain critical before automatic deregistration. Increasing this value allows more time for the service to recover from transient failures. The other options either mask the problem or remove health monitoring, which is not advisable.

Exam trap

The trap here is thinking that changing the health check type or manually setting status will prevent deregistration, when the actual control is the critical service deregistration timeout.

265
MCQhard

A Consul cluster has a service registered with an HTTP health check pointing to https://10.0.0.5:8443/health. The check is failing with a TLS certificate verification error even though the service is healthy. The operator wants Consul to skip certificate verification for this specific check without disabling TLS globally. Which check configuration field should be set?

A.ca_file
B.verify_outgoing
C.tls_skip_verify
D.method
AnswerC

The tls_skip_verify field is a boolean on HTTP checks that instructs the Consul agent to skip TLS certificate verification for that specific check. Setting it to true allows the check to succeed against a service using a self-signed or otherwise untrusted certificate without altering global agent TLS settings. This is the correct targeted approach for the scenario.

Why this answer

HTTP health checks in Consul support a tls_skip_verify boolean that disables certificate verification for that individual check. This allows checks against services with self-signed or internal CA certificates to succeed without weakening the agent's global TLS posture. The other listed fields either apply to agent-level TLS settings or to unrelated aspects of the check request.

Exam trap

The trap here is assuming that agent-level TLS settings like verify_outgoing or ca_file apply to per-check HTTP requests, when Consul provides a dedicated per-check field for skipping verification.

Page 3

Page 4 of 4

All pages