担保公司网站建设方案,wordpress 搜索调用,做水果网站需要些什么手续,快速建站公司怎么样单机版 第一步#xff1a;需要安装redis所需的C语言环境#xff0c;若虚拟机联网#xff0c;则执行 yum install gcc-c 第二步#xff1a;redis的源码包上传到linux系统 第三步#xff1a;解压缩redis tar zxf redis的压缩文件 第四步#xff1a;编译 #xff0c;进入…单机版 第一步需要安装redis所需的C语言环境若虚拟机联网则执行 yum install gcc-c 第二步redis的源码包上传到linux系统 第三步解压缩redis tar zxf redis的压缩文件 第四步编译 进入redis源码目录 。make 第五步安装make install PREFIX/路径 第六步前端启动./redis-server这种启动会占用一个终端不推荐 第七步后台启动将redis源码包下的redis.conf 复制到 /bin目录下 cp redis.conf /路径修改redis.conf的daemonize no改为yes代表可以后台启动然后启动./redis-server redis.conf 第八步查看进程 ps aux|grep redis 第九步.关闭redis ./redis-cli shutdown [rootlocalhost bin]# ./redis-cli 默认连接localhost运行在6379端口的redis服务。 [rootlocalhost bin]# ./redis-cli -h 192.168.25.153 -p 6379 -h连接的服务器的地址 -p服务的端口号 关闭redis[rootlocalhost bin]# ./redis-cli shutdown 集群版 Redis集群中至少应该有三个节点。要保证集群的高可用需要每个节点有一个备份机。 Redis集群至少需要6台服务器。 搭建伪分布式。可以使用一台虚拟机运行6个redis实例。需要修改redis的端口号7001-7006 1.1.1. 集群搭建环境 1、使用ruby脚本搭建集群。需要ruby的运行环境。 安装ruby yum install ruby yum install rubygems 2、安装ruby脚本运行使用的包。 [rootlocalhost ~]# gem install redis-3.0.0.gem Successfully installed redis-3.0.0 1 gem installed Installing ri documentation for redis-3.0.0... Installing RDoc documentation for redis-3.0.0... [rootlocalhost ~]# [rootlocalhost ~]# cd redis-3.0.0/src [rootlocalhost src]# ll *.rb -rwxrwxr-x. 1 root root 48141 Apr 1 2015 redis-trib.rb 3.修改端口号和cluster-enabled yes前的注释去掉。 4.然后写一个批处理(开启集群和关闭集群) 开启 cd redis01./redis-server redis.confcd ..cd redis02./redis-server redis.confcd ..cd redis03./redis-server redis.confcd ..cd redis04./redis-server redis.confcd ..cd redis05./redis-server redis.confcd ..cd redis06./redis-server redis.confcd .. chmod x shutdow-all.sh 关闭 [rootlocalhost redis-cluster]# vim shutdow-all.sh redis01/redis-cli -p 7001 shutdown redis01/redis-cli -p 7002 shutdown redis01/redis-cli -p 7003 shutdown redis01/redis-cli -p 7004 shutdown redis01/redis-cli -p 7005 shutdown redis01/redis-cli -p 7006 shutdown [rootlocalhost redis-cluster]# chmod ux shutdow-all.sh 5.将redis-trib.rb文件复制到文件目录下 7.启动集群的命令 ./redis-trib.rb create --replicas 1 192.168.25.175:7001 192.168.25.175:7002 192.168.25.175:7003 192.168.25.175:7004 192.168.25.175:7005 192.168.25.175:7006 然后yes接受这时候会在每个redis实例文件里生成一个node.conf,记录节点信息 转载于:https://www.cnblogs.com/wchxj/p/8209700.html