ImageVerifierCode 换一换
格式:DOCX , 页数:48 ,大小:333.14KB ,
资源ID:20289477      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/20289477.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(redis集群安装部署Word格式.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

redis集群安装部署Word格式.docx

1、redis.7003.conf内容port 7003appendonly.7003.aofcluster-config-file nodes-7003.confredis.7004.conf内容port 7004appendonly.7004.aofcluster-config-file nodes-7004.confredis.7005.conf内容port 7005appendonly.7005.aofcluster-config-file nodes-7005.confredis.7006.conf内容port 7006appendonly.7006.aofcluster-config-

2、file nodes-7006.conf启动服务打开6个CMD命令行工具,切换到C:redis-64.3.0.503目录下,分别输入Redis-server.exe redis.7001.confRedis-server.exe redis.7002.confRedis-server.exe redis.7003.confRedis-server.exe redis.7004.confRedis-server.exe redis.7005.confRedis-server.exe redis.7006.conf启动成功后界面如下3. Ruby安装下载地址:安装界面如下所示安装完成后,打开命令输

3、入ruby v命令检查是否安装成功4. 安装redis的ruby运行库打开命令行输入gem install redis命令5. 下载redis-trib.rb脚本文件redis-trib.rb文件是运行redis集群的脚本库,文件内容如下,可将下面的文件内容拷贝到记事本中另存为redis-trib.rb文件然后将redis-trib.rb拷贝到C:redis-64.3.0.503目录下#!/usr/bin/env ruby# TODO (temporary here, well move this into the Github issues once# redis-trib initial

4、implementation is completed).# - Make sure that if the rehashing fails in the middle redis-trib will try# to recover.# - When redis-trib performs a cluster check, if it detects a slot move in# progress it should prompt the user to continue the move from where it# stopped.# - Gracefully handle Ctrl+C

5、 in move_slot to prompt the user if really stop# while rehashing, and performing the best cleanup possible if the user# forces the quit.# - When doing fix set a global Fix to true, and prompt the user to# fix the problem if automatically fixable every time there is something# to fix. For instance:#

6、1) If there is a node that pretend to receive a slot, or to migrate a# slot, but has no entries in that slot, fix it.# 2) If there is a node having keys in slots that are not owned by it# fix this condition moving the entries in the same node.# 3) Perform more possibly slow tests about the state of

7、the cluster.# 4) When aborted slot migration is detected, fix it.require rubygemsredisClusterHashSlots = 16384defxputs(s) case s0.2 when color=29;1ER31;OK32FA,*33 else color=nil end color = nil if ENVTERM != xterm print 033#colorm if color print s0330mnendclass ClusterNodedef initialize(addr) s = ad

8、dr.split(:) if s.length 1 here, its IPv6, so restore address r = nil info = info:host = ipport = portslots = migrating = importing = replicate = false dirty = false # True if we need to flush slots info into node. friends = def friends friendsdef slotsslotsdefhas_flag?(flag)flags.index(flag)defto_s

9、#info:host:portdef connect(o=) return if rConnecting to node #self:STDOUT.flush begin r = Redis.new(:host =host, :port =port, :timeout = 60) r.ping rescuexputs ERR Sorry, cant connect to node #self exit 1 if o:abortOKdefassert_cluster info = r.infoif !infocluster_enabled | info.to_i = 0ERR Node #sel

10、f is not configured as a cluster node.defassert_empty(r.cluster(info).split(rn).index(cluster_known_nodes:) | (r.infodb0)ERR Node #self is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.defload_info(o=)self.connect nodes = r.cluster

11、(nodesnodes.each|n| # name addr flags role ping_sentping_recvlink_status slots split = n.splitname,addr,flags,master_id,ping_sent,ping_recv,config_epoch,link_status = split0.6 slots = split8.-1 info = :name = name,addr =addr,flags =flags.split(),replicate =master_id,ping_sent =ping_sent.to_i,ping_re

12、cv =ping_recv.to_i,link_status =link_status info:replicate = false if master_id = - if info:flags.index(myself info = info.merge(info)slots.each|s| if s0.0 = if s.index(-) # Migratingslot,dst = s1.-1.split(migratingslot.to_i = dstelsifs.index(-) # Importingslot,src = s1.-1.split(importingslot.to_i =

13、 srcstart,stop = s.split(self.add_slots(start.to_i).(stop.to_i)self.add_slots(s.to_i).(s.to_i) if slots dirty = false r.cluster().each|e|k,v=e.split( k = k.to_symv.chop! if k != :cluster_state infok = v.to_i infok = velsif o:getfriends friends infodefadd_slots(slots)slotss = :new dirty = truedefset_

14、as_replica(node_id)replicate = node_iddefflush_node_config return if !dirty if info:replicatereplicate,info:replicate) # If the cluster did not already joined it is possible that # the slave does not know the master node yet. So on errors # we return ASAP leaving the dirty flag set, to flush the # c

15、onfig later. return new = slots.each|s,val| if val = : new sslotss = trueaddslots,*new)definfo_string # We want to display the hash slots assigned to this node # as ranges, like in:1-5,8-9,20-25,30 # # Note: this could be easily written without side effects, # we use slots just to split the computat

16、ion into steps. # First step: we want an increasing array of integers # for instance: 1,2,3,4,5,8,9,20,21,22,23,24,25,30 slots = info:slots.keys.sort # As we want to aggregate adjacent slots we convert all the # slot integers into ranges (with just one element) # So we have something like 1.1,2.2, .

17、 and so forth.slots.map!|x| x.x # Finally we group ranges with adjacent elements. slots = slots.reduce() |a,b|a.empty? &b.first = (a-1.last)+1a0.-2 + (a-1.first).(b.last) a + b # Now our task is easy, we just convert ranges with just one # element into a number, and a real range into a start-end for

18、mat. # Finally we join the array using the comma as separator. slots = slots.map|x|x.count = 1 ?x.first.to_s :#x.first-#x.last.join( role = self.has_flag?(master) ?MS if self.info:replicate and dirty is = S: #self.info:name #self.to_s#role:name #self.to_sn+ slots:#slots (#self.slots.length slots) #(

19、self.info:flags-).join() is += n replicates #info:replicateelsifself.has_flag?) & self.info:replicasn #info:replicas.length additional replica(s) is # Return a single string representing nodes and associated slots. # TODO: remove slaves from config when slaves will be handled # by Redis Cluster.defget_config_signatureconfig = ).each_line|l| s = l.split slots = s8.-1.select |x| x0.0 ! next if slots.length = 0config 0 and num_args != req_args) | (req_args 0 and num_argsreq_args.abs)ERR Wrong number of arguments for specified sub commanddefadd_node(node) nodes nodedefcluste

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1