{"id":51,"date":"2017-11-20T14:06:01","date_gmt":"2017-11-20T14:06:01","guid":{"rendered":"https:\/\/blinksql.com\/?p=51"},"modified":"2017-11-20T14:06:01","modified_gmt":"2017-11-20T14:06:01","slug":"initdb-creates-a-new-postgresql-database-cluster","status":"publish","type":"post","link":"https:\/\/blinksql.com\/?p=51","title":{"rendered":"initdb-creates a new PostgreSQL database cluster"},"content":{"rendered":"<p><strong>Cluster:<br \/>\n<\/strong>A database cluster is a collection of databases that are managed by a single server instance.<br \/>\n-&gt; It will creates the directories in which the database data will live generating the shared catalog tables and creating the template1 and postgres databases.<br \/>\n-&gt; Before that add the user in which you are going to create the data directory. From the root we can not initialize.<br \/>\ncmd:adduser postgres<br \/>\n-&gt; Now the user is created and login as postgres.<br \/>\ncmd:su postgres<br \/>\npwd:pwd#1234<br \/>\n-&gt; If we want to change the password of postgres<br \/>\ncmd:passwd postgres<br \/>\n-&gt; Create a new directory to initilize the cluster.<br \/>\n<strong>cmd: mkdir \/DB\/postgresql-9.5.8<br \/>\n<\/strong><br \/>\n-&gt;Now the data directory is create. If the postgres user does not have the super user privilliges then change the privilliges.<br \/>\ncmd: sudo chown postgres:postgres \/DB\/postgres9.5.8\/<br \/>\n-&gt; To add the user as sudo user<br \/>\ncmd: sudo usermod -a -G sudo postgres<br \/>\nNote: The default installation directory of postgresql will be available here.<br \/>\n<strong>\/usr\/local\/pgsql\/bin\/<br \/>\n<\/strong><br \/>\n-&gt; Now we can initialize the database cluster using the cmd.<br \/>\ncmd:<strong>\/usr\/local\/pgsql\/bin\/initdb -D \/DB\/postgres9.5.8\/<\/strong><\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/blinksql.com\/wp-content\/uploads\/2017\/11\/initilaze-the-db-and-create-the-data-directory.png\" alt=\"initilaze the db and create the data directory\" width=\"702\" height=\"387\" class=\"alignnone size-full wp-image-69\" \/><\/p>\n<p>-&gt; Finally the cluster is created and all the database instances will be stored here.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cluster: A database cluster is a collection of databases that are managed by a single server instance. -&gt; It will creates the directories in which the database data will live&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":""},"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.10 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>initdb-creates a new PostgreSQL database cluster - Blink SQL<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blinksql.com\/?p=51\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"initdb-creates a new PostgreSQL database cluster - Blink SQL\" \/>\n<meta property=\"og:description\" content=\"Cluster: A database cluster is a collection of databases that are managed by a single server instance. -&gt; It will creates the directories in which the database data will live&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blinksql.com\/?p=51\" \/>\n<meta property=\"og:site_name\" content=\"Blink SQL\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-20T14:06:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blinksql.com\/wp-content\/uploads\/2017\/11\/initilaze-the-db-and-create-the-data-directory.png\" \/>\n<meta name=\"author\" content=\"Hannie\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@harika_sanaka\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hannie\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blinksql.com\/?p=51#article\",\"isPartOf\":{\"@id\":\"https:\/\/blinksql.com\/?p=51\"},\"author\":{\"name\":\"Hannie\",\"@id\":\"https:\/\/blinksql.com\/#\/schema\/person\/f04b99304f59e14956e768e764d2afd4\"},\"headline\":\"initdb-creates a new PostgreSQL database cluster\",\"datePublished\":\"2017-11-20T14:06:01+00:00\",\"dateModified\":\"2017-11-20T14:06:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blinksql.com\/?p=51\"},\"wordCount\":218,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/blinksql.com\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blinksql.com\/?p=51#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blinksql.com\/?p=51\",\"url\":\"https:\/\/blinksql.com\/?p=51\",\"name\":\"initdb-creates a new PostgreSQL database cluster - Blink SQL\",\"isPartOf\":{\"@id\":\"https:\/\/blinksql.com\/#website\"},\"datePublished\":\"2017-11-20T14:06:01+00:00\",\"dateModified\":\"2017-11-20T14:06:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/blinksql.com\/?p=51#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blinksql.com\/?p=51\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blinksql.com\/?p=51#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blinksql.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"initdb-creates a new PostgreSQL database cluster\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blinksql.com\/#website\",\"url\":\"https:\/\/blinksql.com\/\",\"name\":\"Blink SQL\",\"description\":\" Thinking SQL\",\"publisher\":{\"@id\":\"https:\/\/blinksql.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blinksql.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/blinksql.com\/#organization\",\"name\":\"Blink SQL\",\"url\":\"https:\/\/blinksql.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blinksql.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/blinksql.com\/wp-content\/uploads\/2022\/11\/cropped-BlinkSQL-removebg.png\",\"contentUrl\":\"https:\/\/blinksql.com\/wp-content\/uploads\/2022\/11\/cropped-BlinkSQL-removebg.png\",\"width\":280,\"height\":172,\"caption\":\"Blink SQL\"},\"image\":{\"@id\":\"https:\/\/blinksql.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/blinksql.com\/#\/schema\/person\/f04b99304f59e14956e768e764d2afd4\",\"name\":\"Hannie\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blinksql.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c5876b3497d2c2eb98256b7c183220c1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c5876b3497d2c2eb98256b7c183220c1?s=96&d=mm&r=g\",\"caption\":\"Hannie\"},\"sameAs\":[\"http:\/\/blinksql.com\",\"https:\/\/twitter.com\/harika_sanaka\"],\"url\":\"https:\/\/blinksql.com\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"initdb-creates a new PostgreSQL database cluster - Blink SQL","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blinksql.com\/?p=51","og_locale":"en_US","og_type":"article","og_title":"initdb-creates a new PostgreSQL database cluster - Blink SQL","og_description":"Cluster: A database cluster is a collection of databases that are managed by a single server instance. -&gt; It will creates the directories in which the database data will live&hellip;","og_url":"https:\/\/blinksql.com\/?p=51","og_site_name":"Blink SQL","article_published_time":"2017-11-20T14:06:01+00:00","og_image":[{"url":"https:\/\/blinksql.com\/wp-content\/uploads\/2017\/11\/initilaze-the-db-and-create-the-data-directory.png"}],"author":"Hannie","twitter_card":"summary_large_image","twitter_creator":"@harika_sanaka","twitter_misc":{"Written by":"Hannie","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blinksql.com\/?p=51#article","isPartOf":{"@id":"https:\/\/blinksql.com\/?p=51"},"author":{"name":"Hannie","@id":"https:\/\/blinksql.com\/#\/schema\/person\/f04b99304f59e14956e768e764d2afd4"},"headline":"initdb-creates a new PostgreSQL database cluster","datePublished":"2017-11-20T14:06:01+00:00","dateModified":"2017-11-20T14:06:01+00:00","mainEntityOfPage":{"@id":"https:\/\/blinksql.com\/?p=51"},"wordCount":218,"commentCount":0,"publisher":{"@id":"https:\/\/blinksql.com\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blinksql.com\/?p=51#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blinksql.com\/?p=51","url":"https:\/\/blinksql.com\/?p=51","name":"initdb-creates a new PostgreSQL database cluster - Blink SQL","isPartOf":{"@id":"https:\/\/blinksql.com\/#website"},"datePublished":"2017-11-20T14:06:01+00:00","dateModified":"2017-11-20T14:06:01+00:00","breadcrumb":{"@id":"https:\/\/blinksql.com\/?p=51#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blinksql.com\/?p=51"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blinksql.com\/?p=51#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blinksql.com\/"},{"@type":"ListItem","position":2,"name":"initdb-creates a new PostgreSQL database cluster"}]},{"@type":"WebSite","@id":"https:\/\/blinksql.com\/#website","url":"https:\/\/blinksql.com\/","name":"Blink SQL","description":" Thinking SQL","publisher":{"@id":"https:\/\/blinksql.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blinksql.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/blinksql.com\/#organization","name":"Blink SQL","url":"https:\/\/blinksql.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blinksql.com\/#\/schema\/logo\/image\/","url":"https:\/\/blinksql.com\/wp-content\/uploads\/2022\/11\/cropped-BlinkSQL-removebg.png","contentUrl":"https:\/\/blinksql.com\/wp-content\/uploads\/2022\/11\/cropped-BlinkSQL-removebg.png","width":280,"height":172,"caption":"Blink SQL"},"image":{"@id":"https:\/\/blinksql.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/blinksql.com\/#\/schema\/person\/f04b99304f59e14956e768e764d2afd4","name":"Hannie","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blinksql.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c5876b3497d2c2eb98256b7c183220c1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c5876b3497d2c2eb98256b7c183220c1?s=96&d=mm&r=g","caption":"Hannie"},"sameAs":["http:\/\/blinksql.com","https:\/\/twitter.com\/harika_sanaka"],"url":"https:\/\/blinksql.com\/?author=2"}]}},"_links":{"self":[{"href":"https:\/\/blinksql.com\/index.php?rest_route=\/wp\/v2\/posts\/51"}],"collection":[{"href":"https:\/\/blinksql.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blinksql.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blinksql.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blinksql.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=51"}],"version-history":[{"count":0,"href":"https:\/\/blinksql.com\/index.php?rest_route=\/wp\/v2\/posts\/51\/revisions"}],"wp:attachment":[{"href":"https:\/\/blinksql.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blinksql.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blinksql.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}