GVKun编程网logo

无法在 Java 中使用 RDS 连接到 MySQL/Aurora:路径不与任何信任锚链接(java不能连接至vm)

1

如果您对无法在Java中使用RDS连接到MySQL/Aurora:路径不与任何信任锚链接和java不能连接至vm感兴趣,那么这篇文章一定是您不可错过的。我们将详细讲解无法在Java中使用RDS连接到M

如果您对无法在 Java 中使用 RDS 连接到 MySQL/Aurora:路径不与任何信任锚链接java不能连接至vm感兴趣,那么这篇文章一定是您不可错过的。我们将详细讲解无法在 Java 中使用 RDS 连接到 MySQL/Aurora:路径不与任何信任锚链接的各种细节,并对java不能连接至vm进行深入的分析,此外还有关于Amazon Aurora 和 RDS 选哪个?工程师视角八大关键维度全方位对比指南、Aurora PostgreSQL Disaster Recovery solutions using Amazon Aurora Global Database、Aurora Postgress 与 Aurora Mysql 中的字符串 JSON 文档、AWS Aurora mysql 数据库非常慢,然后 AWS RDS Mysql的实用技巧。

本文目录一览:

无法在 Java 中使用 RDS 连接到 MySQL/Aurora:路径不与任何信任锚链接(java不能连接至vm)

无法在 Java 中使用 RDS 连接到 MySQL/Aurora:路径不与任何信任锚链接(java不能连接至vm)

如何解决无法在 Java 中使用 RDS 连接到 MySQL/Aurora:路径不与任何信任锚链接

我正在尝试建立到我的 MysqL/aurora RDS 实例的连接。 当我尝试使用本指南从终端连接时一切正常:https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToInstance.html

但是,当我尝试使用我的 spring 应用程序连接 ssl 时, 我在 jdbc 连接 url 中传递了 trustCertificateKeyStoreUrl。

我收到 java.security.cert.CertPathValidatorException: Path 未与任何信任锚链接

我正在寻找指南,我尝试使用 KeyStore Explorer 并从全局包中导入每个证书,但仍然没有结果。 你能帮我吗?

Amazon Aurora 和 RDS 选哪个?工程师视角八大关键维度全方位对比指南

Amazon Aurora 和 RDS 选哪个?工程师视角八大关键维度全方位对比指南

【直播预告】程序员逆袭 CEO 分几步?

在 2023 年 Gartner 最新的魔力象限评估中,AWS 再次被评为云数据库管理系统的顶级厂商之一。AWS 在在线事务处理(OLTP)的关系型数据库领域提供了两个主要产品:

  • Amazon RDS(关系型数据库服务),这是 AWS 于 2009 年 10 月 22 日推出的产品,可能是全球规模最大的数据库服务之一。
  • Amazon Aurora,于 2014 年 11 月 12 日推出,作为 RDS 的高定版,它以无与伦比的高性能和全球范围内的高可用性著称,兼容 MySQL 和 PostgreSQL 协议。

当工程团队开始使用 AWS 时,他们首要的任务之一就是选择 Aurora 还是 RDS 作为他们的主要数据库系统(如果他们选择使用 NoSQL 数据库,那么他们则需要在 MongoDB 和 DynamoDB 之间做选择)。接下来,我们将以工程师的视角来对比以下几个方面:

  1. 支持的数据库类型
  2. 系统架构
  3. 兼容性
  4. 性能表现
  5. 系统弹性
  6. 高可用性
  7. 定价策略
  8. 推荐配置方式

支持的数据库类型

RDS 支持包括 MySQL、PostgreSQL、MariaDB、SQL Server、Oracle 和 Db2 在内的所有主流关系型数据库。

而 Aurora 则支持 MySQL 和 PostgreSQL 这两种数据库。

在选择数据库版本方面,使用 RDS 时,您可以自由选择各种上游的数据库版本。但如果使用 Aurora,您只能选择一些特定的版本,这些版本是基于 Aurora 特定版本的,对应的也是某几个上游版本。

系统架构

