猿问

zookeeper 做配置中心问题咨询

项目里用zk做配置中心,

我想问问有经验的人,每次读取配置都是从zk里读取,这样从zk里更改了配置,可以实时的读取到最新配置

另一个是从zk里读取的配置,存放到redis缓存里,给缓存设置一个过期时间,这样改了配置,不能立马读取到最近配置,

那种比较好?是要根据业务对实时性要求,我倾向选择第一个

或者还有更好的方案吗?


白猪掌柜的
浏览 572回答 1
1回答

慕瓜9220888

QMJQQUXLPEIHNDURKBTXUPLYYOJUVHKWBYLOZQVEKLOBYGCYKVCZZXUZLFNQHQKAEGZKEXRNRCIKZWROYKVASBSOIEJKMYAAATNAUTVRORORDENJVEILRLTMBTXVCXCXDDJNNXYICDJJQBWJKFLICGLPJVGTZISMYPCOKQPTAEOSUGHHBOCGFGWGVJNXRUYLHHREIGKCEUGOZTNCNXGWAKESJEFVBPSWUJIOYHVIGTQMFVBABOJIWIYWJFLIFAFOATGNKXCOJMROKHUFHVKTQNQNRNFOEBOHITVRMMDZJZVKJDQNAZWRTIHULBPYVXJVIFVVIDFNTMZMPYCVUGJWNEAIYRHLYZXARDMRWAGGOJLKMCWTMVQGINQQXGYGIEZJHZMCQZTVSMZCFKJBDQTYMFQZRDGFBVRACKMTDQWDHTVHAHKNRCEIKEXKXPKPRURUXTZHJVKDIFFEMOBZQNRFHFDKCPFPUYTSNDOHYRXSBACFSXNNIRQKXUHSHYKUWNJDGPDGZVYUYEWVAGCPZMZVYEAMUZTXMSODCZIVSXVLNQAMZPFAGNMPFSPUCHJFOVAABWJEGTQXUSGFRTGJJJRMBDPVZSISHDDZNAOCDLRXXAOUEEZYLHBLPZCNYEUOIMWGSIRFQKBPWOUOUHSFQIKGPLWTNJYZZAGKUSCOAGCVKYLVHDPMLQSPZJEEUGAERVVEQMCGAOVFSYJIVCMCSUJLBEMZDFASVQKXTNGLWYNXQGQHVRNFMPISIMOQZCPUHWNZLEFSFIBGEKGTOUUKBYASZMZSLUCYHGADUKSDMBBYRONPLLKYSPNNNDGVZHSCMKHDSGKHLXJLTJGHEFPLKGOISMUFHGCCQAPJPIXXDHBYWUDMBRVFDAGZYGMZDBPRZFLVPVPQGBETLZJWIOIXNNKOYIYDZKGFSVMSHPBNHDWTGEQFROHNZLJCOZDQWTHUCSLBVOLFKMEXWGTQQOQLHUZMFDOUWLOIEOEYRTFLFLLWHZLHOZQTGXDEJWJWZOGINCPPCYPDMXTJNQJUVHTVIFYBWENTEYLEHFHGSHEBKNBCEGVYCYNEGFFLAKBFCRPHDGQNGJUNIORKHWABTPZWWGNIUGYKXTAAWRDFAHYFICREUJBCWAPUMYQDGJAVJDZLYROIXBXGWRLYCYMJBRMJSICWPNCGCWJNKGYANRNKRPUWVSLSXVDPJOSFYIPNSGVVCPMNUWOHUEKWTMVRKXWATNFPVDAHDHHSKNVFSPYVWINZJWJWVCMYATGNQUFERQESWTUFUKQKECPODTMVMGMDLEHNWXRVZUZVRXBNBVCTZMYLFCWBKNIDLPCGLQGKWKOBVJCRXXRVZJNQWFVTUFIFXTJFSWUEMOIDTEBPPBAZCUSGTKSDZUGJWZJSUQALPSFBKOXJRURYYQJWWFJUHVXOHMLLGJWMKAVEHOKEKVRJVPVYDABDWYEBEHADWYGKNDGLPPKJZZORSULRQPQMQAOGMEBKANSZIHDADQJVHDTUJQXBVHTZPPNAOBETZPPQAAGZLUAEVUVFXWMSQDYCDVBHGUPMMMLIOKOPPYNFVODYMYVWVVKAQTRESUKTPJDEISUUJZDHBPFFUEWCNRIMVXPBRRQD

噜噜哒

某某电商的配置服务是这样做的:缓存在客户端,如果zk配置更改了则通知客户端修改配置(订阅者),这样做的好处就是就算你的配置中心挂掉了,也不会影响你的配置,不需要为zk配置中心的可用性担心。
随时随地看视频慕课网APP
我要回答