我正在运行一个 ansible 剧本。运行ansible的机器是localhost。
该剧本在将数据从大 csv (1.2 GB) 加载到 postgres 数据库表(模块community.postgresql.postgresql_copy )的任务期间中断。
中断执行的任务(在本地主机上运行)是:
- name: Load data from CSV into table
community.postgresql.postgresql_copy:
login_host: '{{ db_host }}'
login_user: '{{ db_username }}'
login_password: '{{ db_password }}'
db: '{{ db_database }}'
port: '{{ db_database_port }}'
copy_from: "{{ path }}/my_big_csv_file.csv"
dst: "{{ my_table }}"
options:
format: csv
delimiter: ';'
header: yes
提出的错误是:
msg: Cannot execute SQL 'COPY "my_table" FROM '/path/my_big_csv_file.csv' (format csv, delimiter ';', header True)': ERROR: Could not extend file "base/16385/45444.1": only 4096 bytes of 8192 written in block 165767
HINT: Check free disk space.
CONTEXT: COPY my_table, line 9615264
我做了一些研究,我在这个线程中读到,当磁盘空间不足时会出现此错误。
然而,我已经跑了
df -h --output=avail .
在本地主机上,在源 csv 所在的文件夹中,并84G
作为输出获取。
那么可能是什么问题呢?