RDS 就是把主流的数据库搬到云平台上。相对而言,Aurora 则是一种「云原生」数据库服务。之所以说它是「云原生」的,是因为 Aurora 充分利用了云环境的特性,例如通过将计算和存储分离,以及利用 Amazon S3 进行数据的持久化保存。这种创新的设计极大地提升了数据库的性能、高可用性和扩展能力。

兼容性

Aurora 和 RDS 作为云数据库,都存在一些共同的限制:

  • 您只能使用半超级用户。
  • 您无法访问数据库服务器的文件系统。对于 MySQL 来说,这意味着您只能使用 LOAD DATA LOCAL 从本地文件系统导入数据,而不能使用 LOAD DATA 从服务器文件系统导入数据。

虽然 Aurora 是一项专有技术,但它与普通 MySQL / PostgreSQL 的主要区别在于存储引擎层。另一方面,决定大多数面向用户行为的服务器层几乎完全相同。例如,MySQL 的 Aurora 仅支持 InnoDB,而 RDS 支持 MyISAM 等旧引擎(不过,如果您启动一个新项目,无论如何都不会使用 MyISAM 引擎)。

话虽如此,Aurora 的代码库与标准 MySQL / Postgres 相比,与 RDS 的差异更大,因此您应该预期 AWS 团队在引入最新的上游更新方面会有更多的延迟。例如,Aurora PostgreSQL 比 RDS 晚了两个月才添加了当红的 pgvector 扩展。

性能表现

根据官方网站,Aurora 的吞吐量是 MySQL 的 5 倍,是 PostgreSQL 的 3 倍。

这个测试甚至表明,Aurora 的性能是 RDS 的 60 倍。

Aurora 在写入性能上表现更佳,主要原因是它在处理数据时只发送重做日志到远端存储服务,避免了其他在事务提交过程中可能发生的写入操作,例如广为人知的 doule-write buffer 问题。

得益于其基于日志的架构,Aurora 在读取操作的可扩展性方面也更出色,能够支持多达 15 个读副本。相比之下,RDS 最多只能支持 5 个读副本,因为传统的流式复制技术会对主数据库造成较大的性能影响。此外,在写入密集的负载条件下,Aurora 的复制延迟也大大降低了。

RDS 使用的是 EBS 存储,其磁盘性能会根据不同的存储类型 而有所差异。

总体来说,Aurora 在性能上显著优于 RDS。但是,您仍然需要针对自己的实际工作负载进行具体的性能测试。

系统弹性

RDS 的弹性相对有限,如果您选择了 gp2 SSD 存储,它能提供一定的性能突增,但基本上就这些了。 标准 Aurora 可以快速提供读副本,但除此之外,它不提供开箱即用的弹性。 Aurora Serverless 版本,特别是 Serverless v2,则在弹性伸缩方面做得非常出色,能够根据需要灵活调整计算资源,这对于电商等需要应对不同时间段不同负载的场景非常适用。

高可用性

RDS 提供多可用区(multi-AZ)高可用(HA)设置,SLA 高达 99.95%,而 Aurora 则提供高达 99.99% 的 SLA。由于其基于日志的架构,Aurora 可以更快地 failover。特别是在写入操作较多的情况下,由于复制延迟的问题,RDS 在故障切换上可能会遇到更多的困难。

Aurora 还拥有全球数据库功能 Aurora Global Database,可以实现低延迟的全球读取和跨 AWS 区域的灾难恢复。

定价策略

如果您按照 AWS 向导选择生产模板(8c64g r6g.2xlarge + multi-AZ HA),您会发现 Aurora 的价格比 RDS 便宜得多。好得令人难以置信。

然而,需要注意的是 Aurora 还会对数据的 I/O 操作收费,而这通常不包含在初步的价格预估中。这一点在很多客户收到高额 AWS 账单时令他们感到意外。这种不确定的成本曾是团队最初采用 Aurora 时的一大顾虑。到了 2023 年,Aurora 通过推出 I/O - 优化版来将 I/O 成本纳入存储费用,解决了这一问题。

除此之外,只有 RDS 提供免费使用计划和较低配置的数据库实例,起步配置为 2c1g t3.micro。而标准的 Aurora 最低配置是 2c16g r5.large,能够支持 burst 的类别则从 2c4g t3.medium 开始。Aurora Serverless 允许设置最低 0.5 ACU(应用计算单元),其中 1 ACU 提供 2 GiB 内存及相应的计算和网络资源。 总之,您应该使用 AWS 定价计算器 进行成本估算,使用如 Vantage 这样的专业工具来监控数据库成本也是一个不错的选择。

