31
Distributed Cache Service User Guide Issue 03 Date 2017-04-18 HUAWEI TECHNOLOGIES CO., LTD.

User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

  • Upload
    hacong

  • View
    215

  • Download
    2

Embed Size (px)

Citation preview

Page 1: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

Distributed Cache Service

User Guide

Issue 03

Date 2017-04-18

HUAWEI TECHNOLOGIES CO., LTD.

Page 2: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

Copyright © Huawei Technologies Co., Ltd. 2017. All rights reserved.No part of this document may be reproduced or transmitted in any form or by any means without prior writtenconsent of Huawei Technologies Co., Ltd. Trademarks and Permissions

and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.All other trademarks and trade names mentioned in this document are the property of their respectiveholders. NoticeThe purchased products, services and features are stipulated by the contract made between Huawei and thecustomer. All or part of the products, services and features described in this document may not be within thepurchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information,and recommendations in this document are provided "AS IS" without warranties, guarantees orrepresentations of any kind, either express or implied.

The information in this document is subject to change without notice. Every effort has been made in thepreparation of this document to ensure accuracy of the contents, but all statements, information, andrecommendations in this document do not constitute a warranty of any kind, express or implied.

Huawei Technologies Co., Ltd.Address: Huawei Industrial Base

Bantian, LonggangShenzhen 518129People's Republic of China

Website: http://www.huawei.com

Email: [email protected]

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

i

Page 3: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

Contents

1 Introduction.................................................................................................................................... 11.1 DCS................................................................................................................................................................................ 21.2 Application Scenarios.....................................................................................................................................................21.3 Advantages..................................................................................................................................................................... 31.4 Compatibility with Redis Commands.............................................................................................................................31.5 DCS Instance Specifications.......................................................................................................................................... 41.6 Accessing DCS............................................................................................................................................................... 51.6.1 How to Access DCS.................................................................................................................................................... 51.6.2 Related Services.......................................................................................................................................................... 6

2 Getting Started............................................................................................................................. 102.1 Creating a DCS Instance...............................................................................................................................................112.2 Accessing a DCS Instance............................................................................................................................................132.3 Viewing Details of a DCS Instance.............................................................................................................................. 14

3 Operation Guide..........................................................................................................................173.1 Configuring Redis-Specific Parameters....................................................................................................................... 183.2 Stopping DCS Instances............................................................................................................................................... 203.3 Starting DCS Instances.................................................................................................................................................203.4 Restarting DCS Instances............................................................................................................................................. 213.5 Deleting a Single DCS Instance................................................................................................................................... 223.6 Change Instance Passwords..........................................................................................................................................23

4 FAQs...............................................................................................................................................244.1 Does DCS Support Common Redis Clients Such as Jedis?......................................................................................... 254.2 Should I Install Redis If I Already Have a DCS Instance?...........................................................................................254.3 Does Standby Cache Node Remain Synchronized With Master Cache Node?........................................................... 254.4 Does DCS Support Data Persistence?.......................................................................................................................... 254.5 Can DCS Service Be Accessed from Public Networks?.............................................................................................. 254.6 Can I Modify Configuration Parameters of DCS Instances?....................................................................................... 254.7 Can I Recover Data from Deleted DCS Instances?...................................................................................................... 264.8 What Is the Default Data Eviction Policy?...................................................................................................................264.9 What Should I Do If the Connection Between My Redis Client and DCS Instance Times Out?................................ 26

A Change History........................................................................................................................... 28

Distributed Cache ServiceUser Guide Contents

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

ii

Page 4: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

1 Introduction

1.1 DCS

1.2 Application Scenarios

1.3 Advantages

1.4 Compatibility with Redis Commands

1.5 DCS Instance Specifications

1.6 Accessing DCS

Distributed Cache ServiceUser Guide 1 Introduction

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

1

Page 5: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

1.1 DCSThe Distributed Cache Service (DCS) is an online distributed in-memory cache service thatoffers reliability, scalability, off-the-shelf availability, and ease of management. DCS makes iteasy to deploy, operate, and scale an in-memory data cache in the cloud.

The cache engine currently supported is Redis 3.0.7. Redis is an open-source, in-memory, log-structured key-value data store. It is written in ANSI C. It is networked, in-memory, andachieves persistence. For more information about Redis, visit https://redis.io/.

The clients that access DCS instances must be installed on Elastic Cloud Servers (ECSs).

Figure 1-1 Client access to DCS instances

NOTE

Like clients, DCS instances are run on ECSs. A client and the DCS instances it attempts to access mustbelong to the same virtual private cloud (VPC), and security group.

DCS supports two types of DCS instances:

l Single-nodeEach DCS instance is run on only one cache node. Single-node DCS instances areinexpensive and usually used in development environments without strict reliabilityrequirements.

