当前位置:网站首页>Read Amazon memorydb database based on redis
Read Amazon memorydb database based on redis
2022-06-23 00:39:00 【Menon research monk】
Catalog
Preface
Traditional self built Redis adopt Jedis、Redisson as well as Lettuce
- Jedis: from JAVA Realization , Support more comprehensive Redis command
- Redisson: There are many distributed operations and strong scalability
- Lettuce: There are many applications of distributed caching framework
Compare traditional methods with traditional databases , Build through cloud database Redis, From efficiency 、 operation 、 For security and availability , The functions and effects are very complete , Turn the disadvantages of its traditional database into advantages .
MemoryDB At the same time, it can provide memory performance and multi availability persistence , High performance master database for microservice applications , No need to manage cache and persistent database separately
MemoryDB of Redis Have a persistent memory database service , Provide ultra fast performance
- MemoryDB With the popular open source data storage Redis compatible , Be able to use friendly Redis data structure 、API And commands to quickly build applications
- MemoryDB All data can be stored in memory , Microsecond reading and single digit millisecond writing are realized , To achieve low latency and high throughput
- Use multi zone transaction logs to span multiple zones to achieve persistent storage of data , For fast failover 、 Database recovery and node restart
Its core components have : colony 、 node 、 Debris, etc
About Amazon There are many types of other databases , It has many advantages and is very easy to use : Database free trial links and tutorials . Moreover, technical meetings are held irregularly to promote exchanges , adopt Cloud native database online conference The link to , You can learn more cutting-edge technologies . Not only the documentation tutorial code is complete , And the free package is especially powerful , Amazon cloud technology provides 100 Free packages for more than products . among , Computing resources Amazon EC2 First year 12 It's free for three months ,750 Hours / month ; Storage resources Amazon S3 First year 12 It's free for three months ,5GB Standard storage capacity ; Database resources Amazon RDS First year 12 It's free for three months ,750 Hours ;Amazon Dynamo DB 25GB storage capacity Free forever . Attach a link :100 Free packages for more than products
While entering the text principle and experimental explanation , Need to register an account and verify personal information
( notes :1. The address of personal information needs to be in English
2. Use of billing information VISA Wait for a credit or debit card number )
1. To configure MemoryDB
1.1 obtain AWS Access key
The main steps are as follows :
- Register and log in through the previous steps AWS Administrative console , Open as follows IAM Console .
- In the left navigation column , choice Users ( user ), Create user ( choice Security credentials ( Security certificate ) tab ), stay Access keys( Access key ) part , choice Create access key ( Create access key )

- Set the permissions ( Add its users to the group ), And set the boundary of permission ( If you do not set permission, you will be prompted that the user does not have access permission ).
- To view the new access key pair , Please select Show ( Show ). After closing this page , You will not be able to access the private access key again . Your voucher is similar to the following :

- To download the key pair , Please select Download .csv file ( download .csv file ). Store the key in a secure location .

1.2 Download and configure AWS CLI
The credentials can be configured programmatically or through AWSCLI( Credentials must be configured to enable authorization for the application )
The links to the downloaded and configured documentation are as follows :AWS CLI
Display interface Windows Installation process ( There are few orders ):
Empathy linux Installation process on the platform ( The same applies to other platforms ):
After that, you need to configure credentials , adopt aws configure( The following shows example values )
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-west-2
Default output format [None]: json
The screenshot is as follows :
2. Configure clusters
2.1 Create clusters
There are three ways to create a cluster :
The first one is : Through the console
The specific steps are as follows , Click Create cluster 
Subnet group 、VPC And subnets ( If multiple zones are enabled , The subnet group contains more than two subnets in different zones )
Set up the cluster
- edition : Compatibility selection defaults 6.2
- port : The default value is Redis Of 6379( If the port conflicts , The corresponding port number can be selected )
- Parameter group : Default choice default.memorydb-redis6
- Node type : Select the memory value appropriate for the node type
- Number of slices : Number of partitions required for the cluster ( To improve cluster availability , Suggested choice 2 More than one slice )
- replications : Select the required number of read-only copies for the shard ( If you enable multiple zones , Each slice 1 More than copies )