推荐配置方式

在能力方面,AWS Aurora 几乎在每个方面都胜过 RDS。由于 Aurora 是 AWS 与其他云服务商区别开来的关键因素,AWS 也在 Aurora 上投入了更多资源。尽管 Aurora 大多数情况下与 MySQL / PostgreSQL 兼容,但它通过提供无与伦比的性价比,创造了另一种 evndor -lock-in。

对于初创企业或小型企业,Aurora 的价格仍然较高,而 RDS 是一个更经济的解决方案:

对于处于成长阶段的企业来说,Aurora 更适合,Aurora Serverless 为成本优化提供了额外的灵活性:

通常情况下,您应该从 RDS 开始,随着业务的增长再考虑迁移到 Aurora。AWS 为从 RDS 到 Aurora 的迁移提供了详尽的指南,可以实现几乎零停机时间的迁移。

最后

确定数据库产品后,剩下的任务就是制定数据库开发工作流程:

  • 开发人员如何将变更从开发阶段传播到生产阶段?
  • 如何让数据库人员高效地对 SQL 变更进行同行评审?或者使用自动 SQL 检查更好?
  • 如何执行数据访问策略以符合 PII 合规性?

如果您正在考虑这些问题,请查看 Bytebase。它是一款多合一工具,可集中异构数据库的所有人工到数据库操作。


更多资讯,请关注 Bytebase 公号:Bytebase

Aurora PostgreSQL Disaster Recovery solutions using Amazon Aurora Global Database

Aurora PostgreSQL Disaster Recovery solutions using Amazon Aurora Global Database

https://amazonaws-china.com/blogs/database/aurora-postgresql-disaster-recovery-solutions-using-amazon-aurora-global-database/


Amazon Aurora with PostgreSQL compatibility combines the performance and availability of high-end commercial databases with the simplicity and cost-effectiveness of open source databases. Aurora provides this by scaling storage across three Availability Zones in the same Region, and supports up to 15 read replica instances for scaling out read workloads and high availability within a single Region. With Amazon Aurora Global Database, you can now replicate PostgreSQL databases in up to five Regions for remote read access and disaster recovery in the event of the failure of an entire Region.

Aurora builds its storage volumes in 10-GB logical blocks called protection groups. Aurora replicates the data in each protection group across six storage nodes allocated across three Availability Zones (AZ) in the same Region, with two storage nodes in each AZ. If the volume of data exceeds the currently allocated storage, Aurora automatically expands the volume to meet the demand by adding new protection groups as necessary.

What is an Aurora Global Database?

An Aurora Global Database spans multiple Regions, provides disaster recovery from Region-wide outages and enables low-latency global reads by allowing reads from the nearest Aurora cluster.

As a feature of Aurora, Global Database uses dedicated infrastructure in Aurora’s purpose-built storage layer to handle replication across Regions. Dedicated replication servers in the storage layer handle the replication, which allows you to meet enhanced recovery and availability objectives without compromising database performance.

PostgreSQL logical replication and the storage-based replication that Aurora Global Database uses have a few key differences. Logical replication uses native PostgreSQL replication slots to record data-modifying statements or row changes on the replication source (primary) and reapply them on the replication target (replica). The primary and replica databases are separate and independent and can contain different datasets.

In contrast, Aurora Global Database employs physical storage-level replication to create a replica of the primary database with an identical dataset, which removes any dependency on the logical replication process. This eliminates overhead on your primary write server that would otherwise be required to support logical replication. The secondary Region instances of the Aurora Global Database do not replay data-modifying statements. This dramatically reduces replication overhead and leaves more capacity available for application workloads.

This means that committed transactional changes from the writer are replicated globally to the Regions that you select, typically within 1 second. While the Aurora Global Database handles this replication, the data remains durably stored in three Availability Zones in each Region of your cluster.

Why use global databases?

