{"id":1748,"date":"2015-05-12T20:58:00","date_gmt":"2015-05-13T01:58:00","guid":{"rendered":"http:\/\/linuxitos.com\/main\/una-solucion-a-job-for-postgresql-service-failed-error\/"},"modified":"2015-05-12T20:58:00","modified_gmt":"2015-05-13T01:58:00","slug":"una-solucion-a-job-for-postgresql-service-failed-error","status":"publish","type":"post","link":"https:\/\/linuxitos.com\/main\/una-solucion-a-job-for-postgresql-service-failed-error\/","title":{"rendered":"Una soluci\u00f3n a Job for postgresql.service failed error"},"content":{"rendered":"<div style=\"text-align: justify;\">Hace poco necesitaba iniciar postgresql para una aplicaci\u00f3n en java, pero al intentar arrancar el servicio de postgresql me mostraba el error siguiente:<\/div>\n<div style=\"text-align: justify;\"><span style=\"color: black;\"><\/span><\/div>\n<div style=\"text-align: justify;\">\n<pre style=\"background: none no-repeat scroll 0% 0% rgb(0, 0, 0); border-radius: 3px; border: 1px solid rgb(0, 0, 0); font-family: &quot;Droid Sans Mono&quot;,Consolas,monospace; font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-align: start; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"color: white;\">Job for postgresql-9.4.service failed. See \"systemctl status posgresql-9.4.service\" and \"journalctl -xe\" for details.<\/span><\/pre>\n<\/div>\n<div style=\"text-align: justify;\">Al ejecutar dicho comandos que me indicaba, mostraba una pila de errores que no comprend\u00ed para nada.<\/div>\n<p><\/p>\n<div style=\"text-align: justify;\">Me dediqu\u00e9 a buscar una soluci\u00f3n en la red, pero desafortunadamente no encontr\u00e9 nada \u00fatil al instante.<\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\">En el link <a href=\"http:\/\/www.if-not-true-then-false.com\/2012\/install-postgresql-on-fedora-centos-red-hat-rhel\/\">http:\/\/www.if-not-true-then-false.com\/2012\/install-postgresql-on-fedora-centos-red-hat-rhel\/<\/a>&nbsp; se indica c\u00f3mo instalarlo, as\u00ed que lo desinstal\u00e9 y lo instal\u00e9 de nuevo, pero nada funcion\u00f3.<\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\">Me percat\u00e9 que en uno de los pasos de la instalaci\u00f3n es necesario crear los datos del cluster de postgresql, es decir, inicializar las carpetas o archivos en los que se almacenar\u00e1 la informaci\u00f3n que se cree en las bases de datos.<\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\">Pues bien, la l\u00ednea de comandos para crear el cluster de nuevo, es la siguiente, ojo, <span style=\"color: #660000;\">es necesario logearse como root<\/span>:<\/div>\n<div style=\"text-align: justify;\"><span style=\"color: black;\"><\/span><\/div>\n<pre style=\"background: none no-repeat scroll 0% 0% rgb(0, 0, 0); border-radius: 3px; border: 1px solid rgb(0, 0, 0); font-family: &quot;Droid Sans Mono&quot;,Consolas,monospace; font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-align: start; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"color: white;\">su - postgres -c \/usr\/pgsql-9.4\/bin\/initdb<\/span><\/pre>\n<div style=\"text-align: justify;\">As\u00ed que, abr\u00ed una terminal e introduje el comando, y no funcion\u00f3, sin embargo, me mostr\u00f3 un error en el que dec\u00eda:<\/div>\n<div style=\"text-align: justify;\"><span style=\"color: black;\"><\/span><\/div>\n<pre style=\"background: none no-repeat scroll 0% 0% rgb(0, 0, 0); border-radius: 3px; border: 1px solid rgb(0, 0, 0); font-family: &quot;Droid Sans Mono&quot;,Consolas,monospace; font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-align: start; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"color: white;\">Si quiere crear un nuevo cluster de base de datos, elimine o vac\u00ede el directorio \"\/var\/lib\/pgsql\/9.4\/data\"<\/span><\/pre>\n<div style=\"text-align: justify;\">Obviamente, al realizar una eliminaci\u00f3n de dicho directorio, los datos que haya dentro de la base de datos se eliminar\u00e1n para siempre, y ese fue un riesgo que tuve que aceptar.<\/div>\n<p>As\u00ed que, para eliminar los datos del cluster, utilic\u00e9 el comando:<\/p>\n<div style=\"text-align: justify;\"><span style=\"color: black;\"><\/span><\/div>\n<pre style=\"background: none no-repeat scroll 0% 0% rgb(0, 0, 0); border-radius: 3px; border: 1px solid rgb(0, 0, 0); font-family: &quot;Droid Sans Mono&quot;,Consolas,monospace; font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-align: start; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"color: white;\">rm -rf \/var\/lib\/pgsql\/9.4\/data<\/span><\/pre>\n<p>Y listo, con eso elimin\u00e9 la carpeta, ahora, nuevamente ejecut\u00e9 el comando:<\/p>\n<div style=\"text-align: justify;\"><span style=\"color: black;\"><\/span><\/div>\n<pre style=\"background: none no-repeat scroll 0% 0% rgb(0, 0, 0); border-radius: 3px; border: 1px solid rgb(0, 0, 0); font-family: &quot;Droid Sans Mono&quot;,Consolas,monospace; font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-align: start; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"color: white;\">su - postgres -c \/usr\/pgsql-9.4\/bin\/initdb<\/span><\/pre>\n<p>Al ejecutar este comando, mostrar\u00e1 las siguientes salidas:<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"http:\/\/4.bp.blogspot.com\/-nGJU0AAFbes\/VVKvgf0X7PI\/AAAAAAAAAtU\/-51QnVy-KMw\/s1600\/Captura%2Bde%2Bpantalla%2Bde%2B2015-05-12%2B19%3A51%3A37.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"217\" src=\"http:\/\/4.bp.blogspot.com\/-nGJU0AAFbes\/VVKvgf0X7PI\/AAAAAAAAAtU\/-51QnVy-KMw\/s400\/Captura%2Bde%2Bpantalla%2Bde%2B2015-05-12%2B19%3A51%3A37.png\" width=\"400\" \/><\/a><a href=\"http:\/\/3.bp.blogspot.com\/-XXjR9Z77H8E\/VVKvo927AsI\/AAAAAAAAAtk\/SpOt2_nmd9s\/s1600\/Captura%2Bde%2Bpantalla%2Bde%2B2015-05-12%2B19%3A51%3A49.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"170\" src=\"http:\/\/3.bp.blogspot.com\/-XXjR9Z77H8E\/VVKvo927AsI\/AAAAAAAAAtk\/SpOt2_nmd9s\/s400\/Captura%2Bde%2Bpantalla%2Bde%2B2015-05-12%2B19%3A51%3A49.png\" width=\"400\" \/><\/a><\/div>\n<p>Para&nbsp; finalizar, inici\u00e9 el servicio de manera habitual:<\/p>\n<div style=\"text-align: justify;\"><span style=\"color: black;\"><\/span><\/div>\n<div style=\"text-align: justify;\">\n<pre style=\"background: none no-repeat scroll 0% 0% rgb(0, 0, 0); border-radius: 3px; border: 1px solid rgb(0, 0, 0); font-family: &quot;Droid Sans Mono&quot;,Consolas,monospace; font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-align: start; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"color: white;\">sudo systemctl start postgresql-9.4.service<\/span><\/pre>\n<\/div>\n<div style=\"text-align: justify;\">Pues por arte de magia, el servicio de postgresql volvi\u00f3 a funcionar. Perd\u00ed todos los datos anteriores que ten\u00eda en mi BD, pero el problema lo solucion\u00e9, adem\u00e1s era necesario levantar el sistema lo m\u00e1s pronto posible, ya que mi trabajo del semestre depend\u00eda de eso.<\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\">Esta es una soluci\u00f3n factible, siempre y cuando se est\u00e9 consiente de que los datos previos se perder\u00e1n.<\/div>\n<p>Si alguien sabe alguna soluci\u00f3n sin eliminar datos previos, favor de pasarme el link, para tener conocimiento de otros m\u00e9todos para solucionar este error.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hace poco necesitaba iniciar postgresql para una aplicaci\u00f3n en java, pero al intentar arrancar el servicio de postgresql me mostraba el error siguiente: Job for postgresql-9.4.service failed. See \u00absystemctl status posgresql-9.4.service\u00bb and \u00abjournalctl -xe\u00bb for details. Al ejecutar dicho comandos que me indicaba, mostraba una pila de errores que no comprend\u00ed para nada. Me dediqu\u00e9 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1232,1229,1231,1230,1233,1234,122],"tags":[],"class_list":["post-1748","post","type-post","status-publish","format-standard","hentry","category-details","category-error-al-iniciar-postgresql","category-error-job","category-error-to-start-posqrestql","category-how-to-start-postgresql","category-journalctl-xe","category-postgresql"],"_links":{"self":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/1748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/comments?post=1748"}],"version-history":[{"count":0,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/1748\/revisions"}],"wp:attachment":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/media?parent=1748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/categories?post=1748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/tags?post=1748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}