When restarting the Postgre error, the solution (caused by too much space in the backup file) (Linux command df-h view disk space) __linux

Source: Internet
Author: User

This is where you use a LIUNX command to view disk space

Df:disk Free http://www.cnblogs.com/chenwenbiao/archive/2011/08/07/2129831.html

Common parameters: Df-h

-------------------------------------

1. Restart the Postgre under Linux

Pg_ctl Restart (postgres user)

Today's problems

Because the data is imported, the database keeps generating backup files, which fills up the space

Cannot continue to boot.

Workaround:

The directory structure where the backup files reside

Root

Databases

Archieves

Data

Pg_xlog

Archive_status

(archieves archives; documents; records)

Delete the data backup files below these directories

-------------------------------------------------------------------------------

Error Phenomenon

Execute pg_ctl Restart command

Error

Could not change directory to "/root"

Pg_ctl:pid file "/database/data/postmaster.pid" does not exist

the reason for this problem arises

Not because the directory does not have this file, but because the disk space is too small

When the process executes, there is not enough room to read the file.

Use the Postgres user to execute the following command

Df-h can view the usage of the database's space

FileSystem size used avail use% mounted on

/dev/sda3 70 70 0 100/

The process does not have enough space to run, so there are errors above

----------------------------------------------------

problem arises

Inserting data into the postgre using stored procedures

Inserts 100,000 data at a time, resulting in more than n backup files in those directories above

These backup files consume a lot of disk space

When this batch command is last executed

Console error, said that there is not enough disk space, then this side will no longer connect to the database

View the process and discover that the Postgre process has stopped

When you reboot, you report the error above.

Could not change directory to "/root"

Pg_ctl:pid file "/database/data/postmaster.pid" does not exist

----------------------------------------

Note:

What's eating the disk space?

Is the huge amount of disk space that the backup file eats up.

In fact, that millions of data does not occupy how much disk space

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.