Aurora Global Database provides several important features:

  • Fast global failover to secondary Regions
  • Low replication lag across Regions
  • Little to no performance impact on your database
  • Up to five regional replicas with up to 16 read replicas per Region
  • Compatibility with MySQL or PostgreSQL

Fast global failover to secondary Regions

A solid disaster recovery plan allows you to place greater confidence in your business continuity plans if an unexpected event occurs. Aurora Global Database excels at two important metrics of disaster recovery:

  • Recovery time objective (RTO) – How long it takes you to return to a working state after a disaster
  • Recovery point objective (RPO) – How much data you could lose

With Aurora Global Database, RPO is less than 5 seconds—which minimizes data loss—and RTO is less than 1 minute, which reduces downtime.

Aurora Global Database provides disaster recovery and the ability to continue operating even in the face of a Region-wide failure. An Aurora Global Database quickly responds to promote a secondary Region during a potential degradation or isolation of your database. With global storage-based replication, this promoted Region can take full read/write workloads in under a minute, which minimizes the impact on application uptime.

Low replication latency across Regions

Beyond providing disaster recovery, Aurora Global Database allows you to offload reads from the primary Region to multiple secondary Regions quickly. Aurora Global Database maintains typical replication latencies of less than 1 second, with an upper bound of 5 seconds. This low latency grants global read scale-out for online transaction processing (OLTP) workloads. You can choose up to five secondary Regions for replication.

Aurora Global Database reduces latency and provides faster global client application database response times for optimal user experience and engagement by placing global replicas much closer to end-user applications. If you operate multi-region application stacks that share common configuration data, you can rely on Aurora Global Database to replicate data almost instantaneously.

If you have multiple offices around the world and a global customer base, you can upload your content in the primary Region and make it available to customers around the world with local latency.

Little to no performance impact on your database

The Aurora Global Database dedicated infrastructure in the Aurora storage layer keeps the database resources provisioned in the primary and secondary Regions fully available to serve application workloads. Aurora replication has limited to no impact on the primary database cluster’s performance.

Fast cross-Region migrations

Aurora Global Database can replicate production databases to another AWS Region for application migrations. After Aurora Global Database updates the secondary Region, you can detach the replicated database from the Aurora Global Database and operate it like any other Aurora database cluster. As soon as you connect the now-independent cluster to the Region’s application stack, it begins serving read/write workloads.

Compatibility

Aurora Global Database was previously available for Amazon Aurora with MySQL compatibility. With this change, Aurora Global Database is now available for Amazon Aurora with PostgreSQL compatibility. This first release applies to Aurora PostgreSQL 2.4, which is compatible with PostgreSQL 10.11. Because Aurora is compatible with both MySQL and PostgreSQL, application developers benefit from the familiarity and flexibility of open-source databases, even on a global scale.

Creating an Aurora Global Database

You can create an Aurora Global Database from the AWS Management Console, AWS CLI, or by running the CreateGlobalCluster action from the AWS CLI or SDK. For more information, see Creating an Aurora Global Database.

The following screenshot shows two Aurora Global Database clusters, one for MySQL and one for PostgreSQL. For the highlighted Aurora PostgreSQL Global Database, the primary cluster is in US East (N. Virginia) and the secondary cluster is in US East (Ohio). For instructions on adding secondary clusters, see Adding an AWS Region to an Aurora Global Database.

For information about removing a cluster from an Aurora Global Database, performing a failover, or importing data, see Working with Amazon Aurora Global Database.

Summary

Aurora Global Database is now available to provide regional read replicas and disaster recovery capabilities for Amazon Aurora with PostgreSQL compatibility. With this capability, global data replication is easy to implement. Disaster recovery capabilities for the failure of an entire Region is just a matter of enabling a replica for your PostgreSQL databases; AWS provides the implementation and infrastructure.

 


About the Authors

 

Richard Waymire is a Principal Outbound Architect at Amazon Web Services. He works with AWS customers to provide guidance and technical assistance on database projects, helping them improve the value of their solutions when using AWS.

 

 

 

Ahmad Elayat is a Senior Product Manager with Amazon Web Services.

 

 

Aurora Postgress 与 Aurora Mysql 中的字符串 JSON 文档

