Skip to Content
CockroachDB:权威指南
book

CockroachDB:权威指南

by Guy Harrison, Jesse Seldess, Ben Darnell
May 2025
Intermediate to advanced
488 pages
6h 44m
Chinese
O'Reilly Media, Inc.
Content preview from CockroachDB:权威指南

第 14 章 管理和故障排除 管理和故障排除

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

在前几章中,我们向你介绍了如何为 CockroachDB 平台设计和实施应用程序,以及如何在完全托管的云平台(CockroachDB Dedicated 和 Serverless)上创建 CockroachDB 部署,或者在自己的硬件或公共云上自托管实施。

现在,你已经实施了 CockroachDB 应用程序,CockroachDB 集群也已就位,是时候考虑日常管理和配置任务了,这些任务都是保持 CockroachDB 部署健康、愉快运行所必需的。

我们将把最重要的任务之一--集群优化--留到最后一章,因为该主题足够深入,需要单独成章。

请注意,虽然这些任务中的很多都是自托管部署才需要的,但即使是CockroachDB专用云或无服务器云集群也需要一些细心和关注。选择 CockroachDB Cloud 选项可以大大减少你的管理开销;不过,仍有一些故障排除和配置任务,我们将在本章中介绍。

监测

生产系统需要某种形式的监控软件,以确保系统健康、响应迅速,并收集性能和利用率指标,以便进行长期规划。如果没有监控系统,您可能不知道数据库是否已停止响应请求。此外,您可能无法检测到缓慢移动的性能或容量问题。有了好的监控系统,如果数据库发生故障或出现需要注意的问题,您就会立即得到通知。您将掌握相关指标,从而预测未来的资源需求。

好的监控解决方案应同时支持检测和诊断功能:

  • 监控系统会发现问题,并将问题通知相关人员。

  • 监控系统将收集足够的信息,以便管理员确定问题的根本原因。

监测系统还可以提供解决工具,帮助纠正问题,并提供预测功能,在问题出现之前预测其苗头。

CockroachDB 专用警报

CockroachDB 专用群集可在超过特定利用率阈值时发送 电子邮件警报。这些功能可在群集仪表板的 "警报 "页面上启用(图 14-1)。

这些警报通常表明您的群集已接近其容量。您可以通过调整工作负载(如第 8 章和其他章节所述)或扩展群集来减少需求。

Cockroach CloudAlert
图 14-1. 配置 CockroachDB 专用警报(大幅面版本)

CockroachDB 无服务器警报

CockroachDB专用集群可以访问警报页面。对于 CockroachDB Serverless(测试版)集群,,当集群的花费上限、突发容量或存储上限达到 50%、75% 和 100%时,所有控制台管理员都会自动收到电子邮件提醒。

您可以对这些警报做出反应,要么提高支出限额以避免资源节流启动时出现性能下降,要么调整工作负载以减少需求--例如,按照 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Nanosatellites

Nanosatellites

Rogerio Atem de Carvalho, Jaime Estela, Martin Langer
Trino:权威指南,第二版

Trino:权威指南,第二版

Matt Fuller, Manfred Moser, Martin Traverso
软件工程基础

软件工程基础

Nathaniel Schutta, Dan Vega

Publisher Resources

ISBN: 9798341659186