Restart postgresql
Z Net47 2.0
(Różnice między wersjami)
| (Nie pokazano 2 wersji utworzonych przez 2 użytkowników) | |||
| Linia 1: | Linia 1: | ||
Opis krok po kroku zrestartowania '''postgresql'''. | Opis krok po kroku zrestartowania '''postgresql'''. | ||
| + | |||
| + | '''Przedstawiona metoda dotyczy tylko wersji net47 przeznaczoną na system operacyjny FEDORA''' | ||
==Krok po kroku== | ==Krok po kroku== | ||
| − | === | + | ===Sprawdzamy czy mamy zamontowany ramdisk.=== |
====Wykonujemy polecenie==== | ====Wykonujemy polecenie==== | ||
<pre>df -h</pre> | <pre>df -h</pre> | ||
| Linia 12: | Linia 14: | ||
W pliku '''/etc/fstab''' zwiększyć ilość przydzielonego ramu. Należy pamiętać, aby odpowiednia ilość ram-u była dostępna. | W pliku '''/etc/fstab''' zwiększyć ilość przydzielonego ramu. Należy pamiętać, aby odpowiednia ilość ram-u była dostępna. | ||
| − | === | + | ===Jeżeli nie ma ramdisk.=== |
Sprawdzamy czy w pliku '''/etc/fstab''' istnieje wpis: | Sprawdzamy czy w pliku '''/etc/fstab''' istnieje wpis: | ||
<pre>none /var/lib/pgsql/data/ramdisk tmpfs defaults,size=128m 1 2 </pre> | <pre>none /var/lib/pgsql/data/ramdisk tmpfs defaults,size=128m 1 2 </pre> | ||
| Linia 18: | Linia 20: | ||
<pre>reboot</pre> | <pre>reboot</pre> | ||
| − | === | + | ===Jeżeli mamy ramdisk i istnieje wpis w pliku /etc/fstab=== |
====Restartujemy postgres'a==== | ====Restartujemy postgres'a==== | ||
<pre>systemctl restart postgresql.service</pre> | <pre>systemctl restart postgresql.service</pre> | ||
| Linia 24: | Linia 26: | ||
<pre>systemctl restart net47-postgresqlramdisk.service </pre> | <pre>systemctl restart net47-postgresqlramdisk.service </pre> | ||
| − | === | + | ===Sprawdzenie czy restart wykonał się poprawnie.=== |
====Polecenie==== | ====Polecenie==== | ||
<pre>systemctl status postgresql.service </pre> | <pre>systemctl status postgresql.service </pre> | ||
| Linia 86: | Linia 88: | ||
lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: CREATE FUNCTION | lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: CREATE FUNCTION | ||
lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: GRANT</pre> | lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: GRANT</pre> | ||
| − | |||
| − | |||
Aktualna wersja na dzień 12:26, 11 lip 2022
Opis krok po kroku zrestartowania postgresql.
Przedstawiona metoda dotyczy tylko wersji net47 przeznaczoną na system operacyjny FEDORA
Spis treści |
[edytuj] Krok po kroku
[edytuj] Sprawdzamy czy mamy zamontowany ramdisk.
[edytuj] Wykonujemy polecenie
df -h
[edytuj] Sprawdzamy czy mamy ramdisk tzn. czy istnieje wpis:
none 128M 744K 128M 1% /var/lib/pgsql/data/ramdisk
Zajętość to indywidualna kwestia każdego użytkownika.
[edytuj] Jeżeli osiągniemy 100% zajętości to należy:
W pliku /etc/fstab zwiększyć ilość przydzielonego ramu. Należy pamiętać, aby odpowiednia ilość ram-u była dostępna.
[edytuj] Jeżeli nie ma ramdisk.
Sprawdzamy czy w pliku /etc/fstab istnieje wpis:
none /var/lib/pgsql/data/ramdisk tmpfs defaults,size=128m 1 2
Jeżeli nie ma to dopisujemy go na końcu pliku i wykonujemy reboot maszyny.
reboot
[edytuj] Jeżeli mamy ramdisk i istnieje wpis w pliku /etc/fstab
[edytuj] Restartujemy postgres'a
systemctl restart postgresql.service
systemctl restart net47-postgresqlfix.service
systemctl restart net47-postgresqlramdisk.service
[edytuj] Sprawdzenie czy restart wykonał się poprawnie.
[edytuj] Polecenie
systemctl status postgresql.service
[edytuj] Przykładowy wynik
postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled)
Active: active (running) since czw 2013-07-04 10:23:31 CEST; 1min 14s ago
Process: 1901 ExecStop=/usr/bin/pg_ctl stop -D ${PGDATA} -s -m fast (code=exited, status=0/SUCCESS)
Process: 1909 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=0/SUCCESS)
Process: 1903 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
Main PID: 1913 (postgres)
CGroup: name=systemd:/system/postgresql.service
├─1913 /usr/bin/postgres -D /var/lib/pgsql/data -p 5432
├─1914 postgres: logger process
├─1916 postgres: checkpointer process
├─1917 postgres: writer process
├─1918 postgres: wal writer process
├─1919 postgres: autovacuum launcher process
├─1920 postgres: stats collector process
├─1921 postgres: net47_main net47_main 127.0.0.1(45116) idle
├─1922 postgres: net47_main net47_main 127.0.0.1(45117) idle
├─1923 postgres: net47_main net47_main 127.0.0.1(45118) idle
├─1924 postgres: net47_main net47_main 127.0.0.1(45119) idle
├─1925 postgres: net47_main net47_main 127.0.0.1(45120) idle
├─1926 postgres: net47_main net47_main 127.0.0.1(45121) idle
├─1927 postgres: net47_main net47_main 127.0.0.1(45122) idle
├─1928 postgres: net47_main net47_main 192.168.123.15(36463) idle
├─1959 postgres: net47_main net47_main 192.168.123.15(36464) idle
├─2034 postgres: net47_main net47_main 127.0.0.1(45123) idle
├─2035 postgres: net47_main net47_main 127.0.0.1(45124) idle
├─2036 postgres: net47_main net47_main 127.0.0.1(45125) idle
├─2037 postgres: net47_main net47_main 127.0.0.1(45126) idle
├─2038 postgres: net47_main net47_main 127.0.0.1(45127) idle
├─2039 postgres: net47_main net47_main 127.0.0.1(45128) idle
├─2040 postgres: net47_main net47_main 127.0.0.1(45129) idle
├─2041 postgres: net47_main net47_main 127.0.0.1(45130) idle
├─2042 postgres: net47_main net47_main 192.168.123.15(36465) idle
├─2043 postgres: net47_main net47_main 127.0.0.1(45131) idle
├─2044 postgres: net47_main net47_main 127.0.0.1(45132) idle
├─2045 postgres: net47_main net47_main 127.0.0.1(45133) idle
├─2046 postgres: net47_main net47_main 127.0.0.1(45134) idle
├─2047 postgres: net47_main net47_main 127.0.0.1(45135) idle
├─2048 postgres: net47_main net47_main 127.0.0.1(45136) idle
└─2058 postgres: net47_main net47_main 127.0.0.1(45144) idle
[edytuj] Polecenie
systemctl status net47-postgresqlramdisk.service
[edytuj] Przykładowy wynik
net47-postgresqlramdisk.service - Składnik Net47 ramdisk dla postgresql Loaded: loaded (/usr/lib/systemd/system/net47-postgresqlramdisk.service; enabled) Active: inactive (dead) since czw 2013-07-04 10:24:05 CEST; 1min 57s ago Process: 2012 ExecStart=/usr/bin/net47-postgresqlramdisk (code=exited, status=0/SUCCESS) lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: CREATE INDEX lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: GRANT lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: CREATE FUNCTION lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: GRANT lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: CREATE TABLE lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: GRANT lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: CREATE INDEX lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: CREATE INDEX lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: CREATE FUNCTION lip 04 10:24:05 nowynet.ostrog.net net47-postgresqlramdisk[2012]: GRANT