当我启动docker-compose时,我收到以下消息:
event_bot-db-1 | performing post-bootstrap initialization ... sh: locale: not found
event_bot-db-1 | 2022-10-02 08:05:59.279 UTC [30] WARNING: no usable system locales were found
event_bot-db-1 | 2022-10-02 08:06:00.195 UTC [30] FATAL: could not extend file "base/1/13587": No space left on device
event_bot-db-1 | 2022-10-02 08:06:00.195 UTC [30] HINT: Check free disk space.
event_bot-db-1 | 2022-10-02 08:06:00.195 UTC [30] CONTEXT: COPY sql_features, line 714
event_bot-db-1 | 2022-10-02 08:06:00.195 UTC [30] STATEMENT: COPY information_schema.sql_features (feature_id, feature_name, sub_feature_id, sub_feature_name, is_supported, comments) FROM E'/usr/local/share/postgresql/sql_features.txt';
event_bot-db-1 |
event_bot-db-1 | 2022-10-02 08:06:00.197 UTC [30] PANIC: could not write to file "pg_logical/replorigin_checkpoint.tmp": No space left on device
event_bot-db-1 | child process was terminated by signal 6: Aborted
event_bot-db-1 | initdb: removing contents of data directory "/var/lib/postgresql/data"
df-h的结果:
root@vm1948022:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 460M 0 460M 0% /dev
tmpfs 98M 628K 98M 1% /run
/dev/vda2 39G 6.5G 30G 18% /
tmpfs 489M 0 489M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 489M 0 489M 0% /sys/fs/cgroup
tmpfs 98M 0 98M 0% /run/user/0
看起来在数据库初始化期间创建的临时文件填满了所有系统内存。IDK如何修复它。
docker-compose.yml:
version: '3.7'
services:
app:
build: .
command: bash -c "make migrate && python3 -m app"
env_file:
- ./.env
depends_on:
- db
- redis
restart: always
db:
image: postgres:14-alpine
env_file:
- ./.env
volumes:
- pgdata:/var/lib/postgresql/data
restart: on-failure
ports:
- "5432:5432"
redis:
image: redis:alpine
restart: on-failure
ports:
- "6379:6379"
volumes:
pgdata:
1条答案
按热度按时间ddrv8njm1#
你可以在启动docker compose之前运行
docker system prune
,这将回收你机器上的大量空间。