DataStax OpsCenter for Cassandra - 为什么存储容量小部件报告的磁盘使用情况与“数据大小”指标不同?
存储容量小部件显示已使用 38.96 TB,但“数据大小”(数据负载)指标图表(针对“集群范围”)显示已使用 14.30 TB。该集群有两个数据中心,所有表的 RF 均为 3。
这是存储容量小部件的示例图像
删除列操作是否可扩展?
以前,我们在更新大量记录时遇到问题,因为它占用了更多空间。
删除列操作是否就是这种情况?
一个数据库模式设计问题:
假设我想设计一个包含机器人、技术人员和站点的数据库。
我想使用我的数据库约束来限制数据,以防止输入一些无意义的情况。
例如,我制造了一个机器人;当我把他租出去时,我会把他分配并运送到一个站点。
我在数据库中输入一条记录 - 机器人只能位于一个站点,因此我可以为机器人表提供一个可以为空的 SiteID 外键字段来表示该限制。然后,任何机器人都不能分配给数据库中的两个站点。
create table Sites (
SiteID int not null,
Name varchar(1024) not null,
primary key (SiteID)
);
create table Robots (
RobotID int not null,
SiteID int nullable,
primary key (RobotID),
constraint 'fk_robots_sites_siteid' foreign key (SiteID) references Sites(SiteID)
);
目前很好。
所以现在我想将技术人员添加到我的数据库中:
create table Technicians (
TechnicianID int not null,
name varchar(1024) not null,
primary key (TechnicianID)
);
如果...我想让我的一些机器人充当我的技术人员的司机怎么办?然后,机器人可以被分配给站点或技术人员 - 但不能同时分配给两者。
我不知道如何在架构中实现这个约束。
建议?
我使用 MariaDB,并且需要通用查询日志来调试我的应用程序数据库语句。我想知道 ID 列实际上意味着什么?是连接ID吗?
我尝试在 CentOS Stream 虚拟机上将 MariaDB 服务器从 10.3 更新到 10.11.7。
我使用了以下语句:
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-10.11"
sudo yum update mariadb-server
sudo systemctl restart mariadb
这给我带来了以下错误systemctl status mariadb.service
:
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] InnoDB: No valid checkpoint was found; the log was created with MariaDB 10.3.28.
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [Note] InnoDB: Starting shutdown...
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [Note] Plugin 'FEEDBACK' is disabled.
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] Unknown/unsupported storage engine: InnoDB
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] Aborting
May 13 10:32:34 Dev-DB systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
May 13 10:32:34 Dev-DB systemd[1]: mariadb.service: Failed with result 'exit-code'.
May 13 10:32:34 Dev-DB systemd[1]: Failed to start MariaDB 10.11.7 database server.
使用journalctl -xe
我得到以下输出:
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] InnoDB: Obtaining redo log encryption key version 1 failed (4294967295). Maybe the key or the required encryption key management plugin was not found.
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] InnoDB: Reading checkpoint encryption info failed.
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] InnoDB: Obtaining redo log encryption key version 1 failed (4294967295). Maybe the key or the required encryption key management plugin was not found.
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] InnoDB: Reading checkpoint encryption info failed.
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] InnoDB: No valid checkpoint was found; the log was created with MariaDB 10.3.28.
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [Note] InnoDB: Starting shutdown...
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [Note] Plugin 'FEEDBACK' is disabled.
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] Unknown/unsupported storage engine: InnoDB
May 13 10:32:34 Dev-DB mariadbd[1158171]: 2024-05-13 10:32:34 0 [ERROR] Aborting
我已经尝试过此线程的解决方案Getting error "Plugin 'InnoDB' Registration as a STORAGE ENGINE failed" when Starting MySQL:到目前为止我已经尝试过:
这两个选项都没有解决我的问题。
我该如何解决这个问题?
目前,我们在单个 postgres 实例中托管多个数据库。
我们希望限制该数据库实例中特定数据库/用户的 CPU 使用率。
是否可以在 postgres 中进行这些资源管理操作?
PostgreSQL 咨询锁中的密钥空间是所连接的数据库私有的,还是在数据库集群中共享的?
四处搜寻https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS和https://www.postgresql.org/docs/current/explicit-locking.html#ADVISORY- LOCKS的答案似乎并不明显。
在这里的示例中:https://www.percona.com/blog/postgresql-column-alignment-and-padding-how-to-improve-performance-with-smarter-table-design/
为什么 PostgreSQL 不在int2
in之后添加 2 个字节填充t2
以正确对齐单词?
我有一些关于 Azure 故障转移的基本问题。我是故障转移新手。我一直在阅读文献,我准备尝试一下。在我尝试之前,我想更好地了解它是如何运作的。
我们在一个区域的服务器上有一个主数据库,我们将该服务器称为 DBPrime。我们最近在不同区域的服务器上创建了只读副本。我们的第一步是将读取工作负载卸载到只读副本。我们将该服务器称为 DBRead。
我们现在要采取下一步并设置故障转移。如果我正确理解文献,我不需要第三台服务器来进行故障转移。相反,我可以使用只读副本服务器作为故障转移的备用服务器吗?
这是我对触发故障转移时会发生什么的理解。请告诉我我对这些陈述的理解是否正确,或者是否理解不正确。
(我们可以单独讨论退出故障转移时会发生什么。但是,在我了解进入故障转移模式时会发生什么之前,讨论这个问题是没有意义的。)
感谢您的建议!
例如,如何在 shell 本身中按“Column”中的值对下面的输出进行排序psql
?
my_db=> \d auth_user
Table "public.auth_user"
Column | Type | Collation | Nullable | Default
--------------+--------------------------+-----------+----------+---------------------------------------
id | integer | | not null | nextval('auth_user_id_seq'::regclass)
is_superuser | boolean | | not null |
username | character varying(150) | | not null |
first_name | character varying(150) | | |
last_name | character varying(150) | | not null |
email | character varying(254) | | |
is_staff | boolean | | not null | false
is_active | boolean | | not null | false
password | character varying(128) | | |
last_login | timestamp with time zone | | |
date_joined | timestamp with time zone | | |
Indexes:
"auth_user_pkey" PRIMARY KEY, btree (id)
"auth_user_username_6821ab7c_like" btree (username varchar_pattern_ops)
"auth_user_username_key" UNIQUE CONSTRAINT, btree (username)
我知道这在 shell 之外很容易做到psql
,例如在 Bash 中,
$ psql -U postgres -h localhost -d my_db -c '\d auth_user' | grep '^.*|' | sort -t'|' -k1
Column | Type | Collation | Nullable | Default
date_joined | timestamp with time zone | | |
email | character varying(254) | | |
first_name | character varying(150) | | |
id | integer | | not null | nextval('auth_user_id_seq'::regclass)
is_active | boolean | | not null | false
is_staff | boolean | | not null | false
is_superuser | boolean | | not null |
last_login | timestamp with time zone | | |
last_name | character varying(150) | | not null |
password | character varying(128) | | |
username | character varying(150) | | not null |
但我很好奇这是否可以完成psql
。