l Master/standby-nodeMaster/standby-node DCS instances provide higher availability than single-node DCSinstances. Features of master/standby-node DCS instances include:– Each DCS instance is run on two cache nodes (one master and one standby).– Only the master cache node provides data read/write service. The standby cache

node replicates data synchronously from the master cache node.– The standby cache node takes over automatically if the master fails.

1.2 Application ScenariosFor e-commerce websites, video websites, game applications, and other read-heavy business,it is essential to acquire data fast. The primary purpose of DCS is to provide fast yetinexpensive access to data. With DCS, you can retrieve data from fast, in-memory data storesinstead of relying entirely on slower disk-based databases. DCS instances are also fully

Distributed Cache ServiceUser Guide 1 Introduction

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

2

Page 6: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

managed. You no longer need to perform management tasks such as hardware provisioning,software patching, monitoring, and failure recovery. Consider using DCS when you need tocache the following data:

l Web pagesCaching the content of web pages can improve website access performance. The cachedcontent includes static data such as Hypertext Markup Language (HTML) pages,Cascading Style Sheets (CSS), and images.

l StatusDCS provides quick and simple querying of session status and application scaling status,which makes it easy to share status information.

l Application objectsDCS serves as a level-2 cache at the service layer and provides data storage and accessfor external entities. Storing frequently requested data into DCS instances can ease theload off databases and reduce access latency.

l EventsDCS provides continuous event query so streams of events can be processed as theyoccur.

1.3 AdvantagesThe advantages of DCS include:

l Off-the-shelf availabilityYou can create DCS instances with just a few clicks on the DCS console or byapplication programming interface (API) calls. DCS responds to instance creationcommands without requiring you to deal with complex underlying software andhardware.

l A wide range of DCS instance specificationsDCS instance specifications range from 1 GB to 64 GB, increasing the flexibility of DCSservice.

l Data persistenceData persistence is provided for DCS instances running on master/standby nodes. Thisensures both data reliability and data write/read performance.

l Ease of maintenanceYou can create, start, stop, restart, and delete DCS instances with just a few clicks on theDCS console. DCS continuously monitors and maintains DCS instances so that you canfocus on higher-value application development. Service monitoring metrics include keys,the number of client connections, and processed commands. System monitoring metricsinclude memory usage, CPU usage, and network usage.

1.4 Compatibility with Redis CommandsCurrently, DCS is built on the Redis engine and supports a majority of Redis commands. Anyclients that support Redis can access DCS. For security purposes, certain Redis commands arenot allowed in DCS. For more information about Redis commands, visit http://redis.io/commands.

Distributed Cache ServiceUser Guide 1 Introduction

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

3

Page 7: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

NOTE

It takes a long time to run certain commands such as flushall. While running such commands, DCSinstances may not respond to other commands and change to the Faulty state. However, after suchcommands are executed, DCS instances exit the Faulty state.

Table 1-1 Unallowed Redis commands

CommandType

Commands

Keys MIGRATE

Script EVAL, EVALSHA, SCRIPT EXISTS, SCRIPT FLUSH, SCRIPTKILL, SCRIPT LOAD

Server SLOWLOG, SLAVEOF, SHUTDOWN, SAVE, ROLE, MONITOR,LASTSAVE, DEBUG SEGFAULT, DEBUG OBJECT, CONFIG SET,CONFIG REWRITE, CONFIG RESETSTAT, CONFIG GET,COMMAND INFO, COMMAND GETKEYS, COMMAND COUNT,COMMAND, CLIENT SETNAME, CLIENT LIST, CLIENT KILL,CLIENT GETNAME, BGSAVE, BGREWRITEAOF

CAUTIONDCS cannot control behavior of Redis command line interface (redis-cli) and other Redisclients. For example, DCS cannot stop redis-cli from returning "(error) ERR unknowncommand" when running the unallowed commands. DCS also cannot prevent redis-cli fromkeeping the monitor command in the waiting state after this command is finished.

1.5 DCS Instance SpecificationsFor each single-node DCS instance, the available memory is slightly less than the totalmemory because a certain amount of memory is reserved for system overhead.

Table 1-2 Specifications of single-node DCS instances

TotalMemory(GB)

AvailableMemory (GB)

Maximum Numberof AllowedConnections

Maximum IntranetBandwidth (Mbit/s)

1 0.45 300 90

2 1.5 600 128

4 3.2 1200 192

8 6.8 2500 192

Distributed Cache ServiceUser Guide 1 Introduction

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

4

Page 8: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

TotalMemory(GB)

AvailableMemory (GB)

Maximum Numberof AllowedConnections

Maximum IntranetBandwidth (Mbit/s)

16 13.6 4000 256

32 27.2 7000 256

64 58.2 12000 384

