2021 Latest-AWS Amazon Cloud Creates a Redis Cluster

AWS Amazon cloud creates Redis cluster

1. AWS-Redis service

2. Create a Redis database cluster

  • Here I am using Amazon MemoryDB for Redis database cluster
2.1 Getting Started

insert image description here

2.2 Create a cluster

insert image description here

2.3 Select a cluster creation method
  • Generally, a new cluster is created, and the restore from the snapshot is only selected when restoring the Redis backup.

insert image description here

2.4 Cluster information
  • Cluster name and description Fill in the specified name according to your own business

insert image description here

2.5 Select or create a subnet

insert image description here

2.6 Basic settings of Redis cluster

insert image description here

2.7 Security Group and Encryption

insert image description here

2.8 Snapshot and backup

insert image description here

2.9 Maintenance

insert image description here

2.10 Labels

insert image description here

2.11 create

insert image description here

3. Connect to the Redis cluster

  • To connect to the Redis cluster, the server must install the redis service
3.1 Install redis cluster
#redis软件仓库
http://download.redis.io/releases/
#下载
wget http://download.redis.io/releases/redis-5.0.5.tar.gz
#解压
上传至 /redis
tar xzf redis-5.0.5.tar.gz
mv redis-5.0.5 redis
#安装依赖并编译
yum -y install gcc automake autoconf libtool make
cd redis
make
yum install tcl
cd src
make test
#环境变量
vim /etc/profile 
export PATH=/redis/redis/src:$PATH
source /etc/profile 
#启动
redis-server & 
#连接测试
redis-cli 
127.0.0.1:6379> set num 10
OK
127.0.0.1:6379> get num
10
3.2 The server is connected to the Redis cluster
  • Start with Amazon Memory DB for Redis --> cluster --> Redis (cluster you created) --> cluster endpoint

  • Find the cluster endpoint and execute the following command in the EC2 instance to connect to the cluster

redis-cli -h mycachecluster.eaogs8.0001.usw2.cache.amazonaws.com -p 6379
  • If the connection is successful, the following will be displayed
redis mycachecluster.eaogs8.0001.usw2.cache.amazonaws.com 6379>
3.3 Add the server address or security group that needs to connect to the cluster to the Redis database security group
  • In order to protect the security of the database cluster more effectively, it is not fully opened in the database security group, and only the address of the server that needs to connect to the cluster is added separately

insert image description here

4. Summary

  • AWS Amazon cloud creation of Redis cluster is complete

Guess you like

Origin blog.csdn.net/HYXRX/article/details/120993072