You can configure a PostgreSQL database for use with Content Services.
-
Install the PostgreSQL database connector to
allow the database to talk to the Content Services server.
The database connector is a JAR file, for example, postgresql-x.x.jar.
Check the Supported Platforms page for the correct driver.
- Download the database connector from the PostgreSQL download site.
-
Copy the JAR file into the /lib directory.
For example, for Tomcat, copy the JAR file into the <TOMCAT_HOME>/lib directory.
-
Increase the maximum connections setting in the PostgreSQL configuration file.
Locate the configuration file:
- Linux: /var/lib/pgsql/<version-of-postgresql>/data/postgresql.conf
- Windows: C:\Program Files\PostgreSQL\<version-of-postgresql>\data\postgresql.conf
Add or edit the max_connections property:
max_connections = 275
Restart the database.
- Create a database named alfresco.
-
Create a user named alfresco.
This user must have write permissions on all tables and sequences.
- Set the new user's password to alfresco.
- Ensure the alfresco user has the required privileges to create and modify tables.
- Open the <classpathRoot>/alfresco-global.properties.sample file.
- Locate the line: dir.root=./alf_data
-
Edit the line with an absolute path to point to
the directory in which you want to store Content Services data.
dir.root=C:/Alfresco/alf_data
-
Uncomment the following properties:
# PostgreSQL connection (requires postgresql-8.2-504.jdbc3.jar or equivalent) # db.driver=org.postgresql.Driver db.url=jdbc:postgresql://${db.host}:${db.port}/${db.name}
-
Set the other database connection properties.
db.name=alfresco db.username=alfresco db.password=alfresco db.host=localhost db.port=5432 db.pool.max=275
Note:Ensure that these database connection properties aren't commented out.
- Save the file without the .sample extension.
-
To allow password-authenticated connections through TCP/IP, ensure that the PostgreSQL configuration file, pg_hba.conf, contains the following line:
host all all 127.0.0.1/32 password
-
Restart the Content Services server.
If you receive JDBC errors, ensure the location of the PostgreSQL JDBC drivers are on the system path, or add them to the relevant lib directory of the application server.