rds

Nodejs学习笔记(九)--- 与Redis的交互(mranney/node_redis)入门

旧巷老猫 提交于 2019-12-05 14:42:06
目录 简介和安装 redis简介 redis安装 redis运行 node_redis安装 连接到redis服务器redis.createClient() 认证 client.auth(password, callback) 单值set和get client.set(key,value,[callback]) client.get(key,[callback]) client.set([key,value],callback) 多值get和set client.hmset(hash,obj,[callback]) client.hmset(hash,key1,val1, ... keyn,valn,[callback]) client.hgetall(hash,[callback]) 打包执行多个命令[事务] 其它... 简介和安装 redis简介: 开源高性能key-value存储;采用内存中(in-memory)数据集的方式,也可以采用磁盘存储方式(前者性能高,但数据可能丢失,后者正好相反) 支持字符串(strings)、哈希(hashes)、列表(lists)、集合(sets)和 有序集合(sorted sets)等;支持对复杂数据结构的高速操作。 特性多,支持主从同步、pub/sub等 支持多种客户端( http://redis.io/clients ) ...   注

nodejs连接redis学习

旧城冷巷雨未停 提交于 2019-12-05 14:40:27
网址:https://www.npmjs.com/package/redis (1)安装 下载地址: https://github.com/MSOpenTech/redis/releases 。 打开一个 cmd 窗口 使用cd命令切换目录到 C:\redis 运行 redis-server.exe redis.windows.conf 这时候另启一个cmd窗口,原来的不要关闭,不然就无法访问服务端了。 切换到redis目录下运行 redis-cli.exe -h 127.0.0.1 -p 6379 。 设置键值对 set myKey abc 取出键值对 get myKey (2)nodejs连接 redis var redis = require('redis'), RDS_PORT = 6379, RDS_HOST = '127.0.0.1', RDS_OPTS = {}, client = redis.createClient(RDS_PORT, RDS_HOST, RDS_OPTS); client.on('ready', function(res){ console.log('ready') }) (3) 取值和赋值 var redis = require('redis'), RDS_PORT = 6379, RDS_HOST = '127.0.0.1', RDS

drds基础笔记

我是研究僧i 提交于 2019-12-05 11:38:50
帮助文档URL: https://help.aliyun.com/document_detail/29659.html?spm=a2c4g.11186623.6.539.6c5jsL drds知识总结: bug1,分库分表的时候,在表对象中查不到. bug2,分库分表无法进行数据导入,提示表结构找不到. note1,分区键起作用后,可能导致查询出结果主键冲突.主键要提前设定为全局唯一. note2,分区键键值不可修改. note3,如果是雪花生成的,都是16的整数倍,取模后都为0,落在0分库.对于历史数据,统一修改为自增,或者采用其他分区函数. 哈希算法是简单取模,要求拆分列的值的自身分布均衡才能保证哈希均衡。 note4,right_shift是先转换成2进制,然后向右移动位数进行计算,如果原来是16整数倍的数据,如右移位数不够,数据仍不均,导致right_shift处理后的数据还是分布不均匀. (Distributed Relational Database Service) 特点: 分库分表,透明读写分离,分布式事务(结合分布式事务套件 GTS),平滑扩容. 目的:单机数据库遇到的容量(200+mysql实例)和性能瓶颈,最主要是性能问题. 其他技巧: 权限,查看子库,自生成主键 分布式运维指令集 DRDS 提供独有分布式数据库运维指令集,如 SHOW SLOW、TRACE

How can I change the “Database Name” in AWS RDS for Postgresql?

柔情痞子 提交于 2019-12-05 10:47:43
I wanted to create a replicate of my production database for staging and created the staging DB instance from a production snapshot. However, this new instance still has the Database Name: "production-database". I was able to rename the database on PSQl to "staging-databse," but this is not reflected in the AWS Console. I'm afraid that future developers will be very confused, and was wonderign how to rename the "Database Name" on AWS? Don't use the default database option. All it does is create a custom-named database by default. There may be uses for it, but I never use it, because it seems

value of max_connections in AWS RDS

人走茶凉 提交于 2019-12-05 07:50:00
does anyone know where I can found the highest value of max_connections in AWS RDS? I'm primarily interested in the db.t2 instances running MySQL. I cannot find any appropriate link about that. Thanks!! As @error2007s states you can find it in the console, just to complete, in a more general way you have: t2.micro 66 t2.small 150 m3.medium 296 t2.medium 312 m3.large 609 t2.large 648 m4.large 648 m3.xlarge 1237 r3.large 1258 m4.xlarge 1320 m2.xlarge 1412 m3.2xlarge 2492 r3.xlarge 2540 Taken from here When you go to configuration details of your RDS you will find a Parameter Group in the details

PgSQL · 应用案例 · 阿里云 RDS PostgreSQL 高并发特性 vs 社区版本

心不动则不痛 提交于 2019-12-05 00:33:16
摘要: 背景 进程模型数据库,需要为每个会话指派独立的进程与之服务,在连接数非常多,且大都是活跃连接时,进程调度浪费或引入的开销甚至远远大于实际任务需要的开销(例如上下文切换,MEMCPY等),性能下降会较为严重。 背景 进程模型数据库,需要为每个会话指派独立的进程与之服务,在连接数非常多,且大都是活跃连接时,进程调度浪费或引入的开销甚至远远大于实际任务需要的开销(例如上下文切换,MEMCPY等),性能下降会较为严重。 PostgreSQL与Oracle Dedicate Server一样,属于进程模型。在非常高并发的情况下,性能会下降比较厉害,通常社区版本可以通过加连接池来解决,例如pgbouncer,但是加连接池也会带来一些问题: 1、绑定变量无法很好的满足,当然,PostgreSQL 11会增加类似Oracle cursor force的功能,内部将非绑定变量的SQL转换为绑定变量。 《PostgreSQL 11 preview - 强制auto prepared statment开关(自动化plan cache)(类似Oracle cursor_sharing force)》 2、连接池会使得跳数增加,增加了延迟。 3、数据库防火墙配置的变化。从直接控制应用端来源,变成了连接池端来源。(除非修改连接池层的代码,做到来源IP和端口透传) Oracle为了解决性能问题

阿里云RDS的mysql数据库连接

末鹿安然 提交于 2019-12-04 15:37:14
首先购买mysql数据库的产品,并创建实例 然后进入实例的管理页面 点击下面的管理 进入管理页面后申请外网地址(申请了外网才可以通过外网访问) 顺便查看端口是否开放(默认开放3306) 然后点击白名单设置(重点),主要是设置允许哪些设备可以访问你的数据库 点击添加白名单组 进行如下添加 添加完成后: 然后设置安全组: 注意,你添加的安全组中必须有数据库的端口,即3306。 然后通过终端命令即可登陆到数据库 如遇到其他问题可参考以下网址(阿里云)进行尝试: https://help.aliyun.com/knowledge_detail/96028.html#concept-cqq-x1d-sfb 来源: https://www.cnblogs.com/rrtwin/p/11871674.html

阿里云RDS物理备份恢复到本地

一笑奈何 提交于 2019-12-04 13:43:52
一:业务场景 验证阿里云备份文件可用性 二:恢复到本地过程中遇到的问题 1.修改密码报错 2.自定义函数不可用 三:恢复步骤 1.xtrabackup安装使用 请参考: https://www.cnblogs.com/zhs0/articles/10518431.html 2.下载RDS备份文件上传到本地(存放到 /bak目录下) 3.数据保持一致性 xtrabackup --prepare --target-dir=/bak 4.停止数据库并修改本地数据目录名称 mv data data_bak 5. xtrabackup --move-back --target-dir=/bak ---配置文件定义data目录可以这样执行,会自动生成一个data目录,修改属主,属组后可启动数据库 6.跳过授权表修改数据库密码验证备份文件 二-1修改密码报错 1.查看并修改RDS超级账号密码 1 select host,user from mysql.user; 2 update mysql.user set authentication_string=password('新密码') where user='aliyun_root'; 报错如下:Unknown system variable 'maintain_user_list' 表示有触发器. 注意: 在mysql5.7 中, aliyun

ERROR 1465 “Triggers can not be created on system tables” after restore from SQL created by mysqldump

你离开我真会死。 提交于 2019-12-04 11:15:29
I'm running a mysql 5.6 server on amazon RDS and set up a read replica I use to create backups using mysqldump. I tried with the "--all-databases" option, but when I'm trying to import the SQL created by mysqldump, I end up with this error from the mysql command client: ERROR 1465 "Triggers can not be created on system tables" I used "--all-databases" because I basically want to restore everything in RDS as it was before in case of a crash. Maybe that's wrong, and I should only select my schemas (plus the mysql.users table)? But what is "--all-databases" for in the first place, if it would

MySQL/RDS数据如何同步到MaxCompute之实践讲解

送分小仙女□ 提交于 2019-12-04 08:39:55
摘要: 大数据计算服务(MaxCompute,原名ODPS)是阿里云提供的一种快速、完全托管的EB级数据仓库解决方案。本文章中阿里云MaxCompute公有云技术支持人员刘力夺通过一个实验向大家介绍了阿里云关系型数据库产品RDS中的MySQL数据如何同步到MaxCompute,帮助用户大体了解MaxCompute产品以及其数据同步过程。 直播视频回顾: MySQL/RDS数据如何同步到MaxCompute 以下内容根据演讲视频以及PPT整理而成。 实验方案概述 本实验是对RDS同步数据到MaxCompute的一个初步讲解。当企业需要利用MaxCompute进行数据开发时,如果数据不在MaxCompute而在RDS中,首先需要将RDS中的数据同步到MaxCompute。本实验将以RDS(MySQL)为例,具体讲解此过程的操作步骤以及一些容易遇到的问题,为企业的数据同步过程提供一些指导与帮助。 本次同步过程的方案分为以下两个链路:1)通过DataWorks中的数据集成功能进行同步;2)通过DTS(数据传输服务)进行同步。 方案1需要在DataWorks中新建RDS和MaxCompute的数据源,利用抽象化的数据抽取插件(Reader),数据写入插件(Writer)进行数据传输,达到数据同步的目的; 方案2利用DTS服务确定同步的数据来源及数据去向进行同步。 下图是同步的方案流程图