For security groups in advanced options ( Act as a firewall to control network access to the cluster )
- Encrypt data ( Static encryption : Encrypt the data stored on the disk ; Encryption in transmission : Enable encryption for transmitted data )

Later snapshots 、 The maintenance and cluster tag sections depend on the individual situation
The second kind : adopt AWSCLI
- Linux Sample code :
aws memorydb create-cluster \
--cluster-name my-cluster \
--node-type db.r6g.large \
--acl-name my-acl \
--subnet-group my-sg
- Windows Sample code :
aws memorydb create-cluster ^
--cluster-name my-cluster ^
--node-type db.r6g.large ^
--acl-name my-acl ^
--subnet-group my-sg
After successful creation, a string of json Format
The third kind of : adopt API
More detailed descriptions of the above three types can be found in : Create a cluster document
2.2 Grant cluster access
all MemoryDB Cluster adoption Amazon EC2 Instance to access ( Authorization required EC2 example )
same VPC in EC2 Access between instances and clusters
Specific steps for starting an instance :Amazon EC2 Console
- Create a key pair ( The started instance does not have a key pair , You cannot connect to this instance )

Create examples
- Name and tags: Name and label
- Application and OS Images (Amazon Machine Image): Quick start and AMI image
- Instance type : Default choice t2.micro Instance type ( If t2.micro Areas where instances are not available , Can choose t3.micro example )
- Key pair : Select the key pair you created at the beginning
- Network settings : Select an existing security group or create a new one ( This security group can be used to restrict access to the cluster )

Create a custom rule in the security group of the cluster ( This security group will allow access to other security group members ), Edit inbound rules , Select Add Rule
from Type Choose from Custom TCP Rule
- Port number : Specify the port when creating the cluster ( Here for the convenience of testing , The broadcast address is used uniformly 0.0.0.0)
- Source Source : Security group ID

After enabling connection access , You can connect to the cluster 
The final presentation page is as follows :
2.3 Connect to cluster
Determine the terminal node of the cluster :( adopt describe-clusters Command to search cluster terminal nodes )
aws memorydb describe-clusters \
--cluster-name mycluster
The command will return the terminal node of the cluster , adopt json Format response 
Use redis-cli Connect to MemoryDB node
Download and compile redis-cli Utilities :
$ sudo yum -y install openssl-devel gcc
$ wget http://download.redis.io/redis-stable.tar.gz
$ tar xvzf redis-stable.tar.gz
$ cd redis-stable
$ make distclean
$ make redis-cli BUILD_TLS=yes
$ sudo install -m 755 src/redis-cli /usr/local/bin/
Screenshot of compilation execution process :

stay EC2 Execute the following command in the instance of ( The end nodes of the cluster and ports replace this example )
adopt src/redis-cli -c -h Cluster Endpoint --tls -p 6379
Specifically Cluster Endpoint The cluster of can be viewed by clicking the cluster terminal node

