2013-10-05 36 views
1

我正在這個Heroku tutorial和我有一個關於autovacuum過程的問題。目前還沒有表格或數據,並且自動清理髮射器掛了半個多小時。以下是cmd窗口。Postgresql:日誌:自動清理啓動器掛起(顯然)

我找到了一個類似的question here,但找不到答案。有誰知道發生了什麼事?

作爲總結:LOG: autovacuum launcher started光標在最後一行下閃爍,但沒有什麼是happenning半小時以上的最後一行之後。

C:\Users\a>initdb pg 
The files belonging to this database system will be owned by user "a". 
This user must also own the server process. 

The database cluster will be initialized with locale "English_United States.1252 
". 
The default database encoding has accordingly been set to "WIN1252". 
The default text search configuration will be set to "english". 

Data page checksums are disabled. 

initdb: directory "pg" exists but is not empty 
If you want to create a new database system, either remove or empty 
the directory "pg" or run initdb 
with an argument other than "pg". 

C:\Users\a>postgres -D pg & 
LOG: database system was interrupted; last known up at 2013-10-05 13:46:39 EDT 
LOG: database system was not properly shut down; automatic recovery in progress 

LOG: record with zero length at 0/17704F8 
LOG: redo is not required 
LOG: database system is ready to accept connections 
LOG: autovacuum launcher started 

編輯

正如bma的意見建議,我刪除了pg目錄和項目目錄,我又做了同樣的步驟,我得到了相同的結果:LOG: autovacuum launcher started和它掛起。我錯了什麼?


編輯

我打開了一個新的命令窗口,並啓動了REPL那裏,我能夠執行

C:\Users\a\CLOJURE\shouter>lein repl 

user=> (require '[clojure.java.jdbc :as sql]) 
nil 

但下一個命令提供了以下錯誤:

user=> (sql/with-connection (System/getenv "DATABASE_URL") 
    #_=>   (sql/create-table :testing [:data :text])) 


user=> IllegalArgumentException db-spec null is missing a required parameter cl 
ojure.java.jdbc/get-connection (jdbc.clj:192) 

我該如何解決這個問題?


編輯

原來, '出口' 是UNIX和Windows中我需要使用 '設置'。請參閱related question

+2

是不是隻是日誌輸出?除非有別的事情要記錄,爲什麼會這樣呢?你能看到自動清理過程是否正在運行?看起來你的步驟在那裏,它看起來像你需要刪除「pg」目錄並重試你的步驟 - 我猜這至少是你第二次嘗試這些步驟與相同的目錄名爲「 PG」。 – bma

+0

你說得對,這是第二次。我想我不明白'postgres -D pg&'的作用。我甚至找不到「D」代表什麼?我如何刪除「pg」目錄? – Zeynel

+0

我在這裏找到了一些信息https://forum.linode.com/viewtopic.php?p=49670,但我仍然不明白髮生了什麼... – Zeynel

回答

2

發生什麼事是你直接用pg目錄啓動postgres,並看到日誌輸出。最好在Windows上將它作爲服務安裝,並使用默認的數據目錄。這是正常的安裝程序所做的。

然而,你現在的方法只會運行分貝,直到你關閉終端窗口,它將死在哪一點(因此在開始恢復)。你沒有掛過程。這只是日誌輸出。