Master/standby-node DCS instances require a large amount of memory reserved for datapersistence. Specifically, the available memory of a master/standby-node DCS instance is50% less than available memory of the single-node DCS instance with the same total memory.

Table 1-3 Specifications of master/standby-node DCS instances

Total Memory(GB)

Actual AvailableMemory (GB)

MaximumNumber ofAllowedConnections

Maximum IntranetBandwidth (Mbit/s)

1 0.22 300 90

2 0.75 600 128

4 1.6 1200 192

8 3.4 2500 192

16 6.8 4000 256

32 13.6 7000 256

64 29.1 12000 384

1.6 Accessing DCS

1.6.1 How to Access DCSThere are two ways to access DCS:

l By using the management consoleThe public cloud provides a web-based management console. If you have created anaccount on the management console, choose Database > Distributed Cache Service onthe homepage after login to launch the DCS console. On the DCS console, you cancreate, start, stop, restart, delete, and change passwords for DCS instances.

l By using APIsIf you want to integrate DCS into a third-party system for secondary development, useAPIs to access DCS. For more information about APIs, see the Distributed CacheService API Reference.

Distributed Cache ServiceUser Guide 1 Introduction

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

5

Page 9: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

1.6.2 Related Servicesl Virtual Private Cloud (VPC)

DCS instances run in VPCs and use the IP addresses and bandwidths of VPCs. Securitygroups in VPCs control access to DCS instances.

l Elastic Cloud Server (ECS)After you create DCS instances, you can connect to them through elastic cloud servers.

l Cloud Eye (CES)CES is a secure, scalable monitoring platform in the public cloud. It monitors DCSservice metrics and sends notifications whenever an alarm or event occurs.

Table 1-4 DCS monitoring metrics displayed on CES console

Metric Description Value Range MonitoredObject

CPU Usage CPU usage of monitoredobjects.

0% to 100% ECS

Memory Usage Memory usage of monitoredobjects.

0% to 100% ECS

Network InputThroughput

Inbound throughput persecond on a port.

≥ 0 bytes/s ECS

NetworkOutputThroughput

Outbound throughput persecond on a port.

≥ 0 bytes/s ECS

ConnectedClients

The number of connectedclients, excluding standbynodes.

≥ 0 DCS

Client LongestOutput List

Longest output list among allthe connections to a client.

≥ 0 DCS

Client BiggestInput Buf

Maximum input data lengthamong all the connections to aclient.

≥ 0 bytes/s DCS

Blocked Clients The number of clients that aresuspended by blockoperations, such as BLPOP,BRPOP, and BRPOPLPUSHoperations.

≥ 0 DCS

Used Memory Amount of memory used byRedis.

≥ 0 bytes/s DCS

Distributed Cache ServiceUser Guide 1 Introduction

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

6

Page 10: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

Metric Description Value Range MonitoredObject

Used MemoryRSS

Amount of RSS memory thatis used by Redis and is inRAM. It includes all stackand heap memory but doesnot include the memory that isswapped out.

≥ 0 bytes/s DCS

Used MemoryPeak

Peak memory usage since theRedis server starts.

≥ 0 bytes/s DCS

Used MemoryLua

Amount of memory used bythe Lua engine.

≥ 0 bytes/s DCS

MemoryFragmentationRatio

Current memoryfragmentation ratio. Its valueis the same as that of UsedMemory RSS and UsedMemory. If the value of UsedMemory Peak is much greaterthan the value of UsedMemory, the reference valueof this parameter decreases.

≥ 0 DCS

TotalConnectionsReceived

Total number of connectionsthat the Redis server hasreceived since it is started.

≥ 0 DCS

TotalCommandsProcessed

Total number of commandsthat the Redis server hasprocessed since it is started.

≥ 0 DCS

InstantaneousOps Per Second

The number of commandsprocessed per second.

≥ 0 DCS

Total Net InputBytes

Total number of bytes that theRedis server has receivedsince it is started.

≥ 0 bytes/s DCS

Total NetOutput Bytes

Total number of bytes that theRedis server has sent since itis started.

≥ 0 bytes/s DCS

InstantaneousInput Kbps

Instantaneous input traffic. ≥ 0 Kbit/s DCS

InstantaneousOutput Kbps

Instantaneous output traffic. ≥ 0 Kbit/s DCS

RejectedConnections

The number of connectionsthat have exceeded maxclientsand been rejected by theRedis server since it started.

≥ 0 DCS

Distributed Cache ServiceUser Guide 1 Introduction

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

7

Page 11: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

Metric Description Value Range MonitoredObject

Sync Full Total number of fullsynchronizations since theRedis server is started.

≥ 0 DCS

Sync PartialOK

Total number of incrementalsynchronizations since theRedis server is started.

≥ 0 DCS

