Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Postgresql Server

  1. #1
    Join Date
    May 2016
    Location
    Helsinki, Finland
    Posts
    62

    Default Postgresql Server

    I have tried to get the postgresql (installed versions. 9.6-1.1-noarch & 9.6.2-1.1 with server and contribution packages) running without success, Maybe I have messed up somehow with the settings,
    I have done the following changes in /var/lib/pgsql/data/ original files
    postgresql,conf file:
    hba_file = '/var/lib/pgsql/data/pg_hba.conf'
    listen-address '*'
    port = 5432
    unix_socket_permissions = 0777

    pg_hba.conf file:
    TYPE DATABASE USER ADDRESS METHOD
    local all all trust (tried also with md5)
    host all all 127.0.0.1/32 ident
    host all all ::1/128 ident

    When opening in terminal, I get:
    ---
    ~> su - postgres
    Password:
    su: Authentication failure
    ---
    and as super user I get:
    ---
    sudo su - postgres
    [sudo] password for root:
    postgres@LAPTOP-....:~> psql
    psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
    ---
    With the command:~> sudo systemctl status postgresql.service
    I get:
    ---
    [sudo] password for root:
    postgresql.service - LSB: Start the PostgreSQL master daemon
    Loaded: loaded (/etc/init.d/postgresql; generated; vendor preset: disabled)
    Active: failed (Result: exit-code) since Mon 2017-03-20 13:56:40 EET; 1h 44min ago
    Docs: man:systemd-sysv-generator(8)
    Process: 5963 ExecStart=/etc/init.d/postgresql start (code=exited, status=1/FAILURE)

    Mar 20 13:56:39 LAPTOP-5HS2NJ5L.home su[5975]: pam_unix(su-l:session): session opened fo
    Mar 20 13:56:39 LAPTOP-5HS2NJ5L.home su[6009]: (to postgres) root on none
    Mar 20 13:56:39 LAPTOP-5HS2NJ5L.home su[6009]: pam_unix(su-l:session): session opened fo
    Mar 20 13:56:40 LAPTOP-5HS2NJ5L.home postgresql[5963]: Starting PostgreSQL 9.6.2 pg_ctl:
    Mar 20 13:56:40 LAPTOP-5HS2NJ5L.home postgresql[5963]: Examine the log output.
    Mar 20 13:56:40 LAPTOP-5HS2NJ5L.home postgresql[5963]: ..failed
    Mar 20 13:56:40 LAPTOP-5HS2NJ5L.home systemd[1]: postgresql.service: Control process exi
    Mar 20 13:56:40 LAPTOP-5HS2NJ5L.home systemd[1]: Failed to start LSB: Start the PostgreS
    Mar 20 13:56:40 LAPTOP-5HS2NJ5L.home systemd[1]: postgresql.service: Unit entered failed
    Mar 20 13:56:40 LAPTOP-5HS2NJ5L.home systemd[1]: postgresql.service: Failed with result
    ----

    What is missing to get it running?


  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,271
    Blog Entries
    2

    Default Re: Postgresql Server

    Did you test your PostgreSQL when it was initially installed?
    Typically, everything installed from the openSUSE repos will be installed with a reasonable working configuration by default, generally with default values (Unlike some other distros).

    So, instead of mucking around with configuration files, you should probably for instance have followed the simple steps in this SDBostgeSQL, although it's 2+ years old the simple steps described are still completely applicable today...
    https://en.opensuse.org/SDBostgreSQL

    BTW - The article I found at postgresql.org on openSUSE contains some really weird stuff, and shouldn't be used.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #3
    Join Date
    May 2016
    Location
    Helsinki, Finland
    Posts
    62

    Default Re: Postgresql Server

    Quote Originally Posted by tsu2 View Post
    Did you test your PostgreSQL when it was initially installed?
    Typically, everything installed from the openSUSE repos will be installed with a reasonable working configuration by default, generally with default values (Unlike some other distros).

    So, instead of mucking around with configuration files, you should probably for instance have followed the simple steps in this SDBostgeSQL, although it's 2+ years old the simple steps described are still completely applicable today...
    https://en.opensuse.org/SDBostgreSQL

    BTW - The article I found at postgresql.org on openSUSE contains some really weird stuff, and shouldn't be used.

    TSU
    ThanksTsu,
    I tried to follow these (https://www.howtoforge.com/tutorial/...use-leap-42.1/), (https://wiki.postgresql.org/wiki/Zyp...tallation).and (https://www.postgresql.org/docs/9.6/...g-setting.html).
    Nothing works!
    Btw, could not find the postgreSQL instructions you referred to. Any other advice or should I just remove everything insalled with Yast?

  4. #4
    Join Date
    Oct 2011
    Location
    Germany (Ore Mountains)
    Posts
    427

    Default Re: Postgresql Server

    Did you check the server log file to see why the start fails?

    Depending on your method of installation you should find it either in /var/lib/pgsql/data/ or in the subdirectory pg_log.

    If there is no valuable data in your server it might be a good idea, to remove everything and start from scratch following the instructions on the site you find with tsu2's link.
    Code:
    https://en.opensuse.org/SDB:PostgreSQL
    And please, use the version from the openSUSE standard repository and not from any of the repos in the article "https://wiki.postgresql.org/wiki/Zypper_Installation".
    Hendrik

  5. #5
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,271
    Blog Entries
    2

    Default Re: Postgresql Server

    Yes,
    As I mentioned in my prior post, at the moment any documentation relating to SUSE/openSUSE should not be used. And, the specific article referenced in particular is absolutely weird, the instructions and commands are not in any way usual.

    As for the HowtoForge article,
    Although I've found many articles objectionable on that site, the one you reference seems to be problem-free to my eye.
    If you did follow that article, until what point were you successful until you ran into a problem?

    In any case,
    Not being able to start the PostgreSQL app/service is a show-stopper, and needs to be fixed.
    You can try to undo what you've done but often that's not realistic.
    If necessary, wipe everything clean.

    If this is your first attempt at installing and installing PostreSQL, I'd strongly recommend you install in a virtual machine for practice and learning, because it allows you to quickly wipe clean and start over quickly (iBy either cloning your virtual machine or implemented snapshots). Virtual machines can be easily rolled back or disposed quickly and replaced. If you're trying to learn by installing apps directly on your bare metal installed OS, there will be times when you muck things up so badly that it'll take you more time to undo things than actually learn how to install and configure.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  6. #6
    Join Date
    May 2016
    Location
    Helsinki, Finland
    Posts
    62

    Default Re: Postgresql Server

    Quote Originally Posted by hendwolt View Post
    Did you check the server log file to see why the start fails?

    Depending on your method of installation you should find it either in /var/lib/pgsql/data/ or in the subdirectory pg_log.

    If there is no valuable data in your server it might be a good idea, to remove everything and start from scratch following the instructions on the site you find with tsu2's link.
    Code:
    https://en.opensuse.org/SDB:PostgreSQL
    And please, use the version from the openSUSE standard repository and not from any of the repos in the article "https://wiki.postgresql.org/wiki/Zypper_Installation".
    Hendrik
    Thanks Hendrik and Tsu,

    If I remember it correctly, the problems started after creation of a new user/password and a new db (which I could not find anywhere) in accordance with 'https://www.howtoforge.com/tutorial/how-to-install-postgresql-and-phppgadmin-on-opensuse-leap-42.1/'. At that time I had not modified the postgresql.conf nor pg_hba,conf file.
    The pg_log is as follows:
    # 2017-03-19 17:59:31 EET LOG: database system was shut down at 2017-03-19 17:59:27 EET2017-03-19 17:59:31 EET LOG: MultiXact member wraparound protections are now enabled
    2017-03-19 17:59:31 EET LOG: database system is ready to accept connections
    2017-03-19 17:59:31 EET LOG: autovacuum launcher started
    2017-03-19 18:36:52 EET LOG: received fast shutdown request
    2017-03-19 18:36:52 EET LOG: aborting any active transactions
    2017-03-19 18:36:52 EET LOG: autovacuum launcher shutting down
    2017-03-19 18:36:52 EET LOG: shutting down
    2017-03-19 18:36:52 EET LOG: database system is shut down

    The postgresql.service file (of attemps to connect to server 3/20/17 9:21 PM) in
    # /run/systemd/generator.late/postgresql.service:
    # [Unit]Documentation=man:systemd-sysv-generator(8)
    SourcePath=/etc/init.d/postgresql
    Description=LSB: Start the PostgreSQL master daemon
    Before=multi-user.target
    Before=graphical.target
    After=network-online.target
    After=remote-fs.target
    Wants=network-online.target
    Wants=remote-fs.target


    [Service]
    Type=forking
    Restart=no
    TimeoutSec=5min
    IgnoreSIGPIPE=no
    KillMode=process
    GuessMainPID=no
    RemainAfterExit=yes
    SuccessExitStatus=5 6
    ExecStart=/etc/init.d/postgresql start
    ExecStop=/etc/init.d/postgresql stop
    ExecReload=/etc/init.d/postgresql reload

    This is no catasthroph for me. Would be nice to know, how to fix this problem.

    My latest try with pg_hba.conf settings was:
    # local all all trust
    host all all 127.0.0.1/32 md5
    host all all ::1/128 md5
    host postgres all 192.168.12.0/24 trust

    No help!

    Could it be so that the definitions in /etc/sysconfig/postgresql are not correctly adjusted/are missing (like ## Path: Applications/PostgreSQL, POSTGRES_DATADIR="~postgres/data", POSTGRES_OPTIONS="")? Or are my user definitions somehow corrupted?

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,130

    Default Re: Postgresql Server

    @SimoKJ

    I have send you a PM about the usage of CODE tags. Did you not receive it?
    Henk van Velden

  8. #8
    Join Date
    May 2016
    Location
    Helsinki, Finland
    Posts
    62

    Default Re: Postgresql Server

    Quote Originally Posted by hcvv View Post
    @SimoKJ

    I have send you a PM about the usage of CODE tags. Did you not receive it?
    Yes, thank you. Got it.

  9. #9
    Join Date
    Oct 2011
    Location
    Germany (Ore Mountains)
    Posts
    427

    Default Re: Postgresql Server

    Hi,

    first you should check if postgres is running, for example with:
    Code:
    systemctl status postgresql.service
    If it is not running start it with.
    Code:
    systemctl start postgresql.service
    If you check it afterwards, you should see something like:
    Code:
    ● postgresql.service - LSB: Start the PostgreSQL master daemon
       Loaded: loaded (/etc/init.d/postgresql; generated; vendor preset: disabled)
       Active: active (exited) since Tue 2017-03-21 20:07:06 CET; 1s ago
         Docs: man:systemd-sysv-generator(8)
      Process: 29691 ExecStart=/etc/init.d/postgresql start (code=exited, status=0/SUCCESS)
    
    Mär 21 20:07:01 schlepptop.site systemd[1]: Starting LSB: Start the PostgreSQL master daemon...
    Mär 21 20:07:01 schlepptop.site su[29703]: (to postgres) root on none
    Mär 21 20:07:01 schlepptop.site su[29703]: pam_unix(su-l:session): session opened for user postgres by (uid=0)
    Mär 21 20:07:03 schlepptop.site su[29740]: (to postgres) root on none
    Mär 21 20:07:03 schlepptop.site su[29740]: pam_unix(su-l:session): session opened for user postgres by (uid=0)
    Mär 21 20:07:06 schlepptop.site postgresql[29691]: Starting PostgreSQL 9.6.2 ..done
    Mär 21 20:07:06 schlepptop.site systemd[1]: Started LSB: Start the PostgreSQL master daemon.
    Then you can try to connect to the database.

    Some more things to note:
    - Do not change paths etc. in /etc/sysconfig/postgresql after you have started the postgres server with the systemctl command once.
    - This command invokes another script, which checks, that a postgres database server installation exists in the default location and creates one, if it doesn't find one there.
    - So if you change the paths, the script will create a new server instance for you and you will miss anything you did in your former server instance.

    Hendrik

  10. #10
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,271
    Blog Entries
    2

    Default Re: Postgresql Server

    It's hard to believe that changing a password or creating a database could cause the application service to fail.

    IMO it won't be likely that you can remember or know what you did that caused the failure you're experiencing.

    I recommend you abandon what you did,
    Install Virtualbox or VMware Player, or KVM
    Create a new openSUSE Guest with PostgreSQL installed and proceed.
    As I described earlier, you can create a "Golden Image" clone of a base install before you do anything experimental, then create a clone from that for your experimentation.
    That way, if/when you do something irrecoverable, you can simply delete and discard your work, make another clone from your Golden Image and try again very quickly.
    Or,
    Working in your openSUSE virtual machine, create a snapshot of your basic install and any major steps thereafter. If you do something irrecoverable, then simply roll back to one of your snapshots.

    When you're learning, expect that things will go wrong, but if you prepare well it will only mean a slight pause in your progress.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •