2016-07-01 13 views
0

Wenn ich eine HAWQ-Instanz stoppe, die immer noch mit einigen Sitzungen verbunden ist, kann sie nicht mit "hawq stop -a" aufhören.Was ist der Unterschied zwischen "hawq stop -M sofort" und "hawq stop -M schnell"?

$ 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... 

Also, was ist der Unterschied zwischen "hawq zu stoppen -M sofort" und "hawq zu stoppen -M schnell"?

Antwort

1

-M schnell

Schnell heruntergefahren. Alle laufenden Transaktionen werden unterbrochen und zurückgesetzt.

-M sofort

Sofortige Abschaltung. Alle laufenden Transaktionen werden abgebrochen. Dieser Modus beendet alle Postgres-Prozesse, ohne dass der Datenbankserver die Transaktionsverarbeitung abschließen oder temporäre oder in Arbeit befindliche Arbeitsdateien bereinigen kann. Hier

ist die Verbindung von HAWQ Dokumente: 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

Vielen Dank für das Hinweis! –

1

sofortiges Abschalten wird nicht empfohlen. In einigen Fällen kann dies zu Datenbankfehlern führen, die eine manuelle Wiederherstellung erfordern. Sie können sich auf die Dokumentation im Link http://hdb.docs.pivotal.io/20/reference/cli/admin_utilities/hawqrestart.html als @Wen Lin beziehen.

Als Alternative wird empfohlen, entweder "hawq stop cluster -a -M schnell" oder "pg_cancel_backend()" zu verwenden, dann "hawq stop cluster -a".

1

Intern ist Stop nur Signal an Postgres Prozess senden. Unterschiedliche Stopp-Modi bedeuten unterschiedliches Signal.

Smart-Modus: SIGTERM

schnellen Modus: SIGINT

unmittelbaren Modus: SIGQUIT