Sync Partial Err Total number of failedincremental synchronizationssince the Redis server isstarted.

≥ 0 DCS

Expired Keys Total number of keys thathave expired since the Redisserver is started.

≥ 0 DCS

Evicted Keys The number of keys that havebeen evicted due toinsufficient memory since theRedis server is started.

≥ 0 DCS

Keyspace Hits Total number of query hits inthe master dictionary sincethe Redis server is started.

≥ 0 DCS

KeyspaceMisses

Total number of query missesin the master dictionary sincethe Redis server is started.

≥ 0 DCS

PubSubChannels

The number of Pub/Subchannels.

≥ 0 DCS

PubSubPatterns

The number of Pub/Subpatterns.

≥ 0 DCS

Aof CurrentSize

AOF file size. ≥ 0 DCS

Latest Forkusec

Last fork time. ≥ 0 ms DCS

l Cloud Trace Service (CTS)

CTS provides you with a history of operations performed on cloud service resources.With CTS, you can query, audit, and backtrack operations. The traces include operationtime, resource objects, resource IDs, requestors' IP addresses, resource operationrequests, and responses.Currently, CTS records the following operations on DCS instances:– Create, start, stop, restart, and delete DCS instances– Configure Redis-specific parameters

Distributed Cache ServiceUser Guide 1 Introduction

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

8

Page 12: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

– Change instance passwords– Modify basic information of DCS instances

l Identity and Access Management (IAM)IAM service authenticates access to DCS.

Distributed Cache ServiceUser Guide 1 Introduction

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

9

Page 13: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

2 Getting Started

2.1 Creating a DCS Instance

2.2 Accessing a DCS Instance

2.3 Viewing Details of a DCS Instance

Distributed Cache ServiceUser Guide 2 Getting Started

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

10

Page 14: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

2.1 Creating a DCS Instance

ScenarioDCS can be used only after DCS instances are created. Currently, the DCS supports two typesof DCS instances: single-node and master/standby-node.

CAUTIONDCS is not meant to transmit or store sensitive data. The purpose, scope, processing method,and time limits of data processed by DCS must comply with local laws and regulations.Encrypt any sensitive data before transmitting or storing it.

PrerequisitesThe VPC where DCS instances to be created will run is available. Security groups andsubnets have been configured for the VPC.

For details on how to create VPCs, security groups, and subnets, see the Virtual Private CloudUser Guide.

If the instance type is Master/standby, the security groups in the selected VPC must haveboth outbound and inbound rules with protocols set to ANY.

Procedure

Step 1 Log in to the management console.

Step 2 On the homepage of management console, click and choose Database > DistributedCache Service to launch the DCS console.

Step 3 In the navigation pane of DCS console, choose Cache Manager.

Step 4 On the Cache Manager page, click the Create Cache Instance button.

The Specify Details tab page of Create Cache Instance page is then displayed.

Step 5 On the Specify Details tab page, specify DCS instance parameters, such as name, availabilityzone (AZ), VPC, security group, and network interface card (NIC).

Distributed Cache ServiceUser Guide 2 Getting Started

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

11

Page 15: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

Table 2-1 DCS instance parameters

Parameter Description

Name Name of the new DCS instance. Different DCS instances can havethe same instance name.A DCS instance name cannot be left unspecified and must:l Be a string of 4 to 64 characters starting with an uppercase or

lowercase letter.l Contain uppercase or lowercase letters, digits, and/or hyphens (-).

Description Description of the new DCS instance.

AZ Availability zone (AZ) in which the new DCS instance resides.

Cache Engine Type of the cache engine. Currently, only the Redis cache engine issupported.

Engine Version Version of the cache engine. Currently, only Redis 3.0.7 issupported.

Instance Type Type of the DCS instance being created. Currently, two types ofDCS instances are supported: single-node and master/standby-node.

InstanceSpecifications

Specifications (memory space) of the new DCS instance.Possible values: 1, 2, 4, 8, 16, 32, or 64 GB.By default, each tenant can create a maximum of five DCS instancesand use a maximum of 400 GB memory.If more memory is required, click Increase Quota below the DCSSpecifications field. The Work Order Management page is thendisplayed. On this page, fill in the quota application form and clickSubmit.

VPC VPC in which the new DCS instance resides.Click View VPC to show more details of the selected VPC,including security group rules.

Security Group Security group that controls access to the new DCS instance.

Subnet Name and IP address range of the subnet in which the new DCSinstance resides.

Password Password required for accessing the new DCS instance.Passwords cannot be left unspecified. They must:l Be 8 to 26 characters in lengthl Fewer than three consecutive identical charactersl Contain at least three of the following character types: lowercase

letters, uppercase letters, digits, and special characters !@$%^-_=+[{}]:,./?

NOTEKeep passwords secure and change them regularly.

