Mercurial > hg > orthanc-book
annotate Sphinx/source/plugins/postgresql.rst @ 723:e5a78783383f
fix version of Stone Web viewer
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 24 Jun 2021 15:07:00 +0200 |
parents | 411e82bb3a9f |
children | 8b8df1be0cf9 |
rev | line source |
---|---|
24 | 1 .. _postgresql: |
2 | |
3 | |
4 PostgreSQL plugins | |
5 ================== | |
6 | |
27 | 7 .. contents:: |
8 | |
9 The Orthanc project provides two **official** plugins to replace the | |
10 default storage area (on the filesystem) and the default SQLite index | |
11 by a PostgreSQL database. | |
12 | |
13 For general information, check out the `official homepage of the | |
358
011b01ccf52d
fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
336
diff
changeset
|
14 plugins <https://www.orthanc-server.com/static.php?page=postgresql>`__. |
27 | 15 |
643
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
16 For information about scalability, make sure to read the section about |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
17 :ref:`multiple writers in large-scale deployments <multiple-writers>`. |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
18 |
27 | 19 |
20 | |
21 Compilation | |
22 ----------- | |
23 | |
128 | 24 Static linking |
25 ^^^^^^^^^^^^^^ | |
26 | |
27 | 27 .. highlight:: text |
28 | |
154 | 29 The procedure to compile these plugins is similar to that for the |
27 | 30 :ref:`core of Orthanc <compiling>`. The following commands should work |
154 | 31 for most UNIX-like distribution (including GNU/Linux):: |
27 | 32 |
154 | 33 $ mkdir BuildPostgreSQL |
34 $ cd BuildPostgreSQL | |
35 $ cmake ../PostgreSQL -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release | |
27 | 36 $ make |
37 | |
38 The compilation will produce 2 shared libraries, each containing one plugin for Orthanc: | |
39 | |
40 * ``OrthancPostgreSQLIndex`` replaces the default SQLite index of Orthanc by PostgreSQL. | |
41 * ``OrthancPostgreSQLStorage`` makes Orthanc store the DICOM files it receives into PostgreSQL. | |
42 | |
128 | 43 |
44 Microsoft Windows and Apple OS X | |
45 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
46 | |
28 | 47 Pre-compiled binaries for Microsoft Windows `are also available |
358
011b01ccf52d
fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
336
diff
changeset
|
48 <https://www.orthanc-server.com/browse.php?path=/plugin-postgresql>`__. |
30 | 49 A package for `Apple's Mac OS X |
358
011b01ccf52d
fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
336
diff
changeset
|
50 <https://www.osimis.io/en/download.html>`__ |
011b01ccf52d
fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
336
diff
changeset
|
51 is available courtesy of `Osimis <https://www.osimis.io/>`__. |
27 | 52 |
53 | |
263
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
54 .. _postgresql-ubuntu1604: |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
55 |
128 | 56 Dynamic linking on Ubuntu 16.04 |
57 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
58 | |
59 .. highlight:: text | |
60 | |
61 If static linking is not desired, here are build instructions for | |
62 Ubuntu 16.04 (provided build dependencies for the :ref:`core of | |
63 Orthanc <compiling>` have already been installed):: | |
64 | |
65 $ sudo apt-get install libpq-dev postgresql-server-dev-all | |
154 | 66 $ mkdir BuildPostgreSQL |
67 $ cd BuildPostgreSQL | |
68 $ cmake ../PostgreSQL -DCMAKE_BUILD_TYPE=Release \ | |
69 -DALLOW_DOWNLOADS=ON \ | |
70 -DUSE_SYSTEM_GOOGLE_TEST=OFF \ | |
71 -DUSE_SYSTEM_ORTHANC_SDK=OFF | |
128 | 72 $ make |
73 | |
263
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
74 |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
75 .. _postgresql-cmake: |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
76 |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
77 Dynamic linking on other GNU/Linux distributions |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
78 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
79 |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
80 .. highlight:: text |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
81 |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
82 The build instructions should always be very similar to those for |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
83 :ref:`Ubuntu 16.04 <postgresql-ubuntu1604>`. One difficulty that could |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
84 however arise is that it is possible that the CMake environment that |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
85 is shipped with the GNU/Linux distribution cannot locate a recent |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
86 version of the development headers for PostgreSQL. This leads to an |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
87 error while invoking CMake that looks like:: |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
88 |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
89 -- Could NOT find PostgreSQL (missing: PostgreSQL_TYPE_INCLUDE_DIR) |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
90 |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
91 In such a situation, please add your version of PostgreSQL to the |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
92 macro ``PostgreSQL_ADDITIONAL_VERSIONS`` that is defined at the end of |
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
93 the `Resources/CMake/PostgreSQLConfiguration.cmake file |
449 | 94 <https://hg.orthanc-server.com/orthanc-databases/file/default/Resources/CMake/PostgreSQLConfiguration.cmake>`__ |
361 | 95 in the sources of the project. |
263
39609c9a2c41
note about includes for postgresql
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
96 |
128 | 97 |
27 | 98 Usage |
99 ----- | |
100 | |
101 .. highlight:: json | |
102 | |
31
93bbfaf0e62c
worklist instructions migrated to a specific page, indexing of Osimis Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
30
diff
changeset
|
103 You of course first have to :ref:`install Orthanc <binaries>`, with a |
154 | 104 version above 0.9.5. You then have to **create a database** dedicated |
28 | 105 to Orthanc on some PostgreSQL server. Please refer to the `PostgreSQL |
106 documentation | |
358
011b01ccf52d
fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
336
diff
changeset
|
107 <https://www.postgresql.org/docs/current/tutorial-createdb.html>`__. |
27 | 108 |
109 Once Orthanc is installed and the database is created, you must add a | |
110 section in the :ref:`configuration file <configuration>` that | |
111 specifies the address of the **PostgreSQL server together with your | |
112 credentials**. You also have to tell Orthanc in which path it can find | |
113 the plugins: This is done by properly modifying the ``Plugins`` | |
114 option. You could for instance adapt the following configuration | |
115 file:: | |
116 | |
117 { | |
118 "Name" : "MyOrthanc", | |
119 "PostgreSQL" : { | |
120 "EnableIndex" : true, | |
121 "EnableStorage" : true, | |
122 "Host" : "localhost", | |
123 "Port" : 5432, | |
124 "Database" : "orthanc", | |
125 "Username" : "orthanc", | |
181 | 126 "Password" : "orthanc", |
643
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
127 "EnableSsl" : false, // New in release 3.0 |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
128 "MaximumConnectionRetries" : 10, // New in release 3.0 |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
129 "ConnectionRetryInterval" : 5, // New in release 3.0 |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
130 "IndexConnectionsCount" : 1 // New in release 4.0 |
27 | 131 }, |
132 "Plugins" : [ | |
154 | 133 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so", |
134 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLStorage.so" | |
27 | 135 ] |
136 } | |
137 | |
154 | 138 **Important:** The ``EnableIndex`` and ``EnableStorage`` options must |
139 be explicitly set to ``true``, otherwise Orthanc will continue to use | |
140 its default SQLite back-end and the filesystem storage area. | |
27 | 141 |
181 | 142 **Remark 1:** When using the ``Storage`` PostgreSQL plugin, the DICOM |
154 | 143 files are stored as large objects in the database. This might |
144 actually consume more space than the DICOM file itself. We have | |
145 observed overhead up to 40%. However, it seems this overhead is | |
146 temporary and comes from Write-Ahead Logging. Check this `discussion | |
147 <https://groups.google.com/d/msg/orthanc-users/pPzHOpb--iw/QkKZ808gIgAJ>`__ | |
148 on the Orthanc Users group for more info). | |
118 | 149 |
181 | 150 **Remark 2:** A typical usage of the PostgreSQL plugin is to enable |
151 only the ``Index``, and to use the default filesystem storage for | |
152 DICOM files (on a NAS with proper disaster recovery strategies). This | |
153 setup provides best performance for large-scale databases. | |
154 | |
155 **Remark 3:** Setting the ``EnableSsl`` to ``true`` forces the use of | |
156 `SSL connections | |
157 <https://www.postgresql.org/docs/current/libpq-ssl.html>`__ between | |
158 Orthanc and the PostgreSQL server. It is a synonym for | |
159 ``sslmode=require`` in connections URI (see below). Setting | |
160 ``EnableSsl`` to ``false`` corresponds to ``sslmode=disable`` | |
161 (i.e. SSL is not used, even if it is both available in Orthanc and | |
162 PostgreSQL). To choose other values for the SSL mode (i.e. ``allow`` | |
163 and ``prefer``), please use connection URIs. | |
118 | 164 |
165 | |
94
b0a71b880ca0
fix link + remark about disk usage overhead
Alain Mazy <alain@mazy.be>
parents:
81
diff
changeset
|
166 |
27 | 167 .. highlight:: text |
168 | |
169 Orthanc must of course be **restarted** after the modification of its | |
170 configuration file. The log will contain an output similar to:: | |
171 | |
172 $ ./Orthanc Configuration.json | |
173 W0212 16:30:34.576972 11285 main.cpp:632] Orthanc version: 0.8.6 | |
174 W0212 16:30:34.577386 11285 OrthancInitialization.cpp:80] Using the configuration from: Configuration.json | |
175 [...] | |
154 | 176 W0212 16:30:34.598053 11285 main.cpp:379] Registering a plugin from: /home/jodogne/Subversion/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so |
27 | 177 W0212 16:30:34.598470 11285 PluginsManager.cpp:258] Registering plugin 'postgresql-index' (version 1.0) |
178 W0212 16:30:34.598491 11285 PluginsManager.cpp:148] Using PostgreSQL index | |
154 | 179 W0212 16:30:34.608289 11285 main.cpp:379] Registering a plugin from: /home/jodogne/Subversion/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLStorage.so |
27 | 180 W0212 16:30:34.608916 11285 PluginsManager.cpp:258] Registering plugin 'postgresql-storage' (version 1.0) |
181 W0212 16:30:34.608947 11285 PluginsManager.cpp:148] Using PostgreSQL storage area | |
182 [...] | |
183 W0212 16:30:34.674648 11285 main.cpp:530] Orthanc has started | |
184 | |
185 | |
186 .. highlight:: json | |
187 | |
188 Instead of specifying explicit authentication parameters, you can also | |
189 use the `PostgreSQL connection URIs syntax | |
358
011b01ccf52d
fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
336
diff
changeset
|
190 <https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING>`__. For |
27 | 191 instance:: |
192 | |
193 { | |
194 "Name" : "MyOrthanc", | |
195 "PostgreSQL" : { | |
196 "EnableIndex" : true, | |
197 "EnableStorage" : true, | |
181 | 198 "ConnectionUri" : "postgresql://username:password@localhost:5432/database?sslmode=prefer" |
27 | 199 }, |
200 "Plugins" : [ | |
154 | 201 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so", |
202 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLStorage.so" | |
27 | 203 ] |
204 } | |
205 | |
206 | |
207 **Remark:** The Debian Med project maintains `another useful set of | |
208 instructions | |
358
011b01ccf52d
fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
336
diff
changeset
|
209 <https://salsa.debian.org/med-team/orthanc-postgresql/-/blob/master/debian/README.Debian>`__. |
27 | 210 |
211 | |
212 Advanced options | |
213 ---------------- | |
214 | |
215 Several advanced options are available as well to fine-tune the | |
216 configuration of the PostgreSQL plugins. They are documented below. | |
217 | |
218 | |
643
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
219 .. _postgresql-multiple-writers: |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
220 |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
221 Multiple writers or connections |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
222 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
223 |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
224 Starting with Orthanc 1.9.2 and PostgreSQL 4.0, it is possible to use |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
225 :ref:`multiple writers or connections in large-scale deployments |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
226 <multiple-writers>`. Here is the list of configuration that control |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
227 this behavior: |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
228 |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
229 * ``Lock`` must be set to ``false`` (cf. :ref:`below <postgresql-lock>`) |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
230 |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
231 * ``MaximumConnectionRetries`` governs how many times Orthanc tries to |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
232 connect to the database, as well as how many times Orthanc replays |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
233 transactions to deal with collisions between multiple writers. |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
234 |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
235 * ``IndexConnectionsCount`` controls the number of connections from |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
236 the index plugin to the PostgreSQL database. It is set to ``1`` by |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
237 default, which corresponds to the old behavior of Orthanc <= 1.9.1. |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
238 |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
239 * ``ConnectionRetryInterval`` is only used when opening one database |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
240 connection to PostgreSQL. |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
241 |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
242 * The PostgreSQL plugin supports the :ref:`revision mechanism |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
243 <revisions>` to protect metadata and attachments from concurrent |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
244 modifications. |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
245 |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
246 |
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
247 |
270
f29d75bc5c25
more info about database locking
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
263
diff
changeset
|
248 .. _postgresql-lock: |
f29d75bc5c25
more info about database locking
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
263
diff
changeset
|
249 |
27 | 250 Locking |
251 ^^^^^^^ | |
252 | |
253 .. highlight:: json | |
254 | |
255 By default, the plugins lock the database (using `PostgreSQL advisory | |
256 locks | |
358
011b01ccf52d
fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
336
diff
changeset
|
257 <https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS>`__) |
27 | 258 to prevent other instances of Orthanc from using the same PostgreSQL |
259 database. If you want several instances of Orthanc to share the same | |
643
411e82bb3a9f
documenting revisions and multiple writers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
560
diff
changeset
|
260 database or if you need multiple connections to the PostgreSQL |
27 | 261 database, set the ``Lock`` option to ``false`` in the configuration |
262 file:: | |
263 | |
264 { | |
265 "Name" : "MyOrthanc", | |
266 "PostgreSQL" : { | |
267 "EnableIndex" : true, | |
268 "EnableStorage" : true, | |
269 "Lock" : false, | |
270 "ConnectionUri" : "postgresql://username:password@localhost:5432/database" | |
271 }, | |
272 "Plugins" : [ | |
154 | 273 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so", |
274 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLStorage.so" | |
27 | 275 ] |
276 } | |
277 | |
278 Obviously, one must be very cautious when sharing the same database | |
279 between instances of Orthanc. In particular, all these instances | |
280 should share the same configuration. | |
281 | |
282 | |
283 Keep-alive | |
284 ^^^^^^^^^^ | |
285 | |
286 .. highlight:: text | |
287 | |
288 After some period of inactivity (users have reported 10 hours), you | |
289 might `experience an error | |
445
987fbbc2b59e
leaving bitbucket wrt. bug tracker
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
438
diff
changeset
|
290 <https://bugs.orthanc-server.com/show_bug.cgi?id=15>`__ such as:: |
27 | 291 |
292 E0220 03:20:51.562601 PluginsManager.cpp:163] Exception in database back-end: Error in PostgreSQL: server closed the connection unexpectedly. | |
293 This probably means the server terminated abnormally before or while processing the request. | |
294 E0220 06:51:03.924868 PluginsManager.cpp:163] Exception in database back-end: Error in PostgreSQL: no connection to the server | |
295 | |
296 This is due to a timeout in the PostgreSQL server. Please make sure to | |
297 `enable keep-alive | |
358
011b01ccf52d
fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
336
diff
changeset
|
298 <https://dba.stackexchange.com/questions/97534/is-there-a-timeout-option-for-remote-access-to-postgresql-database>`__ |
27 | 299 in the configuration of your PostgreSQL server |
438 | 300 |
301 | |
302 Scalability | |
303 ^^^^^^^^^^^ | |
304 | |
305 When configuring your PostgreSQL plugin, ensure you've read the :ref:`scalability section | |
306 <scalability>` | |
531 | 307 |
308 | |
309 Troubleshooting | |
310 --------------- | |
311 | |
312 SCRAM authentication | |
313 ^^^^^^^^^^^^^^^^^^^^ | |
314 | |
560
5c0dfc863884
note for postgresql 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
531
diff
changeset
|
315 .. note:: This section only applies to releases <= 3.2 of the |
5c0dfc863884
note for postgresql 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
531
diff
changeset
|
316 PostgreSQL plugins. Starting with release 3.3, the plugins |
5c0dfc863884
note for postgresql 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
531
diff
changeset
|
317 use a version of libpq that should support SCRAM |
5c0dfc863884
note for postgresql 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
531
diff
changeset
|
318 authentication. |
5c0dfc863884
note for postgresql 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
531
diff
changeset
|
319 |
5c0dfc863884
note for postgresql 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
531
diff
changeset
|
320 In the releases 3.2 of the PostgreSQL plugins, the precompiled |
5c0dfc863884
note for postgresql 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
531
diff
changeset
|
321 binaries use an old, but stable version of the PostgreSQL client |
5c0dfc863884
note for postgresql 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
531
diff
changeset
|
322 (libpq 9.6.1). This makes these binaries very portable, however they |
5c0dfc863884
note for postgresql 3.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
531
diff
changeset
|
323 might not be compatible with more recent features of PostgreSQL. |
531 | 324 |
325 In particular, the precompiled binaries are not compatible with `SCRAM | |
326 authentication | |
327 <https://en.wikipedia.org/wiki/Salted_Challenge_Response_Authentication_Mechanism>`__ | |
328 that is available since PostgreSQL 10. If you get the error ``psql: | |
329 authentication method 10 not supported``, this indicates that the | |
330 PostgreSQL plugins cannot connect to a PostgreSQL server because SCRAM | |
331 is enabled. | |
332 | |
333 `Ian Smith | |
334 <https://groups.google.com/g/orthanc-users/c/4EH7HpcEnSA/m/a4x6oiucAgAJ>`__ | |
335 has reported the following method to disable SCRAM: | |
336 | |
337 1. Drop/delete the ``orthanc`` database and user in PostgreSQL. | |
338 2. Edit the files ``postgresql.conf`` and ``pg_hba.conf`` and change | |
339 ``scram-sha-256`` to ``md5`` in all cases. | |
340 3. Add the ``orthanc`` user and database in PostgreSQL again. | |
341 4. Restart Orthanc. |