PostgreSQL for CrowdID
Follow the steps below to connect CrowdID to PostgreSQL.
1. Configure PostgreSQL
- Create a database user which CrowdID will connect as (for example, crowduser).
- Create a database for CrowdID to store data in (for example, crowdiddb). This must be a different database to the one used by Crowd.
- Ensure that the user has permission to connect to the database and to create and populate tables.
2. Configure your Application Server to Connect to PostgreSQL
- Edit the file
apache-tomcat-X.X.XX/conf/Catalina/localhost/openidserver.xml
and customize the username, password, driverClassName and url parameters for the datasource.
<Context path="/openidserver" docBase="../../crowd-openidserver-webapp" debug="0">
<Resource name="jdbc/CrowdIDDS" auth="Container" type="javax.sql.DataSource"
username="[enter db username here]"
password="[enter db password here]"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://host:port/crowdiddb" [ see also http://jdbc.postgresql.org/doc.html) ]"
[ delete the minEvictableIdleTimeMillis, timeBetweenEvictionRunsMillis and maxActive params here ] />
<Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"/>
</Context>
2. Delete the minEvictableIdleTimeMillis, timeBetweenEvictionRunsMillis and maxActive attributes. (These are only needed for HSQL database, and degrade performance otherwise.)
3. Configure CrowdID to use PostgreSQL
Edit the
build.properties
file located in the root of the Crowd distribution, and modify the hibernate.dialectto the followinghibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
- Run
./build.sh
orbuild.bat
. This will configure Crowd to use the PostgreSQL dialect.
If you do not wish to edit this file and run the build script, you can edit the jdbc.properties (which the above script modifies) directly. The jdbc.properties file is located here: crowd-openidserver-webapp\WEB-INF\classes\jdbc.properties
. Modify the file to the following:
# - Crowd Configuration Options
hibernate.connection.datasource=java\:comp/env/jdbc/CrowdIDDS
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory
...
4. 次のステップ
You should now have an application server configured to connect to a database, and CrowdID configured to use the correct database. Start up CrowdID and watch the logs for any errors.
関連トピック
- サポート対象プラットフォーム
- Installing Crowd and CrowdID
- セットアップ ウィザードの実行
- Configuring Crowd