Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do I have a delay in querying data by API interface? #3482

Closed
lf1029698952 opened this issue Sep 19, 2017 · 2 comments
Closed

Why do I have a delay in querying data by API interface? #3482

lf1029698952 opened this issue Sep 19, 2017 · 2 comments
Labels
waiting-reply Waiting on response from Original Poster or another individual in the thread

Comments

@lf1029698952
Copy link

I have a three node consul cluster, A, B, C, A is leader

I use the consul cluster as a service discovery for the docker container, There is a consul agent member in each docker container

When consul agent member start join CONSUL_IP, register information with Consul, and I will use api interface "consul_host:8500/health/service/web?passing&node-meta=" to query data, to determine whether member is alived。
Oddly enough, when my container start join with leader(A), and I can query the data immediately by api. but when my container start join with not leader node(B or C), I can't query the data immediately by api, “consul members” command is normal, but query the members data by api interface old data, It'll be normal in about three minutes, I can query the data normally。

Why this is the case, the data synchronization between consul nodes is delayed, or my method is wrong? And how can I query the data immediately by api.
please enlighten, thanks!

consul version

Client: [0.7.5]
Server: [0.7.5]

consul info

Server:

[Server `consul info` here]
agent:
        check_monitors = 0
        check_ttls = 0
        checks = 0
        services = 1
build:
        prerelease =
        revision = '21f2d5a
        version = 0.7.5
consul:
        bootstrap = true
        known_datacenters = 1
        leader = true
        leader_addr = IP:8300
        server = true
raft:
        applied_index = 856260
        commit_index = 856260
        fsm_pending = 0
        last_contact = never
        last_log_index = 856260
        last_log_term = 2
        last_snapshot_index = 852007
        last_snapshot_term = 2
        latest_configuration = [{Suffrage:Voter ID:IP:8300 Address:IP:8300} {Suffrage:Voter ID:IP:8300 Address:IP:8300} {Suffrage:Voter ID:IP:8300 Address:IP:8300}]
        latest_configuration_index = 7
        num_peers = 2
        protocol_version = 1
        protocol_version_max = 3
        protocol_version_min = 0
        snapshot_version_max = 1
        snapshot_version_min = 0
        state = Leader
        term = 2
runtime:
        arch = amd64
        cpu_count = 2
        goroutines = 160
        max_procs = 10
        os = linux
        version = go1.7.5
serf_lan:
        encrypted = true
        event_queue = 0
        event_time = 2
        failed = 0
        health_score = 0
        intent_queue = 0
        left = 15
        member_time = 713
        members = 47
        query_queue = 0
        query_time = 1
serf_wan:
        encrypted = true
        event_queue = 0
        event_time = 1
        failed = 0
        health_score = 0
        intent_queue = 0
        left = 0

Operating system and Environment details

Linux 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

@slackpad
Copy link
Contributor

Hi @lf1029698952 sorry for the late response on this one - did you figure this out? It might help to see some log output from the servers at debug level when this is happening.

@slackpad slackpad added the waiting-reply Waiting on response from Original Poster or another individual in the thread label Dec 19, 2017
@slackpad
Copy link
Contributor

slackpad commented Jan 5, 2018

Closing since we never heard back.

@slackpad slackpad closed this as completed Jan 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-reply Waiting on response from Original Poster or another individual in the thread
Projects
None yet
Development

No branches or pull requests

2 participants