Configuring Consistent Hash Load Balancing in Aeraki Mesh for Dubbo Services
This tutorial demonstrates how to install Aeraki Mesh, view its default Round Robin load balancing, and configure a Consistent Hash algorithm for Dubbo services using Istio DestinationRule metadata, then verifies the behavior and explains the underlying RDS routing configuration.
Aeraki Mesh, a CNCF sandbox project, allows management of any L7 protocol within a service mesh; this guide walks through using Aeraki to apply Consistent Hash load balancing for Dubbo (and Thrift) services.
After installing Aeraki, Istio, and the example programs, two namespaces meta-dubbo and meta-thrift appear, each containing a sample Dubbo or Thrift application.
By default Aeraki uses the Round Robin algorithm, which can be observed with kubectl get ns | grep meta and the client log output showing requests alternating between the two pods.
To switch to Consistent Hash, a DestinationRule is applied that sets loadBalancer.consistentHash.httpHeaderName: method , ensuring the hash is derived from the method metadata field:
➜ ~ kubectl apply -f- <After applying the rule, client logs show all requests being routed to the same backend pod, confirming the Consistent Hash behavior.
The underlying mechanism works by Aeraki translating the DestinationRule into an RDS (Route Discovery Service) configuration that the MetaProtocol proxy consumes. The cluster configuration can be inspected with aerakictl_sidecar_config consumer meta-dubbo | fx , revealing the RING_HASH policy, and the route configuration JSON shows a hash_policy referencing the method metadata.
{
"version_info": "2022-03-29T04:56:04Z/12",
"cluster": {
"@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
"name": "outbound|20880||org.apache.dubbo.samples.basic.api.demoservice",
"type": "EDS",
"lb_policy": "RING_HASH",
...
},
"route_config": {
"@type": "type.googleapis.com/aeraki.meta_protocol_proxy.config.route.v1alpha.RouteConfiguration",
"name": "org.apache.dubbo.samples.basic.api.demoservice_20880",
"routes": [{
"name": "default",
"route": {
"cluster": "outbound|20880||org.apache.dubbo.samples.basic.api.demoservice",
"hash_policy": ["method"]
}
}]
},
"last_updated": "2022-03-29T04:56:05.817Z"
}The next tutorial will cover how to view metric data for Aeraki Mesh.
Cloud Native Technology Community
The Cloud Native Technology Community, part of the CNBPA Cloud Native Technology Practice Alliance, focuses on evangelizing cutting‑edge cloud‑native technologies and practical implementations. It shares in‑depth content, case studies, and event/meetup information on containers, Kubernetes, DevOps, Service Mesh, and other cloud‑native tech, along with updates from the CNBPA alliance.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.