Process of installing Redis database on Alibaba Cloud Server ECS by Alibaba Cloud Linux

Alibaba Cloud Linux 2, the Alibaba Cloud server operating system, has been specially tuned for Redis applications. Compared with the community version of the operating system, the overall performance of Redis applications has improved by more than 20%. Alibaba Cloud Linux 2 has built-in yum sources of Redis 6.0.5 and Redis 3.2.12. Execute the sudo yum install command to deploy Redis 6.0.5 and Redis 3.2.12. Alibaba Cloud Encyclopedia takes Alibaba Cloud Server ECS persistent memory instance as an example: 

Alibaba Cloud Database supports the Redis version of ApsaraDB for ApsaraDB for Redis. Users can also manually deploy Redis on the cloud server ECS . Choose according to the actual situation, as shown in the following figure:

 Install Redis on Alibaba Cloud Linux, and you can receive exclusive vouchers at the Alibaba Cloud CLUB center: aliyun.club .

Ali cloud server ECS deployment Redis memory database process

Alibaba Cloud’s persistent memory cloud server ECS includes re7p, r7p, re6p, etc. Take the persistent memory re6p instance ecs.re6p-redis.2xlarge as an example. The operating system image is Alibaba Cloud Linux 2.1903 LTS 64-bit, and Redis 6.0 is installed. .5 or Redis 3.2.12 tutorial is as follows:

Alibaba Cloud Linux 2 has been specially tuned for Redis applications. Compared with the community version operating system, the overall performance of Redis applications has improved by more than 20%. Alibaba Cloud Linux 2 has built-in yum sources of Redis 6.0.5 and Redis 3.2.12. Execute the sudo yum install command to deploy Redis 6.0.5 and Redis 3.2.12.

Install Redis command

The command to deploy Redis 6.0.5 is as follows:

sudo yum install -y alinux-release-experimentals && \
sudo yum install -y redis-6.0.5

Deploy Redis 3.2.12 command:

sudo yum install -y alinux-release-experimentals && \
sudo yum install -y redis-3.2.12

Select the corresponding Redis version as needed, and execute the command.

Start the Redis application

Configure the capacity of ordinary memory and persistent memory used by default. The ratio of ordinary memory to persistent memory is as follows: the
recommended ratio of ordinary memory to persistent memory is 1:4:

export MEMKIND_DAX_KMEM_NODES=1 && \
sudo redis-server /etc/redis.conf –port 8369 –memory-alloc-policy ratio –dram-pmem-ratio 1 4 –hashtable-on-dram yes –daemonize yes –logfile /tmp/redis_8369.log –protected-mode no –bind 0.0.0.0

You can also customize the ratio of ordinary memory to persistent memory, and reserve some ordinary memory to run other applications. For example, the ratio is 1:16, and the allocated memory is 34 GiB (of which ordinary memory is 2 GiB and persistent memory is 32 GiB):

export MEMKIND_DAX_KMEM_NODES=1 && \
sudo redis-server /etc/redis.conf –port 8369 –memory-alloc-policy ratio –dram-pmem-ratio 1 16 –maxmemory 34G

For more details about Alibaba Cloud ECS instances with long-lasting memory, ApsaraDB for Redis , and Alibaba Cloud Linux mirroring systems, please refer to the official page documents.

Guess you like

Origin blog.csdn.net/ba476/article/details/130484821