Distributed Cache ServiceUser Guide 2 Getting Started

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

12

Page 16: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

Step 6 On the Specify Details tab page, click Apply Now.

The Confirm Specifications tab page is then displayed, providing information about the newDCS instance, including instance name, cache engine version, and instance specifications.

Step 7 On the Confirm Specifications tab page, click Submit.

It takes about 5 to 15 minutes to create a DCS instance. After a DCS instance is successfullycreated, it enters the Running state by default. The Cache Manager page displays details ofeach created DCS instance. For details, see 2.3 Viewing Details of a DCS Instance.

NOTE

If a DCS instance does not enter the Running state after it is created, follow the guidelines provided in3.5 Deleting a Single DCS Instance to delete this instance and create it again. If the re-created DCSinstance is still not in the Running state, contact customer service.

----End

2.2 Accessing a DCS InstanceYou can access the created DCS instances through your Redis client.

DCS service can work with multiple types of Redis clients. The redis-cli is used as anexample Redis client. For details about how to use other Redis clients, visit https://redis.io/clients.

Prerequisitesl The DCS instance you want to use is in the Running state.l An ECS has been created to serve as your Redis client.

For details about how to create ECSs, see the Elastic Cloud Server User Guide.l The GNU Compiler Collection (GCC) has been installed on the ECS that serves as your

Redis client.

NOTE

The ECS that serves as your Redis client and the DCS instance that your Redis client will access mustreside in the same VPC, belong to the same security group, and have network connectivity betweenthem.

Procedure

Step 1 Log in to the management console.

Step 2 On the homepage of management console, click and choose Database > DistributedCache Service to launch the DCS console.

Step 3 In the navigation pane of DCS console, choose Cache Manager.

Step 4 On the Cache Manager page, click the name of the DCS instance you want to use. A pagewith details of the DCS instance is then displayed. On the Summary tab page of instancedetails page, view the access address (IP address:port number) of the DCS instance.

Step 5 Access the selected DCS instance.

Distributed Cache ServiceUser Guide 2 Getting Started

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

13

Page 17: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

1. Download the source code package of your Redis client from http://download.redis.io/releases/redis-3.0.7.tar.gz.

2. Upload the source code package of your Redis client to the ECS that serves as yourRedis client.

3. Log in to the ECS that serves as your Redis client.4. Run the following command to decompress the redis-3.0.7 directory from the source

code package of your Redis client:tar -xzf redis-3.0.7.tar.gz

5. Run the following commands to go to the redis-3.0.7 directory and compile source codeof your Redis client:cd redis-3.0.7make

6. Run the following commands to access the selected DCS instance:cd src./redis-cli -h 192.168.0.148 -p 6379In the second command:– 192.168.0.148 is an example IP address of DCS instance.– 6379 is an example port number of DCS instance.

7. On Redis-cli, run the following command to authenticate access to the selected DCSinstance:auth <password>In this command, <password>indicates the password used for login to the selected DCSinstance. This password is user-defined at the time of DCS instance creation.If information similar to the following is displayed, access to the selected DCS instanceis authenticated, and you can start to perform read/write operations on the selected DCSinstance:#redis-cli -h 192.168.0.148 -p 6379redis 192.168.0.148:6379> auth ******OKredis 192.168.0.148:6379>

----End

2.3 Viewing Details of a DCS Instance

Scenario

This section describes how to view details of a DCS instance through the DCS console.

Prerequisites

The DCS instance you want to view has been created.

Procedure

Step 1 Log in to the management console.

Distributed Cache ServiceUser Guide 2 Getting Started

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

14

Page 18: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

Step 2 On the homepage of management console, click and choose Database > DistributedCache Service to launch the DCS console.

Step 3 In the navigation pane of DCS console, choose Cache Manager.

Step 4 On the Cache Manager page, filter DCS instances by instance status and/or name to find thedesired DCS instance.

Table 2-2 DCS instance statuses

State Description

Creating DCS instances enter the Creating state while they are being created.

CreationFailure

The DCS instance has failed to be created.

Running The DCS instance is running properly.Only DCS instances in the Running state can provide in-memory cacheservice.

Faulty The DCS instance is not running properly.

Starting The DCS instance is being started.

Restarting The DCS instance is being restarted.

Stopping The DCS instance is being stopped.

Stopped The DCS instance has been stopped gracefully.DCS instances in the Stopped state cease to provide in-memory cache service.

Deleting The DCS instance is being deleted.

Step 5 On the DCS instance list, click on the name of the selected DCS instance to display moredetails about the DCS instance.

Table 2-3 Parameters on the DCS instance details page

Category Parameter Description

Basicinformation

Instance Name Name of the selected DCS instance. To modify the instance

name, click the icon.

Instance Type Type of the selected DCS instance. Currently, two types ofDCS instances are supported: single-node and master/standby-node.