Aurora Postgress 与 Aurora Mysql 中的字符串 JSON 文档

如何解决Aurora Postgress 与 Aurora Mysql 中的字符串 JSON 文档

我需要将 JSON 文件存储到 RDS 中。

我们已经在 My sql 中尝试过,但是基于 JSON 字段的过滤或从 MysqL 显示 JSON 字段不起作用。

在转向对我们来说成本非常高的 NOsql 之前,我们想检查 Postgres 是否能够以良好的性能处理这个问题。

例如,假设我们在表中有以下值

id |  name  | age |                     more_info                    
----+--------+-----+---------------------------------------------------
  1 | Thomas |  22 | {"email": "thom22@gmail.com","country": "US"}
  2 | Jerry  |  24 | {"email": "jerrybac@gmail.com","country": "UK"}
  3 | Annie  |  21 | {"email": "anniehan@ymail.com","country": "AUS"}

如果我们想查询 id,name,age,more_info.country 可以吗? 我们可以在这个表中索引 more_info 吗?

根据专家经验,是否建议将 Postgres 用于 JSON。 我们确实有两列是 jsonb 类型。

此表中的记录数超过 20 亿。

解决方法

您可以通过不同的方式查询特定的国家,它们将需要不同的索引来加快搜索速度(我假设该列定义为jsonb

您可以在整个 JSON 值上创建 GIN 索引:

create index on the_table using gin(more_info jsonb_path_ops);

上述索引可以支持包含操作符@>

因此以下查询可以使用该索引:

select *
from the_table
where more_info @> ''{"country": "AUS"}''

select *
from the_table
where more_info @> ''{"email": "thom22@gmail.com"}''

或者使用运算符类 jsonb_ops 可以使用 supports 多个运算符,但速度有点慢。

与 B-Tree 索引相比,GIN 索引更大,维护起来更慢。如果您知道要查询的特定键,则该键上的 B 树索引可能会更有效:

create index on the_table using gin( (more_info ->> ''country'') );

该索引可由以下查询使用:

select *
from the_table
where more_info ->> ''country'' = "AUS";

请注意,此方法要求您要查询的每个键都有一个索引。而 GIN 索引可以支持任何使用 @> 的查询。

由于 GIN 索引是一种支持多种表达式的“多用途”索引,因此它可能不如专用 B 树索引高效和快速。您需要对您的数据和查询进行试验,看看哪个表现更好。

AWS Aurora mysql 数据库非常慢,然后 AWS RDS Mysql

AWS Aurora mysql 数据库非常慢,然后 AWS RDS Mysql

如何解决AWS Aurora mysql 数据库非常慢,然后 AWS RDS Mysql

我们在本地 MysqL 5.7 版中有现有数据,并计划在 AWS 上移动应用程序和数据库。我们提供了一个 RDS MysqL 数据库和一个 aurora MysqL 数据库,并将应用程序连接到两台服务器。我们将执行时间保存在数据库中,因此我们发现 RDS MysqL 的运行速度是 aurora 数据库的 2 倍。 AWS 声称 aurora 数据库的性能比 RDS MysqL 快 5 倍,但这似乎是不正确的。 请建议 aurora db 是否需要任何调整。

两个数据库的系统配置:db.r6g.large(2cpu 和 16 GB RAM)

注意:将数据库列 prodQueryTime 称为“MysqL 性能时间”,将 ExperimentQueryTime 称为“aurora DB 性能时间”

解决方法

有许多与您类似的报告,例如here。答案是这取决于你做什么。 AWS 代表写道:

要记住的最重要的方面是,Aurora 针对并发工作负载进行了优化,最好通过运行并行基准测试来评估其优势

关于无法在 Java 中使用 RDS 连接到 MySQL/Aurora:路径不与任何信任锚链接java不能连接至vm的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于Amazon Aurora 和 RDS 选哪个?工程师视角八大关键维度全方位对比指南、Aurora PostgreSQL Disaster Recovery solutions using Amazon Aurora Global Database、Aurora Postgress 与 Aurora Mysql 中的字符串 JSON 文档、AWS Aurora mysql 数据库非常慢,然后 AWS RDS Mysql等相关知识的信息别忘了在本站进行查找喔。

本文标签: