金蝶云星空K3CloudV7.2分布式缓存使用说明书

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

金蝶云星空K3CloudV7.2分布式缓存使用说明书
金蝶云星空
分布式缓存使用说明书
修改记录
Ver. No 发版日期编制人批准人修改的章节号V1.02017/12/08 刘兵赖碧云初始版本
V1.22018/01/03 刘兵赖碧云 6.1.2
V1.3 2018/02/24 刘兵赖碧云 6.1
目录
1.概述 (3)
1.1.目的 (3)
1.2.范围 (3)
1.3.适用对象 (3)
1.4.参考资料 (3)
2.问题与解决策略 (3)
3.目标和约束 (3)
4.部署Redis服务 (4)
4.1.安装服务--service-install(安装必须的步骤) (4)
4.2.卸载服务--service-uninstall (4)
4.3.启动服务--service-start(安装必须的步骤) (4)
4.4.停止服务--service-stop (5)
4.5.服务配置修改(服务名和端口) (5)
4.6.Redis-cli配置(如果4.1按照2,3小点进行了修改,此节配置可以忽略) (5)
5.Redis配置文件修改 (5)
6.Redis缓存代码示例 (6)
6.1.1.写缓存和读缓存 (6)
6.1.2.错误的读写缓存 (7)
7.附录 (8)
1. 概述
1.1. 目的
为系统集群及分布式应用提供基础缓存服务。

1.2. 范围
适用版本:V6.2和后续版本
1.3. 适用对象
本文档适用于:
开发工程师:部署和开发指导。

实施人员:部署指导。

1.4. 参考资料
Redis相关资料
2. 问题与解决策略
愿景关注点描述与示例
3. 目标和约束
目标:
提供单据和基础数据的分布式缓存支持;
提供系统参数、单据参数、用户参数等数据的分布式缓存支持;
提供分布式缓存接口为其他类型数据提供分布式缓存支持
约束:
分布式缓存开关并非默认开启;
并非所有数据都使用了分布式缓存。

4. 部署Redis服务
首先进入到产品安装目录K3Cloud/website/bin,将以下文件单独拷贝到缓存服务器,新建一目录,例如Redis,拷贝文件如下:EventLog.dll,redis.windows.conf,redis.windows-service.conf,redis-benchmark.exe,redis-check-aof.exe,redis-cli.exe,redis-server.exe然后以管理员身份进入dos 系统,将目录定位到Redis目录。

如未说明,后续命令都在该目录下执行。

4.1. 安装服务--service-install(安装必须的步骤)
This must be the first argument on the redis-server
command line. Arguments after this are passed in the order they occur to Redis when the service is launched. The service will be configured as Autostart and will be launched as "NT AUTHORITY\NetworkService". Upon successful installation a success message will be displayed and Redis will exit.
This command does not start the service.
For instance:
redis-server --service-install redis.windows.conf --loglevel verbose
默认配置的地址是本地地址127.0.0.1 端口是6379,如果多应用部署分布式缓存,需要在启动服务前先修改缓存服务器配置文件中的地址为具体的IP。

1)打开配置文件,找到bind 127.0.0.1,修改IP为具体的IP地址,例如:bind 172.17.2.100
2)打开配置文件,找到protected-mode yes 修改为protected-mode no
redis缓存服务和k3cloud不在一台服务器时,需要此项设置
3)打开配置文件,找到stop-writes-on-bgsave-error no 修改为stop-writes-on-bgsave-error no 强制停止快照导致不能持久化错误处理
4.2. 卸载服务--service-uninstall
This will remove the Redis service configuration information from the registry. Upon successful uninstallation a success message will be displayed and Redis will exit.
This does command not stop the service.
For instance:
redis-server --service-uninstall
4.3. 启动服务--service-start(安装必须的步骤)
This will start the Redis service. Upon successful start, a success message will be displayed and Redis will
begin running.
For instance:
redis-server --service-start
4.4. 停止服务--service-stop
This will stop the Redis service. Upon successful termination a success message will be displayed and Redis will exit.
For instance:
redis-server --service-stop
4.5. 服务配置修改(服务名和端口)
This optional argument may be used with any of the preceding commands to set the name of the installed service. This argument should follow the service-install, service-start, service-stop or service-uninstall commands, and precede any arguments to be passed to Redis via the service-install command.
The following would install and start three separate instances of Redis as a service:
redis-server --service-install --service-name redisService1 --port 10001
redis-server --service-start --service-name redisService1
4.6. Redis-cli配置(如果4.1按照2,3小点进行了修改,此节配置可以忽略)
使用redis-cli.exe进行配置时,需要先双击打开redis-server.exe (打开前如果之前已经启动了服务,先停止)
打开redis-server后,再双击打开redis-cli.exe在窗口依次输入以下配置指令:
1)config set protected-mode no
redis缓存服务和k3cloud不在一台服务器时,需要此项设置
2)config set stop-writes-on-bgsave-error no
强制停止快照导致不能持久化错误处理
5.Redis配置文件修改
在金蝶云星空website/app_data/KCache.config文件中:。

相关文档
最新文档