<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        SomefunwithRedisClustertesting

        來源:懂視網 責編:小采 時間:2020-11-09 13:10:45
        文檔

        SomefunwithRedisClustertesting

        SomefunwithRedisClustertesting:One of the steps to reach the goal of providing a testable Redis Cluster experience to users within a few weeks, is some serious testing that goes over the usual I'm running 3 nodes in my macbook, it works. Finally this is possible, si
        推薦度:
        導讀SomefunwithRedisClustertesting:One of the steps to reach the goal of providing a testable Redis Cluster experience to users within a few weeks, is some serious testing that goes over the usual I'm running 3 nodes in my macbook, it works. Finally this is possible, si

        One of the steps to reach the goal of providing a "testable" Redis Cluster experience to users within a few weeks, is some serious testing that goes over the usual "I'm running 3 nodes in my macbook, it works". Finally this is possible, si

        One of the steps to reach the goal of providing a "testable" Redis Cluster experience to users within a few weeks, is some serious testing that goes over the usual "I'm running 3 nodes in my macbook, it works". Finally this is possible, since Redis Cluster entered into the "refinements" stage, and most of the system design and implementation is in its final form already.

        In order to perform some testing I assembled an environment like that:

        * Hardware: 6 real computers: 2 macbook pro, 2 macbook air, 1 Linux desktop, 1 Linux tiny laptop called EEEpc running with a single core at 800Mhz.

        * Network: the six nodes were wired to the same network in different ways. Two nodes connected via ethernet, and four over wifi, with different access points. Basically there were three groups. The computers connected with the ethernet had 0.3 milliseconds RTT, other two computers connected with a near access point were at around 5 milliseconds, and another group of two with another access point were not very reliable, sometime some packet went lost, latency spikes at 300-1000 milliseconds.

        During the simulation every computer ran Partitions.tcl (http://github.com/antirez/partitions) in order to simulate network partitions three times per minute, lasting an average of 10 seconds. Redis Cluster was configured to detect a failure after 500 milliseconds, so these settings are able to trigger a number of failover procedures.

        Every computer ran the following:

        Computer 1 and 2: Redis cluster node + Partitions.tcl + 1 client
        Computer 3 to 6: Redis cluster node + Partitions.tcl

        The cluster was configured to have three masters and three slaves in total.

        As client software I ran the cluster consistency test that is shipped with redis-rb-cluster (http://github.com/antirez/redis-rb-cluster), that performs atomic counters increments remembering the value client side, to detect both lost writes and non acknowledged writes that were actually accepted by the cluster.

        I left the simulation running for about 24 hours, however there were moments where the cluster was completely down due to too many nodes being down.

        The bugs
        ===

        The first thing that happened in the simulation was, a big number of crashes of nodes… the simulation was able to trigger bugs that I did not noticed in the past. Also there were obvious mis-behavior due to the fact that one node, the eeepc one, was running a Redis server compiled with a 32 bit target. So in the first part of the simulation I just fixed bugs:

        7a666ac Cluster: set n->slaves to NULL in clusterNodeResetSlaves().
        fda91db Cluster: check link is valid before sending UPDATE.
        f57bb36 Cluster: initialize todo_before_sleep flags to 0.
        c70c0c6 Cluster: use proper type mstime_t for ping delay var.
        7c1cbdc Cluster: use an hardcoded 60 sec timeout in redis-trib connections.
        47815d3 Fixed clearNodeFailureIfNeeded() time type to mstime_t.
        e88e6a6 Cluster: use long long for timestamps in clusterGenNodesDescription().

        The above commits made yesterday are a mix of bugs reported by valgrind (for some part of the simulation there were nodes running over valgrind), crashes, and misbehavior of the 32 bit instance.

        After all the above fixes I left the simulation running for many hours without being able to trigger any crash. Basically the simulation “payed itself” just for this bug fixing activity… more minor bugs were found during the simulation that I’ve yet to fix.

        Behavior under partition
        ===

        One of the important goals of this simulation was to test how Redis Cluster performed under partitions. While Redis Cluster does not feature strong consistency, it is designed in order to minimize write loss under some very common failure modes, and to contain data loss within a given max window under other failure modes.

        To understand how it works and the failure modes is simple because the way Redis Cluster itself works is simple to understand and predict. The system is just composed of different master instances handling a subset of keys each. Every master has from 0 to N replicas. In the specific case of the simulation every master had just one replica.

        The most important aspect regarding safety and consistency of data is the failover procedure, that is executed as follows:

        * A master must be detected as failing, according to the configured “node timeout”. I used 500 milliseconds as node timeout. However a single node cannot start a failover if it just detects a master is down. It must receive acknowledgements from the majority of the master nodes in order to flag the node as failing.
        * Every slave that flagged a node as failing will try to be elected to perform the failover. Here we use the Raft protocol election step, so that only a single slave will be able to get elected for a given epoch. The epoch will be used in order to version the new configuration of the cluster for the set of slots served by the old master.

        Once a slave performs the failover it reclaims the slots served by its master, and propagates the information ASAP. Other nodes that have an old configuration are updated by the cluster at a latter time if they were not reachable when the failover happened.

        Since the replication is asynchronous, and when a master fails we pick a slave that may not have all the master data, there are obvious failure modes where writes are lost, however Redis Cluster try to do things in order to avoid situations where, for example, a client is writing forever to a master that is partitioned away and was already failed over in the majority side.

        So this are the main precautions used by Redis Cluster to limit lost writes:

        1) Not every slave is a candidate for election. If a slaves detects its data is too old, it will not try to get elected. This in practical terms means that the cluster does not recover in the case where none of the slaves of a master are able to talk with the master for a long time, the master fails, the slave are available but have very stale data.
        2) If a master is isolated in the minority side of the cluster, that means, it senses the majority of the other masters are not reachable, it stops accepting writes.

        There are still things to improve in the heuristics Redis Cluster uses to limit data loss, for example currently it does not use the replication offset in order to give an advantage to the slave with the most fresh version of data, but only the “disconnection time” from the master. This will be implemented in the next days.

        However the point was to test how these mechanisms worked in the practice, and also to have a way to measure if further improvements will lead to less data loss.

        So this is the results obtained in this first test:

        * 1000 failovers
        * 8.5 million writes performed by each client
        * The system lost 2000 writes.
        * The system retained 800 not acknowledged writes.

        The amount of lost writes could appears to be extremely low considered the number of failovers performed. However note that the test program ran by the client was conceived to write to different keys so it was very easy when partitioned into a minority of masters for the client to hit an hash slot not served by the reachable masters. This resulted into waiting for the timeout to occur before of the next write. However writing to multiple keys is actually the most common case of real clients.

        Impressions
        ===

        Running this test was pretty interesting from the point of view of the paradigm shift from Redis to Redis Cluster.
        When I started the test there were the bugs mentioned above still to fix, so instances crashed from time to time, still the client was almost always able to write (unless there was a partition that resulted into the cluster not being available). This is an obvious result of running a cluster, but as I’m used to see a different availability patter with what is currently the norm with Redis, this was pretty interesting to touch first hand.

        Another positive result was that the system worked as expected in many ways, for example the nodes always agreed about the configuration when the partitions healed, there was never a time in which I saw no partitions and the client not able to reach all the hash slots and reporting errors.

        The failure detection appeared to be robust enough, especially the computer connected with a very high latency network, from time to time appeared to be down to a single node, but that was not enough to get the agreement from the other nodes, avoiding a number of useless failover procedures.

        At the same time I noticed a number of little issues that must be fixed. For example at some point there was a power outage and the router rebooted, causing many nodes to change address. There is a built-in feature in Redis Cluster so that the cluster reconfigures itself automatically with the new addresses as long as there is a node that did not changed address, assuming every node can reach it.
        This system worked only half-way, and I noticed that indeed the implementation was not yet complete.

        Future work
        ===

        This is just an initial test, and this and other tests will require to be the norm in the process of testing Redis Cluster.
        The first step will be to create a Redis Cluster testing environment that will be shipped with the system and that the user can run, so it is possible that the cluster will be able to support a feature to simulate partitions easily.

        Another thing that is worthwhile with the current test setup using partitions.tcl is the ability of the test client, and of Partitions.tcl itself, to log events. For example with a log of partitions and data loss events that has accurate enough timestamps it is possible to correlate data loss events with partitions setups.

        If you are interested in playing with Redis Cluster you can follow the Redis Cluster tutorial here: http://redis.io/topics/cluster-tutorial Comments

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        SomefunwithRedisClustertesting

        SomefunwithRedisClustertesting:One of the steps to reach the goal of providing a testable Redis Cluster experience to users within a few weeks, is some serious testing that goes over the usual I'm running 3 nodes in my macbook, it works. Finally this is possible, si
        推薦度:
        標簽: fun te test
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 97国免费在线视频| 一级一看免费完整版毛片| 久久w5ww成w人免费| 好看的电影网站亚洲一区 | 亚洲国产最大av| 一个人免费观看www视频在线| 亚洲欧洲国产经精品香蕉网| xxxx日本免费| 亚洲AV无码乱码麻豆精品国产| 无码乱肉视频免费大全合集| 亚洲免费福利在线视频| 四虎成人免费影院网址| 天天综合亚洲色在线精品| 亚洲?v无码国产在丝袜线观看| 一个人看的免费观看日本视频www| 中文字幕精品无码亚洲字 | 一级毛片高清免费播放| 亚洲伊人久久精品影院| 久久久久免费看黄a级试看| 亚洲高清资源在线观看| 成人免费视频小说| 深夜特黄a级毛片免费播放| 亚洲一区二区三区在线观看精品中文| 9i9精品国产免费久久| 久久亚洲精品成人AV| 日韩免费a级在线观看| 一级黄色免费毛片| 亚洲av日韩av无码黑人| 最近中文字幕mv免费高清视频7 | 永久免费av无码网站韩国毛片| 亚洲欧美日韩久久精品| 亚洲区日韩区无码区| 91人成网站色www免费下载| 亚洲成AV人影片在线观看| 在线精品亚洲一区二区三区| 亚洲一区二区三区免费视频| 日韩毛片免费一二三| 亚洲美女色在线欧洲美女| 国产又粗又猛又爽又黄的免费视频| 中国好声音第二季免费播放| 精品亚洲成A人无码成A在线观看|