Date: Thu, 28 Mar 2024 18:22:20 -0400 (EDT) Message-ID: <1106915089.29066.1711664540222@lyrasis1-roc-mp1> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_29065_218218096.1711664540222" ------=_Part_29065_218218096.1711664540222 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
By default, Fedora comes configured to write binary resources (i= .e. files) to the file system and RDF resources (i.e. objects) to a LevelDB= database. It is often desirable to replace the LevelDB database with a dif= ferent object store. As of 2016-03-04, the configuration for MySQL or Postg= reSQL databases are available within the deployable Fedora war file. = Below are the steps to use MySQL or PostgreSQL instead of LevelDB.
Performance Note: For ModeShape configured to use Infinispan, i= t may be desirable to index the 'version' column of the 'ispn_entry_FedoraR= epository' table. See discussion at https://groups.google.com/d/topic/fedora-tech/dnyGQvatIf= U/discussion and Infinispan issue https:/= /issues.jboss.org/browse/ISPN-6710.
My= SQL
Run Fedora with the following JAVA_OPTS
:
JAVA_OP= TS=3D"${JAVA_OPTS} -Dfcrepo.modeshape.configuration=3Dclasspath:/config/jdb= c-mysql/repository.json" JAVA_OPTS=3D"${JAVA_OPTS} -Dfcrepo.mysql.username=3D<username>" JAVA_OPTS=3D"${JAVA_OPTS} -Dfcrepo.mysql.password=3D<password>" JAVA_OPTS=3D"${JAVA_OPTS} -Dfcrepo.mysql.host=3D<default=3Dlocalhost>= " JAVA_OPTS=3D"${JAVA_OPTS} -Dfcrepo.mysql.port=3D<default=3D3306>"
Note, the fcrepo
database must be manually c=
reated, but the tables will be automatically created.
fcre=
po
and a user account that can access itJAVA_OPTS
:JAVA_OP= TS=3D"${JAVA_OPTS} -Dfcrepo.modeshape.configuration=3Dclasspath:/config/jdb= c-postgresql/repository.json" JAVA_OPTS=3D"${JAVA_OPTS} -Dfcrepo.postgresql.username=3D<username>" JAVA_OPTS=3D"${JAVA_OPTS} -Dfcrepo.postgresql.password=3D<password>" JAVA_OPTS=3D"${JAVA_OPTS} -Dfcrepo.postgresql.host=3D<default=3Dlocalhos= t>" JAVA_OPTS=3D"${JAVA_OPTS} -Dfcrepo.postgresql.port=3D<default=3D5432>= "
Note, the fcrepo
database must be manuall=
y created, but the tables will be automatically created.
JN= DI Configuration
For both of the configurations above, you may alternatively use JNDI to = connect to the MySQL or PostgreSQL databases.
This was accomplished for MySQL with Tomcat 7.0.54 on RHEL 7.2 as follows: (Note: Fedora web app is d= eployed as 'fcrepo'. Database username and password masked.)= p>
/usr/share/tomcat/conf/Catalina/locah= ost/fcrepo.xml
<Cont= ext path=3D"/fcrepo"> <Resource name=3D"jdbc/fcrepo" auth=3D"Container" type=3D"javax.s= ql.DataSource" username=3D"***********" password=3D"*************" dr= iverClassName=3D"com.mysql.jdbc.Driver" url=3D"jdbc:mysql://127.0.0.1:3306/fcrepo?createDataba= seIfNotExist=3Dtrue" factory=3D"org.apache.commons.dbcp.BasicDataSourceFact= ory" /> </Context>
In inifini= span.xml :
Comment out <jdbc:connection-pool /> element.
Uncomment <jdbc:data-source /> element and set it as follows (= to match the JNDI resource defined above):
<jdbc= :data-source jndi-url=3D"java:comp/env/jdbc/fcrepo"/>
Databases tested with the experimental Mo= deshape 5.0 branch:
To create a new database and user in PostgreSQL, assuming a=
username of user1
and a password of xyz
:
$ sudo = -u postgres psql > create database fcrepo; > create user user1; > alter user user1 password 'xyz'; > grant all privileges on database fcrepo to user1; > \q