{"id":11201,"date":"2023-05-07T06:38:33","date_gmt":"2023-05-06T21:38:33","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=11201"},"modified":"2024-09-08T10:02:54","modified_gmt":"2024-09-08T01:02:54","slug":"postgresql%e3%81%ab%e3%83%8d%e3%83%83%e3%83%88%e3%83%af%e3%83%bc%e3%82%af%e7%b5%8c%e7%94%b1%e3%81%a7%e6%8e%a5%e7%b6%9a%e5%8f%af%e8%83%bd%e3%81%ab%e3%81%99%e3%82%8b%ef%bc%81%ef%bc%88rocky-linux-9","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/11201","title":{"rendered":"PostgreSQL\u306b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7d4c\u7531\u3067\u63a5\u7d9a\u53ef\u80fd\u306b\u3059\u308b\uff01\uff08Rocky Linux 9\uff09"},"content":{"rendered":"<p>Rocky Linux 9\u4e0a\u3067\u7a3c\u50cd\u3059\u308bPostgreSQL\u306b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7d4c\u7531\u3067\u63a5\u7d9a\u53ef\u80fd\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>PostgreSQL\u304c\u30ea\u30c3\u30b9\u30f3\u3059\u308b\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\uff01<\/h2>\n<p>PostgreSQL\u304c\u30ea\u30c3\u30b9\u30f3\u3059\u308b\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u300c127.0.0.1\u300d\u306a\u306e\u3067\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7d4c\u7531\u3067\u63a5\u7d9a\u53ef\u80fd\u306b\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u300c0.0.0.0\u300d\u3042\u308b\u3044\u306f\u30b5\u30fc\u30d0\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# vi \/var\/lib\/pgsql\/data\/postgresql.conf\r\n...\r\nlisten_addresses = '0.0.0.0'\t\t# what IP address(es) to listen on;\r\n...\r\n<\/pre>\n<h2>PostgreSQL\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u63a5\u7d9a\u3092\u8a31\u53ef\u3059\u308b\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\uff01<\/h2>\n<p>PostgreSQL\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u306e\u63a5\u7d9a\u3092\u8a31\u53ef\u3059\u308b\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u4eca\u56de\u306f\u3001IP\u30a2\u30c9\u30ec\u30b9\u306b\u63a5\u7d9a\u3059\u308b\u30a2\u30c9\u30ec\u30b9\u306b\u5236\u9650\u306e\u306a\u3044\u300c0.0.0.0\/0\u300d\u3001\u8a8d\u8a3c\u65b9\u6cd5\u306f\u300cpam\u300d\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# vi \/var\/lib\/pgsql\/data\/pg_hba.conf\r\n...\r\n# IPv4 local connections:\r\n#host    all             all             127.0.0.1\/32            ident\r\nhost    all             all             0.0.0.0\/0            pam\r\n...\r\n<\/pre>\n<h2>\u63a5\u7d9a\u3059\u308b\u30e6\u30fc\u30b6\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3059\u308b\uff01<\/h2>\n<p>pam\u8a8d\u8a3c\u306b\u3057\u305f\u306e\u3067\u3001\u63a5\u7d9a\u3059\u308b\u30e6\u30fc\u30b6\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u4eca\u56de\u306f\u3001\u300cpostgres\u300d\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# echo postgres | passwd --stdin postgres\r\nChanging password for user postgres.\r\npasswd: all authentication tokens updated successfully.\r\n<\/pre>\n<h2>PostgreSQL\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/h2>\n<p>PostgreSQL\u3092\u518d\u8d77\u52d5\u3057\u3066\u8a2d\u5b9a\u3092\u6709\u52b9\u5316\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# systemctl restart postgresql.service \r\n<\/pre>\n<p>\u300c0.0.0.0\u300d\u3067\u30ea\u30c3\u30b9\u30f3\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# ss -lt4np\r\nState      Recv-Q     Send-Q         Local Address:Port         Peer Address:Port    Process                            \r\nLISTEN     0          128                  0.0.0.0:22                0.0.0.0:*        users:((&quot;sshd&quot;,pid=748,fd=3))     \r\nLISTEN     0          244                  0.0.0.0:5432              0.0.0.0:*        users:((&quot;postmaster&quot;,pid=5731,fd=6))\r\n<\/pre>\n<h2>Firewalld\u3067PostgreSQL\u306e\u901a\u4fe1\u8a31\u53ef\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/h2>\n<p>Firewalld\u3067PostgreSQL\u306e\u901a\u4fe1\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# sudo firewall-cmd --add-port=5432\/tcp --zone=public --permanent\r\nsuccess\r\n&#x5B;root@vmsrdb11 data]# sudo firewall-cmd --reload\r\nsuccess\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>PostgreSQL\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u63a5\u7d9a\u4e0d\u53ef\u306e\u8a2d\u5b9a\u3068\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3001PostgreSQL\u304c\u30ea\u30c3\u30b9\u30f3\u3059\u308b\u30a2\u30c9\u30ec\u30b9\u3068\u63a5\u7d9a\u3092\u8a31\u53ef\u3059\u308b\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3057\u305f\u3002<\/p>\n<h2>\u53c2\u8003\u60c5\u5831<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.postgresql.org\/\" target=\"_blank\" rel=\"noopener\">PostgreSQL: The World's Most Advanced Open Source Relational Database<\/a><\/li>\n<\/ul>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/10238\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011PostgreSQL\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/05\/eyecatch_postgresql_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011PostgreSQL\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01<\/div><div class=\"substr\">PostgreSQL\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<hr \/>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rocky Linux 9\u4e0a\u3067\u7a3c\u50cd\u3059\u308bPostgreSQL\u306b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7d4c\u7531\u3067\u63a5\u7d9a\u53ef\u80fd\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":11332,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[221],"tags":[],"class_list":["post-11201","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/11201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=11201"}],"version-history":[{"count":16,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/11201\/revisions"}],"predecessor-version":[{"id":15959,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/11201\/revisions\/15959"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/11332"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=11201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=11201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=11201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}