Changes between Version 1 and Version 2 of sysadminPostgreSQLConfiguration

Jun 23, 2009, 2:40:37 PM (14 years ago)



  • sysadminPostgreSQLConfiguration

    v1 v2  
    11= Installing Postgres =
    34== Overview ==
    78The assumption being made in this documentation, is that the database server is separate from the open-ils server.
    911== Installing the Software ==
    1719If postgres is already installed, apt will say so and make no changes, otherwise it will be installed with default settings.
     21During installation,a postgres user will be added to the local system (ie the computer).  This is a standard linux user account and it's permissions are created during setup.  '''Do not change the permissions of this user! '''  This user runs the postgres processes and should have only the permissions necessary to do that.  Also created during installation is a db role called postgres.  This is internal to postgres and has nothing to do with the operating system.  The postgres role provides complete access to all databases created on that db server.  It's important to change the passwords for both the postgres account and postgres role for security purposes.
     23    $sudo passwd postgres
     26You will be prompted to change postgres's password.  After doing so, you can check that it worked by trying:
     28    $su postgres
     31You should gain access to the postgres account with the password you entered.  If not, you likely made a mistake and can try again with the passwd command.
     33You change the db role via psql.  Switch users to postgres:
     35    $su postgres
     38and log into psql:
     40    $psql
     43Run the following:
     45    ALTER ROLE postgres WITH ENCRYPTED PASSWORD 'mypassword';  #include the quotes around mypassword
     49== Initializing The Database Server ==
     51Postgres uses the term "database cluster" to describe the directory it uses to store data.  During the apt install, a default directory is created, usually at: /var/lib/postgresql/8.3/main.
     53  '''NOTE: ''' our servers have been partitioned to best serve the needs of Evergreen.  The default cluster location is not usually on a partition that has been sized appropriately for the db.  Generally, you will ''' not ''' be using the default install directory.
     55You will need to find the appropriate partition and install the appropriate files there.  This is usually:
     57    /data/postgresql/8.3/