2.4 Delete cluster
Delete the name of the cluster you created
Delete a cluster separately :aws memorydb delete-cluster --cluster-name my-cluster
Delete multiple clusters :
aws memorydb delete-cluster \
--cluster-name my-cluster \
--region us-east-1
summary
Throughout the full text , Through reading the documents and the whole set of experiments , Freely flowing style of writing , Thanks to the complete documentation and functions , The experience is wonderful . In itself MemoryDB No need to manage cache and persistent database separately , Is a very high-performance database , be based on Redis Provides a persistent memory database service , Has its read and write data , Achieve low latency and high throughput ; Friendly to use Redis Data structure of 、API And commands to quickly build applications
Through the above experimental steps , You're ready to get started , For more exploration, if you want to know more about learning, you can go through :Amazon MemoryDB for Redis Official document
Amazon cloud technology has created a variety of learning platforms for developers :
① Getting started Resource Center : from 0 To 1 Easy to get started with cloud services , Content covered : Cost management , Start training , Development resources .
② Architecture Center : Amazon cloud Technology Architecture Center provides cloud platform reference architecture chart 、 Reviewed architectural solutions 、Well-Architected Best practices 、 Pattern 、 Icon, etc .
③ Builder Library : Learn how Amazon cloud builds and operates software .
④ tool kit : It is used to develop and manage applications on the Amazon cloud technology platform .
In addition to complete code documentation , In order to let more people experience , We hereby launch 【 Exclusive benefits 】
Fukuichi :100 Free packages for more than products . among , Computing resources Amazon EC2 First year 12 It's free for three months ,750 Hours / month ; Storage resources Amazon S3 First year 12 It's free for three months ,5GB Standard storage capacity .
Welfare II : The latest discount gift bag :200 Count According to the And branch Analysis Offset buckle Coupon , 200 Data and analysis deduction voucher ,200 Count According to the And branch Analysis Offset buckle Coupon ,200 Machine learning voucher ,200$ Micro service and application development deduction voucher .
Welfare three : Solution CloudFormation One click deployment template library
边栏推荐
- Analysis on the wallet system architecture of Baidu trading platform
- Shell 日志与打印输出
- 【GO】go语言interface
- How about China International Futures Co., Ltd.? Is it a regular futures company? Is it safe to open an account online?
- Express, route, request object, response object, middleware, EJS template
- 语义分割新范式!StructToken:对per-pixel 分类范式的重新思考
- Cadence spb17.4 - Chinese UI settings
- Isolation level of transaction system
- “听觉”营销价值凸显,喜马拉雅迎来新局点
- 數據庫中數據的儲存結構和方式是什麼?
猜你喜欢

To establish a cloud computing "Kunlun", why should Lenovo hybrid cloud Lenovo xcloud?

SAP UI5 应用开发教程之一百零三 - 如何在 SAP UI5 应用中消费第三方库

3dMax建模笔记(一):介绍3dMax和创建第一个模型Hello world

ROS1Noetic在Win11中安装记录

OLAP ——Druid简介

Daily question brushing record (I)
![[machine learning watermelon book] update challenge [Day1]: 1.1 INTRODUCTION](/img/f6/b0df192502a59a32d8bac8c0862d02.png)
[machine learning watermelon book] update challenge [Day1]: 1.1 INTRODUCTION

最安全的现货白银的心理分析

Binary tree to string and string to binary tree

Kunlundb query optimization (II) project and filter push down
随机推荐
Why do we seldom use foreign keys?
工程目录导航
Hierarchy selector
How Huawei cloud implements a global low delay network architecture for real-time audio and video [Part 1]
New paradigm of semantic segmentation! Structtoken: Rethinking the per pixel classification paradigm
Hello, is the securities account presented by the Business School of qiniu business school safe? How can I open a safe stock account to speculate in stocks
Mysql8.0 easily completes gtid master-slave replication
Shell 查看帮助
Kunlundb query optimization (III) sort push down
Brief introduction: how much do you know about fishing attacks
ECMAScript6新特性
【GO】go多态
关于测试/开发程序员技术的一些思考,水平很高超的,混不下去了......
Ansible 学习总结(7)—— Ansible 状态管理相关知识总结
a++,++a,!,~
How to get started with machine learning?
瑞达期货安全么?期货开户都是哪些流程?期货手续费怎么降低?
Introduction to the use of opencvsharp (C openCV) wechat QRcode decoding function (with source code attached)
Analysis on the wallet system architecture of Baidu trading platform
SAP UI5 应用开发教程之一百零二 - SAP UI5 应用的打印(Print)功能实现详解试读版