Alfresco recommends that you use a separate PostgreSQL instance for the Sync Service.
Note
Only the Sync Service communicates with the database. It persists events taken from the JMS queue into the database. The repository doesn't communicate with the database.
The Sync Service isn't packaged with a PostgreSQL driver, so it'll need to be downloaded separately and cited in the start-up. See step Starting the Sync Service.
-
Download the appropriate driver that's compatible with JDBC42 from the PostgreSQL JDBC Driver download page.
-
Copy the JAR file into the same directory as the Sync Service JAR.
-
Increase the maximum connections setting in the PostgreSQL configuration file.
-
Locate the configuration file:
- Linux:
/var/lib/pgsql/9.4/data/postgresql.conf - Windows:
C:\Program Files\PostgreSQL\9.4\data\postgresql.conf
- Linux:
-
Add or edit the
max_connectionsproperty:max_connections = 450If
max_connectionsis left unchanged, bear in mind that in the PostgreSQL database, the defaultmax_connectionsis100. So, the value of thedb.pool.maxproperty in theconfig.ymlfile must be less than or equal to100.If there are multiple Sync Service instances forming a cluster hidden behind a load balancer,
max_connectionsshould be greater than or equal to the sum of alldb.pool.maxfrom allconfig.ymlfiles.For example, if
max_connections=450, and there are 3 Sync Service instances, then the correct setting inconfig.ymlisdb.pool.max : 150. -
Restart the database.
-
-
Review your memory requirements in
work_memin thepostgresql.conffile in your PostgreSQL directory.Increasing the
work_memvalue increases performance and allows PostgreSQL to perform larger in-memory sorting. For more information about PostgreSQL performance, see Tuning PostgreSQL. -
Create a Postgres user with the username given by the sync property,
sql.db.username, with password given by the sync propertysql.db.password:CREATE USER alfresco WITH PASSWORD 'admin'; -
Create a Postgres database with the name given in the property,
sql.db.url, owned by the useralfrescothat you will use to run PostgreSQL, and ensure that this user has write permissions on all tables and sequences.CREATE DATABASE alfresco OWNER alfresco ENCODING 'utf8'; GRANT ALL PRIVILEGES ON DATABASE alfresco TO alfresco; -
Ensure
sql.db.driverandsql.db.urlare correctly updated in theconfig.ymlfile, e.g.sql: db: driver: org.postgresql.Driver url: jdbc:postgresql://localhost:5432/alfresco