InstanceSpecifications

Specifications of the selected DCS instance.

Distributed Cache ServiceUser Guide 2 Getting Started

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

15

Page 19: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

Category Parameter Description

Memory The used memory space and maximum allowed memoryspace of the selected DCS instance.The used memory space includes:l Size of data stored in the DCS instancel Size of Redis-server buffers (including client buffer and

repli-backlog) and internal data structures

Status Status of the selected DCS instance. For details, see Table2-2.

Monitormetrics

Monitoring metrics of the selected DCS instance. Click theView icon redirects you to the CES console on whichmonitoring metrics of the selected DCS instance aredisplayed.

Instance ID ID of the selected DCS instance.

ConnectionAddress

IP address and port number of the selected DCS instance.

Created Time at which the selected DCS instance was created.

Description Description of the selected DCS instance. To modify

instance description, click the icon.

Network AZ Availability zone in which the cache node running theselected DCS instance resides.

SecurityGroup

Security group that controls access to the selected DCSinstance.

VPC VPC in which the selected DCS instance resides.

Subnet Subnet in which the selected DCS instance resides.

----End

Distributed Cache ServiceUser Guide 2 Getting Started

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

16

Page 20: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

3 Operation Guide

3.1 Configuring Redis-Specific Parameters

3.2 Stopping DCS Instances

3.3 Starting DCS Instances

3.4 Restarting DCS Instances

3.5 Deleting a Single DCS Instance

3.6 Change Instance Passwords

Distributed Cache ServiceUser Guide 3 Operation Guide

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

17

Page 21: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

3.1 Configuring Redis-Specific ParametersTo keep DCS instances performing optimally, configure Redis-specific parameters accordingto actual needs.

NOTE

Parameters can be configured only when DCS instances are in the Running state.

Procedure

Step 1 In the navigation pane of DCS console, choose Cache Manager.

Step 2 On the Cache Manager page, click on the name of DCS instance you want to configure.

A page with details of the selected DCS instance is displayed.

Step 3 On the Configuration Parameters tab page of the instance details page, click the Modifybutton.

Step 4 Modify Redis-specific parameters according to actual needs.

Usually, default values are retained.

Table 3-1 Redis-specific parameters

Parameter Description Possible Values DefaultValue

timeout Period for which a Redis client can beidle before the connection between theRedis client and server (DCS instance)is closed. A timeout period of 0indicates that the connection ispermanently open.

0 to 7200 seconds 0

maxmemory-policy

How Redis will select what to removewhen maxmemory is reached.For more information about thisparameter, see https://redis.io/topics/lru-cache.

volatile-lruallkeys-lruvolatile-randomallkeys-randomvolatile-ttlnoeviction

noeviction

hash-max-ziplist-entries

Hashes are encoded using the memoryefficient data structure ziplist when thenumber of entries in hashes is less thanthe value of this parameter.

1 to 10000 512

Distributed Cache ServiceUser Guide 3 Operation Guide

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

18

Page 22: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

Parameter Description Possible Values DefaultValue

hash-max-ziplist-value

Hashes are encoded using the memoryefficient data structure ziplist when thebiggest entry in hashes does not exceedthe length threshold indicated by thisparameter.

1 to 10000 64

list-max-ziplist-entries

Lists are encoded using the memoryefficient data structure ziplist when thenumber of entries in lists is less thanthe value of this parameter.

1 to 10000 512

list-max-ziplist-value

Lists are encoded using the memoryefficient data structure ziplist when thebiggest entry in lists does not exceedthe length threshold indicated by thisparameter.

1 to 10000 64

set-max-intset-entries

When a set is composed of just stringsthat happen to be integers in radix 10 inthe range of 64 bit signed integers, setsare encoded using the memory efficientdata structure intset.

1 to 10000 512

zset-max-ziplist-entries

Sorted sets are encoded using thememory efficient data structure ziplistwhen the number of entries in sortedsets is less than the value of thisparameter.

1 to 10000 128

zset-max-ziplist-value

Sorted sets are encoded using thememory efficient data structure ziplistwhen the biggest entry in sorted setsdoes not exceed the length thresholdindicated by this parameter.

1 to 10000 64

NOTE

For more information about Redis-specific parameters, visit https://redis.io/topics/memory-optimization.

Step 5 On the Configuration Parameters tab page, click Save to save the changes.

----End

Distributed Cache ServiceUser Guide 3 Operation Guide

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

19

Page 23: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

3.2 Stopping DCS Instances

Scenario

On the DCS console, you can stop one or multiple DCS instances at a time.

WARNINGAfter a DCS instance is stopped, read/write operations on this DCS instance are no longerallowed. If the DCS instance is a single-node instance, data is also deleted from this DCSinstance.

Prerequisites

