【发布时间】:2020-12-04 02:19:26
【问题描述】:
我用一些重要的选项启动 mariadb docker
--connect_timeout 43200 --max_allowed_packet 1073741824 --net_read_timeout 100 --innodb_buffer_pool_size 64M
我的 wokrbench 也增加了超时时间
但经过大量实验后,我仍然收到丢失的连接。
下面我放置了我的 SQL 命令产生的错误。这是另一个工作的 mariadb 服务器的转储,但没有 docker。
DROP TABLE IF EXISTS `AspNetUsers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AspNetUsers` (
`Id` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
`UserName` varchar(256) CHARACTER SET utf8mb4 DEFAULT NULL,
`NormalizedUserName` varchar(256) CHARACTER SET utf8mb4 DEFAULT NULL,
`Email` varchar(256) CHARACTER SET utf8mb4 DEFAULT NULL,
`NormalizedEmail` varchar(256) CHARACTER SET utf8mb4 DEFAULT NULL,
`EmailConfirmed` tinyint(1) NOT NULL,
`PasswordHash` longtext CHARACTER SET utf8mb4 DEFAULT NULL,
`SecurityStamp` longtext CHARACTER SET utf8mb4 DEFAULT NULL,
`ConcurrencyStamp` longtext CHARACTER SET utf8mb4 DEFAULT NULL,
`PhoneNumber` longtext CHARACTER SET utf8mb4 DEFAULT NULL,
`PhoneNumberConfirmed` tinyint(1) NOT NULL,
`TwoFactorEnabled` tinyint(1) NOT NULL,
`LockoutEnd` datetime(6) DEFAULT NULL,
`LockoutEnabled` tinyint(1) NOT NULL,
`AccessFailedCount` int(11) NOT NULL,
`DiscordId` longtext CHARACTER SET utf8mb4 DEFAULT NULL,
`DiscordEnabled` tinyint(1) NOT NULL,
`DiscordServerId` longtext CHARACTER SET utf8mb4 DEFAULT NULL,
`IsGoogleAuthenticatorEnabled` tinyint(1) NOT NULL,
`GoogleAuthenticatorSecretKey` longtext CHARACTER SET utf8mb4 DEFAULT NULL,
`IPAddress` longtext CHARACTER SET utf8mb4 DEFAULT NULL,
`UserAgent` longtext CHARACTER SET utf8mb4 DEFAULT NULL,
`ResetDone` tinyint(1) NOT NULL,
`APIKey` char(36) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `UserNameIndex` (`NormalizedUserName`),
KEY `EmailIndex` (`NormalizedEmail`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
这是容器的日志
2020-12-04 1:49:02 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2020-12-04 1:49:02 0 [Note] InnoDB: Initializing buffer pool, total size = 67108864, chunk size = 67108864
2020-12-04 1:49:02 0 [Note] InnoDB: Completed initialization of buffer pool
2020-12-04 1:49:02 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-12-04 1:49:02 0 [Note] InnoDB: 128 rollback segments are active.
2020-12-04 1:49:02 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-12-04 1:49:02 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-12-04 1:49:02 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-12-04 1:49:02 0 [Note] InnoDB: 10.5.8 started; log sequence number 67060; transaction id 71
2020-12-04 1:49:02 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-12-04 1:49:02 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-12-04 1:49:02 0 [Note] InnoDB: Buffer pool(s) load completed at 201204 1:49:02
2020-12-04 1:49:02 0 [Note] Server socket created on IP: '::'.
2020-12-04 1:49:02 0 [Warning] 'proxies_priv' entry '@% root@f29788dfc1fd' ignored in --skip-name-resolve mode.
2020-12-04 1:49:02 0 [Note] Reading of all Master_info entries succeeded
2020-12-04 1:49:02 0 [Note] Added new Master_info '' to hash table
2020-12-04 1:49:02 0 [Note] mysqld: ready for connections.
Version: '10.5.8-MariaDB-1:10.5.8+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
2020-12-04 4:00:53 4 [Warning] Aborted connection 4 to db: 'YYYYYYY' user: 'root' host: 'XX.XX.XX.XX' (Got timeout reading communication packets)
有人了解会发生什么吗?
【问题讨论】:
-
我们可以查看您的 docker 文件/docker-compose.yml 吗?您收到的确切错误/丢失连接消息是什么?
-
innodb_buffer_pool_size 64M太小了。你有多少内存。如果可能,从 1G 开始。显示来自 docker 容器的日志。 -
@mikey,我根本无法通过 YML 启动 maria db,只能通过命令行,如果我通过 YML 启动,我总是收到 [ERROR] mysqld: Got error 'Can't open file' when试图使用 aria 控制文件 '/var/lib/mysql/aria_log_control' [错误] InnoDB:innodb_system 数据文件 'ibdata1' 必须是可写的 [错误] 插件 'InnoDB' 注册为存储引擎失败。
-
@danblack 我从 docker 开始。本机整机有4GB RAB
标签: mysql docker timeout mysql-workbench