2016-07-01 5 views
0

まだいくつかのセッションに接続されているHAWQインスタンスを停止すると、「hawq stop -a」で停止することはできません。"hawq stop -M immediate"と "hawq stop -M fast"の違いは何ですか?

$ hawq stop cluster -a 
20160701:10:02:09:032804 hawq_stop:ChunlingdeMacBook-Pro:wangchunling-[INFO]:-Prepare to do 'hawq stop' 
20160701:10:02:09:032804 hawq_stop:ChunlingdeMacBook-Pro:wangchunling-[INFO]:-You can find log in: 
20160701:10:02:09:032804 hawq_stop:ChunlingdeMacBook-Pro:wangchunling-[INFO]:-/Users/wangchunling/hawqAdminLogs/hawq_stop_20160701.log 
20160701:10:02:09:032804 hawq_stop:ChunlingdeMacBook-Pro:wangchunling-[INFO]:-GPHOME is set to: 
20160701:10:02:09:032804 hawq_stop:ChunlingdeMacBook-Pro:wangchunling-[INFO]:-/usr/local/hawq 
20160701:10:02:09:032804 hawq_stop:ChunlingdeMacBook-Pro:wangchunling-[INFO]:-Stop hawq with args: ['stop', 'cluster'] 
20160701:10:02:09:032804 hawq_stop:ChunlingdeMacBook-Pro:wangchunling-[INFO]:-No standby host configured 
20160701:10:02:09:032804 hawq_stop:ChunlingdeMacBook-Pro:wangchunling-[INFO]:-Stop hawq cluster 
20160701:10:02:09:032804 hawq_stop:ChunlingdeMacBook-Pro:wangchunling-[INFO]:-There are 1 connections to the database 
20160701:10:02:09:032804 hawq_stop:ChunlingdeMacBook-Pro:wangchunling-[WARNING]:-There are other connections to this instance, shutdown mode smart aborted 
20160701:10:02:09:032804 hawq_stop:ChunlingdeMacBook-Pro:wangchunling-[WARNING]:-Either remove connections, or use 'hawq stop master -M fast' or 'hawq stop master -M immediate' 
20160701:10:02:09:032804 hawq_stop:ChunlingdeMacBook-Pro:wangchunling-[WARNING]:-See hawq stop --help for all options 
20160701:10:02:09:032804 hawq_stop:ChunlingdeMacBook-Pro:wangchunling-[ERROR]:-Active connections. Aborting shutdown... 

"hawq stop -M immediate"と "hawq stop -M fast"の違いは何ですか?

答えて

1

-M fast

高速シャットダウン。進行中のトランザクションは中断され、ロールバックされます。

-M即時

即時シャットダウン。進行中のトランザクションはすべて中止されます。このモードは、データベースサーバがトランザクション処理を完了することを許可せずに、すべてのpostgresプロセスを強制終了するか、一時的なプロセス中のプロセスファイルをクリーンアップします。ここで

はHAWQ文書のリンクです:http://hdb.docs.pivotal.io/20/reference/cli/admin_utilities/hawqrestart.html

+0

http://hdb.docs.pivotal.io/20/reference/cli/admin_utilities/hawqrestart.html –

+0

ありがとうございます! –

1

即時シャットダウンは推奨されません。場合によっては、手動リカバリが必要なデータベースの破損を引き起こす可能性があります。 @Wen Linが指摘しているように、http://hdb.docs.pivotal.io/20/reference/cli/admin_utilities/hawqrestart.htmlというリンクを参照することができます。

"hawq stop cluster -a -M fast"を使用するか、 "pg_cancel_backend()"を使用してから "hawq stop cluster -a"を実行することをお勧めします。

1

内部的には、stopはシグナルをpostgresプロセスに送信するだけです。異なるストップモードは、異なる信号を意味します。

スマートモード:SIGTERM

高速モード:SIGINT

即時モード:SIGQUIT

関連する問題