How to configure Artifactory using PostgreSQL instead of MySQL?

How to configure PostgreSQL instead of MySQL to run Artifactory ?

+3
source share
2 answers

In Artifactory 2, you can configure the data source according to the instructions you reference, just follow the equivalent for PostgreSQL (substituting equivalent values).

So change $ ARTIFACTORY_HOME / etc / artifactory.system.properties to uncomment (and change) the line:

artifactory.jcr.configPath=repo/postgresql

Create file

$ARTIFACTORY_HOME/etc/repo/postgresql/repo.xml

The .xml repo for use as a base is mentioned in the article or you can find it here

repo.xml ( , ):

<!-- MySQL Filesystem -->
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
    <param name="driver" value="org.postgresql.Driver"/>
    <param name="url" value="jdbc:postgresql:[your database URL]"/>
    <param name="user" value="artifactory_user"/>
    <param name="password" value="password"/>
    <!-- Leave this on "mysql", don't know how these apply for PostgreSQL -->
    <param name="schema" value="[postgresql??]"/>
    <param name="schemaObjectPrefix" value="rep_"/>
</FileSystem>

<!-- http://wiki.apache.org/jackrabbit/DataStore -->

<!-- MySQL Datastore -->
<DataStore class="org.artifactory.jcr.jackrabbit.ArtifactoryDbDataStoreImpl">
    <param name="url" value="jdbc:postgresql:[your database URL]"/>
    <param name="tablePrefix" value=""/>
    <param name="user" value="artifactory_user"/>
    <param name="password" value="password"/>
    <param name="databaseType" value="postgresql"/>
    <param name="driver" value="org.postgresql.Driver"/>
    <param name="minRecordLength" value="512"/>
    <param name="maxConnections" value="15"/>
    <param name="copyWhenReading" value="true"/>
</DataStore>



    <!-- PostGreSQL Persistance Manager -->
    <PersistenceManager
            class="org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager">
        <param name="url"
               value="jdbc:mysql://localhost:3306/artifactory?useUnicode=true&amp;characterEncoding=UTF-8"/>
        <param name="user" value="artifactory_user"/>
        <param name="password" value="password"/>
        <param name="schemaObjectPrefix" value="${wsp.name}_"/>
    </PersistenceManager>

PostgreSQL WEB-INF/lib, , , , .

.

+2

repo.xml ( mysql).

repo.xml

  • OSS - .
  • /etc/repo
    postgres:
    A. filesystem-postgres/repo.xml
    B. postgres/repo.xml

  • A B $ARTIFACTORY_HOME/etc/repo/

  • / **/repo.xml, .

. , , $ARTIFACTORY_HOME/etc/artifactory.system.properties(artifactory.jcr.configDir = filesystem-postgres artifactory.jcr.configDir = repo/PostgreSQL)

+3

Source: https://habr.com/ru/post/1712192/


All Articles