Remove Mongo from documentation
This commit is contained in:
parent
4b243553e7
commit
de06b636af
5 changed files with 13 additions and 144 deletions
|
@ -26,9 +26,6 @@
|
|||
... link:server_installation/topics/database/datasource.adoc[Datasource Setup]
|
||||
... link:server_installation/topics/database/hibernate.adoc[Database Configuration]
|
||||
... link:server_installation/topics/database/unicode-considerations.adoc[Unicode considerations]
|
||||
{% if book.community %}
|
||||
.. link:server_installation/topics/mongo.adoc[Mongo DB Setup]
|
||||
{% endif %}
|
||||
.. link:server_installation/topics/network.adoc[Network Setup]
|
||||
... link:server_installation/topics/network/bind-address.adoc[Bind Addresses]
|
||||
... link:server_installation/topics/network/ports.adoc[Socket Port Bindings]
|
||||
|
|
|
@ -21,9 +21,4 @@ depends on your <<fake/../../operating-mode.adoc#_operating-mode, operating mode
|
|||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
----
|
||||
|
||||
{% if book.community %}
|
||||
If you are using Mongo DB replace `jpa` with `mongo`.
|
||||
{% endif %}
|
||||
|
||||
----
|
|
@ -39,22 +39,21 @@ For domain mode, this would mean something like:
|
|||
----
|
||||
**/spi=mySPI/:write-attribute(name=default-provider,value=myProvider)
|
||||
----
|
||||
==== Configure the dblock SPI with both jpa and mango providers
|
||||
==== Configure the dblock SPI
|
||||
[source]
|
||||
----
|
||||
**/spi=dblock/:add(default-provider=jpa)
|
||||
**/spi=dblock/provider=jpa/:add(properties={lockWaitTimeout => "900"},enabled=true)
|
||||
**/spi=dblock/provider=mongo/:add(properties={lockRecheckTime => "2",lockWaitTimeout => "800"},enabled=true)
|
||||
----
|
||||
==== Add or change a single property value for a provider
|
||||
[source]
|
||||
----
|
||||
**/spi=dblock/provider=mongo/:map-put(name=properties,key=lockRecheckTime,value=3)
|
||||
**/spi=dblock/provider=jpa/:map-put(name=properties,key=lockWaitTimeout,value=3)
|
||||
----
|
||||
==== Remove a single property from a provider
|
||||
[source]
|
||||
----
|
||||
**/spi=dblock/provider=mongo/:map-remove(name=properties,key=lockRecheckTime)
|
||||
**/spi=dblock/provider=jpa/:map-remove(name=properties,key=lockRecheckTime)
|
||||
----
|
||||
==== Set values on a provider property of type `List`
|
||||
[source]
|
||||
|
|
|
@ -15,28 +15,27 @@ All elements in an SPI declaration are optional, but a full SPI declaration
|
|||
looks like this:
|
||||
[source,xml]
|
||||
----
|
||||
<spi name="dblock">
|
||||
<default-provider>mongo</default-provider>
|
||||
<provider name="jpa" enabled="true">
|
||||
<spi name="myspi">
|
||||
<default-provider>myprovider</default-provider>
|
||||
<provider name="myprovider" enabled="true">
|
||||
<properties>
|
||||
<property name="lockWaitTimeout" value="800"/>
|
||||
<property name="foo" value="bar"/>
|
||||
</properties>
|
||||
</provider>
|
||||
<provider name="mongo" enabled="true">
|
||||
<provider name="mysecondprovider" enabled="true">
|
||||
<properties>
|
||||
<property name="lockRecheckTime" value="2"/>
|
||||
<property name="lockWaitTimeout" value="600"/>
|
||||
<property name="foo" value="foo"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
----
|
||||
Here we have two providers defined for the SPI `dblock`. The `default-provider`
|
||||
is listed as `mongo`. However it is up to the SPI to decide how it will treat
|
||||
Here we have two providers defined for the SPI `myspi`. The `default-provider`
|
||||
is listed as `myprovider`. However it is up to the SPI to decide how it will treat
|
||||
this setting. Some SPIs allow more than one provider and some do not. So
|
||||
`default-provider` can help the SPI to choose.
|
||||
|
||||
Also notice that each provider defines its own set of configuration properties.
|
||||
The fact that both providers above have a property called `lockWaitTimeout` is just a
|
||||
The fact that both providers above have a property called `foo` is just a
|
||||
coincidence.
|
||||
|
||||
The type of each property value is interpreted by the provider. However, there
|
||||
|
|
|
@ -1,121 +0,0 @@
|
|||
|
||||
[[_mongo]]
|
||||
|
||||
== Mongo DB Setup
|
||||
|
||||
You are not stuck with using a RDBMS for persisting data. {{book.project.name}}
|
||||
provides a http://www.mongodb.com[MongoDB] based model implementation.
|
||||
To configure {{book.project.name}} to use Mongo, you need to edit the `standalone.xml`,
|
||||
`standalone-ha.xml`, or `domain.xml` file in your distribution. The location of this file
|
||||
depends on your <<fake/../../operating-mode.adoc#_operating-mode, operating mode>>.
|
||||
|
||||
Open the `standalone.xml`, `standalone-ha.xml`, or `domain.xml` file. Look for the following XML snippets and replace all the _jpa_ providers with _mongo_ . This is the area you will be modifying
|
||||
to use Mongo.
|
||||
|
||||
[source,xml]
|
||||
----
|
||||
<spi name="eventsStore">
|
||||
<default-provider>jpa</default-provider>
|
||||
<provider name="jpa" enabled="true">
|
||||
<properties>
|
||||
<property name="exclude-events" value="["REFRESH_TOKEN"]"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
<spi name="realm">
|
||||
<default-provider>jpa</default-provider>
|
||||
</spi>
|
||||
<spi name="user">
|
||||
<default-provider>jpa</default-provider>
|
||||
</spi>
|
||||
<spi name="userFederatedStorage">
|
||||
<default-provider>jpa</default-provider>
|
||||
<provider name="jpa" enabled="true"/>
|
||||
</spi>
|
||||
<spi name="userSessionPersister">
|
||||
<default-provider>jpa</default-provider>
|
||||
</spi>
|
||||
<spi name="authorizationPersister">
|
||||
<default-provider>jpa</default-provider>
|
||||
</spi>
|
||||
|
||||
----
|
||||
|
||||
Change that XML snippet to use Mongo:
|
||||
|
||||
[source,xml]
|
||||
----
|
||||
<spi name="eventsStore">
|
||||
<default-provider>mongo</default-provider>
|
||||
<provider name="mongo" enabled="true">
|
||||
<properties>
|
||||
<property name="exclude-events" value="["REFRESH_TOKEN"]"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
<spi name="realm">
|
||||
<default-provider>mongo</default-provider>
|
||||
</spi>
|
||||
<spi name="user">
|
||||
<default-provider>mongo</default-provider>
|
||||
</spi>
|
||||
<spi name="userFederatedStorage">
|
||||
<default-provider>mongo</default-provider>-->
|
||||
<provider name="mongo" enabled="true"/>
|
||||
</spi>
|
||||
<spi name="userSessionPersister">
|
||||
<default-provider>mongo</default-provider>
|
||||
</spi>
|
||||
<spi name="authorizationPersister">
|
||||
<default-provider>mongo</default-provider>
|
||||
</spi>
|
||||
----
|
||||
After that, add the snippet like this where you can configure details about your Mongo database:
|
||||
|
||||
[source,xml]
|
||||
----
|
||||
<spi name="connectionsMongo">
|
||||
<provider name="default" enabled="true">
|
||||
<properties>
|
||||
<property name="host" value="127.0.0.1"/>
|
||||
<property name="port" value="27017"/>
|
||||
<property name="db" value="keycloak"/>
|
||||
<property name="connectionsPerHost" value="100"/>
|
||||
<property name="migrationStrategy" value="update"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
----
|
||||
All configuration options are optional.
|
||||
Default values for host and port are localhost and 27017.
|
||||
Default name of database is `keycloak` . You can also specify properties `user` and `password` if you want authenticate against your MongoDB.
|
||||
If user and password are not specified, {{book.project.name}} will connect unauthenticated to your MongoDB.
|
||||
|
||||
Finally there is set of optional configuration options, which can be used to specify connection-pooling capabilities of Mongo client.
|
||||
Supported int options are: `connectionsPerHost`, `threadsAllowedToBlockForConnectionMultiplier`, `maxWaitTime`, `connectTimeout` `socketTimeout`.
|
||||
Supported boolean options are: `socketKeepAlive`, `autoConnectRetry`.
|
||||
Supported long option is `maxAutoConnectRetryTime`.
|
||||
See http://api.mongodb.org/java/2.11.4/com/mongodb/MongoClientOptions.html[Mongo documentation] for details about those options and their default values.
|
||||
|
||||
Alternatively, you can configure MongoDB using a MongoDB http://docs.mongodb.org/manual/reference/connection-string/[connection URI].
|
||||
In this case, you define all information concerning the connection and authentication within the URI, as described in the MongoDB documentation.
|
||||
Please note that the database specified within the URI is only used for authentication.
|
||||
To change the database used by {{book.project.name}} you have to set `db` property as before.
|
||||
Therefore, a configuration like the following
|
||||
|
||||
[source,xml]
|
||||
----
|
||||
<spi name="connectionsMongo">
|
||||
<provider name="default" enabled="true">
|
||||
<properties>
|
||||
<property name="uri" value="mongodb://user:password@127.0.0.1/authentication"/>
|
||||
<property name="db" value="keycloak"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
----
|
||||
will authenticate the user against the authentication database, but store all {{book.project.name}} related data in the keycloak database.
|
||||
|
||||
=== MongoDB Replica Sets
|
||||
|
||||
In order to use a mongo replica set for {{book.project.name}}, one has to use URI based configuration, which supports the definition of replica sets out of the box: `mongodb://host1:27017,host2:27017,host3:27017/`.
|
Loading…
Reference in a new issue