The DCS instances you want to stop are in the Running state.

Procedure

Step 1 Log in to the management console.

Step 2 On the homepage of management console, click and choose Database > DistributedCache Service to launch the DCS console.

Step 3 In the navigation pane of DCS console, choose Cache Manager.

Step 4 On the Cache Manager page, select one or multiple DCS instances you want to stop.

Step 5 To batch stop DCS instances, click the Stop button above the DCS instance list. To stop asingle DCS instance, choose Operation > Stop on the row of this DCS instance.

Step 6 In the Stop dialog box, click OK to confirm that you want to proceed with the stop operation.

It takes about 1 to 5 minutes to stop DCS instances. After DCS instances are stopped, theirstatus changes from Running to Stopped.

----End

3.3 Starting DCS Instances

Scenario

On the DCS console, you can start one or multiple DCS instances at a time.

Prerequisites

The DCS instances you want to start are in the Stopped state.

Distributed Cache ServiceUser Guide 3 Operation Guide

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

20

Page 24: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

Procedure

Step 1 Log in to the management console.

Step 2 On the homepage of management console, click and choose Database > DistributedCache Service to launch the DCS console.

Step 3 In the navigation pane of DCS console, choose Cache Manager.

Step 4 On the Cache Manager page, select one or multiple DCS instances you want to start.

Step 5 To batch start DCS instances, click the Start button above the DCS instance list. To start asingle DCS instance, choose Operation > Start on the row of this DCS instance.

Step 6 In the Start dialog box, click OK to confirm that you want to proceed with the startoperation.

It takes about 1 to 5 minutes to start DCS instances.

After DCS instances are started, their status changes from Stopped to Running.

----End

3.4 Restarting DCS Instances

Scenario

On the DCS console, you can restart one or multiple DCS instances at a time.

WARNINGAfter a DCS instance is restarted, read/write operations on this DCS instance are not allowedwhile this DCS instance is being restarted. If the DCS instance is a single-node instance, datais also deleted from this DCS instance.

Prerequisites

The DCS instances you want to restart are in the Running or Faulty state.

Procedure

Step 1 Log in to the management console.

Step 2 On the homepage of management console, click and choose Database > DistributedCache Service to launch the DCS console.

Step 3 In the navigation pane of DCS console, choose Cache Manager.

Step 4 On the Cache Manager page, select one or multiple DCS instances you want to restart.

Distributed Cache ServiceUser Guide 3 Operation Guide

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

21

Page 25: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

Step 5 To batch restart DCS instances, click the Restart button above the DCS instance list. Torestart a single DCS instance, choose Operation > More > Restart on the row of this DCSinstance.

Step 6 In the Restart dialog box, click OK to confirm that you want to proceed with the restartoperation.

It takes about 1 to 5 minutes to restart DCS instances. After DCS instances are restarted, theirstatus changes to Running.

----End

3.5 Deleting a Single DCS Instance

Scenario

On the DCS console, you can delete a single DCS instance at a time.

WARNINGAfter a DCS instance is stopped, data is deleted from this DCS instance without any backup.

Prerequisites

The DCS instance you want to delete has been created.

Procedure

Step 1 Log in to the management console.

Step 2 On the homepage of management console, click and choose Database > DistributedCache Service to launch the DCS console.

Step 3 In the navigation pane of DCS console, choose Cache Manager.

The Cache Manager page with a list of DCS instances is displayed.

Step 4 In the Operation column of the selected DCS instance, choose More > Delete.

Only DCS instances in the Running, Faulty, Stopped, or Creation Failure state can be deleted.

Step 5 In the Delete dialog box, click OK to confirm that you want to proceed with the deletion.

It takes about 1 to 5 minutes to delete a DCS instance.

----End

Distributed Cache ServiceUser Guide 3 Operation Guide

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

22

Page 26: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

3.6 Change Instance Passwords

ScenarioOn the DCS console, you can change the password required for accessing your DCS instance.

PrerequisitesThe DCS instance for which you want to change password is in the Running state.

Procedure

Step 1 Log in to the management console.

Step 2 On the homepage of management console, click and choose Database > DistributedCache Service to launch the DCS console.

Step 3 In the navigation pane of DCS console, choose Cache Manager.

The Cache Manager page with a list of DCS instances is displayed.

Step 4 In the Operation column of the selected DCS instance, choose More > Change Password.

Step 5 In the Change Password dialog box, type the old password and new password.

NOTE

After 5 consecutive incorrect password attempts, the account for accessing the selected DCS instancewill be locked for 5 minutes. Passwords cannot be changed during the lockout period.

A DCS instance password cannot be left unspecified. It must:

l Be 8 to 26 characters in length

l Fewer than three consecutive identical characters

l Be different from the old password

