Question #228472 on Graphite changed: https://answers.launchpad.net/graphite/+question/228472
Xabier de Zuazo proposed the following answer: Hello Brian and Anatoliy: I'm no expert in Graphite, so take my explanations with a grain of salt. I can be wrong. Graphite-web of course uses ConsistentHashing. > b.) Id' suspect we want all the destinations in CARBONLINK_HOSTS so > we don't get different consistent-hashing results vs DESTINATIONS > c.) Is it smart enough to simply limit to local instances when > deciding what to ask? Graphite-web uses ConsistentHashing only for local carbon-cache instances cached-hot data (CARBONLINK_HOSTS). Remote instances are queried through their graphite-web instances (CLUSTER_SERVERS), which in fact internally use ConsistentHashing to query theirs local carbon-cache instances. * DESTINATIONS should include all the carbon-cache instances in the cluster, including local and remote. * CARBONLINK_HOSTS should include all the local carbon-cache instances. * CLUSTER_SERVERS should include the other graphite-web instances, but not itself. Graphite-web searches for metrics in the following order: 1) Search local DATA_DIRS. 2) If not found, search remote CLUSTER_SERVERS (through graphite-web) without using ConsistentHashing, simple loop. 3) In both cases, merge the results with CARBONLINK_HOSTS (carbon-cache cached-hot data) queried using ConsistentHashing. Anatoliy: If you include all the instances in CARBONLINK_HOSTS, not only local, remote carbon-caches will be queried twice, once by the local graphite-web and one by the remote graphite-web. In your second example, graphite-web will not need to query CARBONLINK_HOSTS, because CLUSTER_SERVERS already returned the cached -hot data. So no matter if ConsistentHashing returns different results when the metric are in a remote instance, graphite-web already returned them. Am I wrong in this? To clarify things: DESTINATIONS (used by carbon-relay & carbon-aggregator): * Lists all the carbon-cache instances in the cluster. * Uses PICKLE_RECEIVER_PORT. * Format: (IP|FQDN):PICKLE_RECEIVER_PORT:instance (for example "1.2.3.4:2004:a") CLUSTER_SERVERS (used by graphite-web): * Lists all the graphite-web instances except itself. * Uses graphite-web HTTP listen port. * Format: (IP|FQDN):listen_port (for example "1.2.3.4:80") CARBONLINK_HOSTS (used by graphite-web): * Lists all the local carbon-cache instances. * Uses CACHE_QUERY_PORT. * Format: (IP|FQDN):CACHE_QUERY_PORT:instance (for example "1.2.3.4:7002:a"). Note: The used hostnames/IPs should match in DESTINATIONS and CARBONLINK_HOSTS due to the ConsistentHashing (I mean avoid using localhost or private IPs for referring to local instances). But the contents of their arrays may differ. They will match when we have only local carbon-caches, nothing more, only one server. Regards. -- You received this question notification because you are a member of graphite-dev, which is an answer contact for Graphite. _______________________________________________ Mailing list: https://launchpad.net/~graphite-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~graphite-dev More help : https://help.launchpad.net/ListHelp

