Docker死亡执行JDBC查询

发布于 2025-02-09 01:32:03 字数 861 浏览 2 评论 0原文

我正在Docker中运行一个Spring Boot项目,并且正在执行以下JDBC代码:

SqlRowset rowset = jdbcTemplate.queryForRowSet(queryString);

查询字符串如下:

SELECT * 
FROM tableName 
WHERE timestamp >= '2022-04-03 01:00:00.000000 -0700' 
AND timestamp <= '2022-04-13 01:59:59.999999 -0700' 
ORDER BY timestamp 
LIMIT 2500 
OFFSET 0

在通过JDBC执行此查询时,Docker容器死亡和删除。我还有其他疑问可以正常工作,但是由于某种原因,这个日期包括杀死Docker机器。只是想知道是否有人知道为什么会发生这种情况?

在Docker容器中吐出的最后一个日志是:

2022-06-20 19:56:00,985 DEBUG org.springframework.jdbc.core.JdbcTemplate : 
Executing SQL query 
[SELECT * FROM tableName WHERE timestamp >= '2022-04-03 01:00:00.000000 -0300' AND timestamp <= '2022-04-13 01:59:59.999999 -0300' ORDER BY timestamp LIMIT 2500 OFFSET 0]

I'm running a spring boot project in docker and I'm executing the following JDBC code:

SqlRowset rowset = jdbcTemplate.queryForRowSet(queryString);

The query string is the following:

SELECT * 
FROM tableName 
WHERE timestamp >= '2022-04-03 01:00:00.000000 -0700' 
AND timestamp <= '2022-04-13 01:59:59.999999 -0700' 
ORDER BY timestamp 
LIMIT 2500 
OFFSET 0

While executing this query through JDBC the docker container dies and deletes. I have other queries that work fine but for some reason this one that has dates included kills the docker machine. Just wondering if anyone knows why this would be happening?

The last log that gets spit out in the docker container is:

2022-06-20 19:56:00,985 DEBUG org.springframework.jdbc.core.JdbcTemplate : 
Executing SQL query 
[SELECT * FROM tableName WHERE timestamp >= '2022-04-03 01:00:00.000000 -0300' AND timestamp <= '2022-04-13 01:59:59.999999 -0300' ORDER BY timestamp LIMIT 2500 OFFSET 0]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

猫七 2025-02-16 01:32:03

我弄清楚了什么问题。我的环境文件中的码头容器没有足够的内存分配。

我遵循链接@EOL提供的指示:

您可以尝试更改入口点以使容器运行,即使在弹簧应用崩溃之后。然后,您应该能够看到真正发生的事情。例如:


我删除了我们的标签以在故障时卸下Docker容器。

我已经进入容器,并进行了一些调查。我在状态“ oomkill”中发现了一个失误的错误:“ true”。这使我得出了一个结论,即记忆未分配到我们需要的大小。

I figured out what was wrong. There wasn't enough memory being allocated for the Docker container in my environment file.

I followed the directions in the link @eol provided:

You can try and change the entrypoint to keep the container running even after your spring-app crashes. You should then be able to see what's really going on. Check this for example: Keep Your Docker Container Running for Debugging

I removed our tag to remove the Docker container on a failure.

I SSH'd into the container and did some investigation. I discovered an out-of-memory error in the status "OOMKilled": "true". This led me to the conclusion that memory wasn't allocated to the size we needed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文