Does a failed node cause whole rack to also go down?
Is there such a concept of a hot backup for a node such that when a node within a rack is restarted, experiences failure, etc, it doesn't take the whole rack down.
For instance: Adding two dyn_seeds with different IPs but same token
What is the servers used for. Can this be used to have multiple Redis per node? Is this for future support for backdoor of https://github.com/Netflix/dynomite/issues/92
How to recover from down rack. The process here seems error prone for a prod system: https://github.com/Netflix/dynomite/issues/51. Are there other solutions?
2 datacenters with a single rack each containing 2 nodes (4 machines total). If I set a value on ANY server it seems to SET it ok. I can retrieve it from all 4. If I take one node in DC1 down, set the value in DC2, bring DC1 back up then query the value I get two different answers depending on which server the redis-cli connects to. The old or the new.
- Can a node not survive a restart without loosing remote changes (no sync up)?
- While DC1's node1 is down, a query to DC1's node 2 returns "(error) ERR Peer: Connection refused" instead of proxying the other rack in DC2. Aren't the server nodes aware of duplicates in other DCs?
If I missed something let me know.
My YML file is the sameon all 4 with only datacenter and tokens that differ. dyn_o_mite: datacenter: dc1 rack: rack1 dyn_listen: 0.0.0.0:8101 dyn_seeds:
- 52.8.98.204:8101:rack1:dc1:0
- 52.8.1.16:8101:rack1:dc1:2147483648
- 52.5.94.26:8101:rack1:dc2:0
- 52.6.167.43:8101:rack1:dc2:2147483648 listen: 0.0.0.0:8102 servers:
- 127.0.0.1:6379:1 tokens: '0' secure_server_option: datacenter pem_key_file: dynomite.pem redis: true
We are currently working a repair system similar to the way Cassandra's repair work to fix the inconsistency nodes to address this issue.
We are not supporting nodes to proxy to other nodes to different DCs at this time and this might change in the future. If you use our Dyno Java client, it will do that for you, failing over nodes on a different rack. Currently, Dynomite nodes can only proxy to same-rack nodes for reads.
Thanks for the response. I figured that is what was going on and I did know about Dyno's ability to detect and redirect.
@timiblossom I have two racks in the same data center. Each rack has only one node. Then i shutdown the redis in rack1. When i read from the node in rack1, i get "err storage: connection refused" . In my opinion, even redis is down, but dynomite node is not down. It still can proxy to other nodes. So i want to know why would this happen.
Hello Dynomite will not do a failover of its own. If you are using the Dyno client (https://github.com/Netflix/dyno) (which is a wrapper on top of jedis) it should do the failover for you. Otherwise its up to the client to do the failover. This is by design in dynomite.
@shailesh33 Thanks for response. I know what you mean. But in my scene, only redis is down and dynomite node is not down. So my question is, if redis is down, would the dynomite node be down too?
Dynomite process as such is not down but the health of the node overall is not green which essentially means that it will not write to the local node. We internally have a dynomite manager process which takes care of monitoring both redis and dynomite and update the health in discovery. Clients poll the discovery to receive health updates. @ipapapa is in the process of open sourcing Dynomite manager. Long story short, the local redis is down, yes but dynomite isnt. so the client "should" failover in this case.
On Wed, Apr 27, 2016 at 10:37 AM, Yufeng Tang [email protected] wrote:
@shailesh33 https://github.com/shailesh33 Thanks for response. I know what you mean. But in my scene, only redis is down and dynomite node is not down. So my question is, if redis is down, would the dynomite node be down too?
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/Netflix/dynomite/issues/124#issuecomment-215164649
@shailesh33
We are using the Dyno java client for connecting. However the fail over for two racks in same DC is not working. Our setup is having two racks in same data center and each rack is having single node. It is discussed here https://github.com/Netflix/dyno/issues/231
Hello Dynomite will not do a failover of its own. If you are using the Dyno client (https://github.com/Netflix/dyno) (which is a wrapper on top of jedis) it should do the failover for you. Otherwise its up to the client to do the failover. This is by design in dynomite.
Hi there,
We are using dyno client for connecting to our 4 dynomite instances placed on one rack each in a single dc setup. In the case where all the redis are up , the system works fine, but in case of any redis node going down it is not failing over to another node and throwing exception
com.netflix.dyno.connectionpool.exception.FatalConnectionException: FatalConnectionException: [host=Host [hostname=127.0.0.1, ipAddress=null, port=8102, rack: rack-1, datacenter: dc, status: Up, hashtag=null], latency=0(0), attempts=1]redis.clients.jedis.exceptions.JedisDataException: ERR Storage: Datastore refused connection
dyno code :-
public void setUpDyno() {
try {
final List<Host> hosts = new ArrayList<Host>();
hosts.add(new HostBuilder().setHostname("box2")
.setIpAddress("127.0.0.1")
.setPort(8104)
.setRack("rack2")
.setDatacenter("dc").setStatus(Host.Status.Up).createHost());
hosts.add(new HostBuilder().setHostname("box")
.setIpAddress("127.0.0.1")
.setPort(8102)
.setRack("rack")
.setDatacenter("dc").setStatus(Host.Status.Up).createHost());
hosts.add(new HostBuilder().setHostname("box3")
.setIpAddress("127.0.0.1")
.setPort(8106)
.setRack("rack3")
.setDatacenter("dc").setStatus(Host.Status.Up).createHost());
hosts.add(new HostBuilder().setHostname("box4")
.setIpAddress("127.0.0.1")
.setPort(8108)
.setRack("rack4")
.setDatacenter("dc").setStatus(Host.Status.Up).createHost());
final HostSupplier customHostSupplier = new HostSupplier() {
@Override
public List<Host> getHosts() {
return hosts;
}
};
this.hostSuperSupplier = customHostSupplier;
log.info("roxxx {}", new ObjectMapper().writeValueAsString(hostSuperSupplier));
this.dynoClient = new DynoJedisClient.Builder()
.withApplicationName("BEATLE_ON_MY_KNEE")
.withDynomiteClusterName("DYNOMITE_CLUSTER_NAME")
.withHostSupplier(customHostSupplier)
.withCPConfig(getDynoConfig())
.withTokenMapSupplier(testTokenMapSupplier)
.build();
dynoClient.set("kuku", "bandar");
} catch (Exception e ) {
log.error("Error while initialising dyno client", e);
}
}
final String json = "[\n" +
"{\n" +
" \"token\": \"0\",\n" +
" \"hostname\": \"box2\",\n" +
" \"zone\": \"rack2\",\n" +
" \"port\": \"8104\",\n" +
" \"dc\": \"dc\",\n" +
" \"ip\": \"127.0.0.1\"\n" +
"},\n" +
"{\n" +
" \"token\": \"0\",\n" +
" \"hostname\": \"box\",\n" +
" \"zone\": \"rack\",\n" +
" \"port\": \"8102\",\n" +
" \"dc\": \"dc\",\n" +
" \"ip\": \"127.0.0.1\"\n" +
"},\n" +
"{\n" +
" \"token\": \"0\",\n" +
" \"hostname\": \"box3\",\n" +
" \"zone\": \"rack3\",\n" +
" \"port\": \"8106\",\n" +
" \"dc\": \"dc\",\n" +
" \"ip\": \"127.0.0.1\"\n" +
"},\n" +
"{\n" +
" \"token\": \"0\",\n" +
" \"hostname\": \"box4\",\n" +
" \"zone\": \"rack4\",\n" +
" \"port\": \"8108\",\n" +
" \"dc\": \"dc\",\n" +
" \"ip\": \"127.0.0.1\"\n" +
"}]" ;
private TokenMapSupplier testTokenMapSupplier = new AbstractTokenMapSupplier() {
@Override
public String getTopologyJsonPayload(Set<Host> set) {
return json;
}
@Override
public String getTopologyJsonPayload(String hostname) {
return json;
}
};
@Override
public void contextDestroyed(ServletContextEvent servletContextEvent) {
DynoJedisClient dynoClient = (DynoJedisClient) servletContext.getAttribute(DYNO_CLIENT);
if (dynoClient != null) dynoClient.stopClient();
servletContext.removeAttribute(DYNO_CLIENT);
}
private ConnectionPoolConfigurationImpl getDynoConfig() {
ConnectionPoolConfigurationImpl config = new ConnectionPoolConfigurationImpl("config")
.setMaxConnsPerHost(150)
.setMaxFailoverCount(3)
.withHostSupplier(hostSuperSupplier)
.setLoadBalancingStrategy(ConnectionPoolConfiguration.LoadBalancingStrategy.TokenAware)
.setMaxTimeoutWhenExhausted((int) Duration.ofSeconds(10).toMillis())
.setSocketTimeout(12000);
return config;
}
}