l Contain at least three of the following character types: lowercase letters, uppercase letters, digits,and special characters !@$%^-_=+[{}]:,./?

Step 6 In the Change Password dialog box, click OK to confirm that you want to proceed with thepassword change.

----End

Distributed Cache ServiceUser Guide 3 Operation Guide

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

23

Page 27: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

4 FAQs

4.1 Does DCS Support Common Redis Clients Such as Jedis?

4.2 Should I Install Redis If I Already Have a DCS Instance?

4.3 Does Standby Cache Node Remain Synchronized With Master Cache Node?

4.4 Does DCS Support Data Persistence?

4.5 Can DCS Service Be Accessed from Public Networks?

4.6 Can I Modify Configuration Parameters of DCS Instances?

4.7 Can I Recover Data from Deleted DCS Instances?

4.8 What Is the Default Data Eviction Policy?

4.9 What Should I Do If the Connection Between My Redis Client and DCS Instance TimesOut?

Distributed Cache ServiceUser Guide 4 FAQs

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

24

Page 28: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

4.1 Does DCS Support Common Redis Clients Such asJedis?

DCS supports all clients compatible with Redis, including Jedis. You can download Redisclients from http://redis.io/clients.

4.2 Should I Install Redis If I Already Have a DCSInstance?

It is unnecessary to install Redis in this case. You can access your DCS instance through aRedis client.

4.3 Does Standby Cache Node Remain Synchronized WithMaster Cache Node?

Generally, updates to the master cache node are automatically and asynchronously replicatedto the standby cache node. This means that data in the standby cache node may not always beconsistent with data in the master cache node. This inconsistency is typically seen in either ofthe following situations:

l The input/output (I/O) write speed of the master cache node is faster than thesynchronization speed of the standby cache node.

l A network latency occurs between the master and standby cache nodes.

If a failover happens to occur when some data is not yet replicated to the standby cache node,such data may be lost after the failover.

4.4 Does DCS Support Data Persistence?Single-node DCS instances do not support data persistence. However, master/standby-nodeDCS instances do support data persistence.

4.5 Can DCS Service Be Accessed from Public Networks?DCS cannot be accessed from public networks. The ECS that serves as your Redis client andthe DCS instances that the Redis client will access must belong to the same VPC.

4.6 Can I Modify Configuration Parameters of DCSInstances?

Parameter configuration is allowed only when DCS instances are in the Running state.

Distributed Cache ServiceUser Guide 4 FAQs

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

25

Page 29: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

4.7 Can I Recover Data from Deleted DCS Instances?After the DCS instance is deleted, data in this DCS instance cannot be recovered.

4.8 What Is the Default Data Eviction Policy?Data is evicted from cache based on a user-defined space limit in order to make space for newdata.

By default, data is not evicted from DCS instances. In the current version of DCS, you havethe choice to select an eviction policy.

When maxmemory is reached, you can select one of the following six eviction policies:

l noeviction

When the memory limit is reached, DCS instances return errors to clients and no longerprocess write requests and other requests that could result in more memory being used.However, DEL and a few more exception requests can continue to be processed.

l allkeys-lru

DCS instances try to evict the least recently used keys first, in order to make space fornew data.

l volatile-lru

DCS instances try to evict the least recently used keys with an expire set first, in order tomake space for new data.

l allkeys-random

DCS instances evict random keys in order to make space for new data.

l volatile-random

DCS instances evict random keys with an expire set, in order to make space for newdata.

l volatile-ttl

DCS instances evict keys with an expire set, and try to evict keys with a shorter time tolive (TTL) first, in order to make space for new data.

NOTE

If no keys match the preceding eviction policies, the policies volatile-lru, volatile-random, and volatile-ttl behave like noeviction.

4.9 What Should I Do If the Connection Between MyRedis Client and DCS Instance Times Out?

Reconnect your client to DCS instances.

The timeout is probably due to network connectivity problems or DCS instance errors. Forexample, if your DCS instance is overloaded or experiences a failover, your Redis clientreturns the error message "Connection timed out" or "Connection reset by peer".

Distributed Cache ServiceUser Guide 4 FAQs

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

26

Page 30: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

Certain Redis clients do not support automatic reconnection. If you use such Redis clients, theapplications that use DCS must be able to proactively initiate reconnection.

Distributed Cache ServiceUser Guide 4 FAQs

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

27

Page 31: User Guide - HUAWEI CLOUDstatic.huaweicloud.com/upload/files/pdf/20170420/...managed. You no longer need to perform management tasks such as hardware provisioning, software patching,

A Change History

Release Date What's New

2016-08-20 This issue is the first official release.

2017-04-18 This issue is the second official release.Incorrect descriptions in the previous issue have been rectified.

Distributed Cache ServiceUser Guide A Change History

Issue 03 (2017-04-18) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

28