index.rst 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .. _community_importer_jdbc:
  2. Importer JDBC storage
  3. =====================
  4. This plugin allows sharing the state of imports in a relational database supported by GeoTools.
  5. Compared to the default in-memory storage, this helps in two ways:
  6. * The state of the imports is persisted and survives restarts
  7. * If an external database, such as PostgreSQL/PostGIS, is used, then it's possible to run multiple
  8. imports on different GeoServer nodes in load balancing and get a consolidated view of their state
  9. Installation
  10. ------------
  11. The module zip just need to be unpacked in the GeoServer ``WEB-INF\lib``.
  12. On startup the module will create by default a H2 database in a "importer" folder
  13. inside the data directory, as well as a configuration file at ``${GEOSERVER_DATA_DIR}/jdbc-import-store.properties``.
  14. The property file can be modified to point to an external database, for example, the following
  15. contents are suitable for a PostGIS database (PostGIS extensions mandatory, even if not used):
  16. .. code-block:: scss
  17. dbtype=postgis
  18. user=myUserName
  19. passwd=myPassword
  20. database=databaseName
  21. port=5432
  22. host=localhost
  23. schema=public
  24. On connection the code will create one table and the suitable indexes to track the imports.
  25. In case the user above is not allowed to create tables, the following SQL
  26. statement can be used (adapt to the specific database):
  27. .. code-block:: sql
  28. CREATE TABLE public.import_context
  29. (
  30. fid serial,
  31. context text,
  32. created timestamp,
  33. updated timestamp,
  34. "user" character varying,
  35. state character varying,
  36. CONSTRAINT import_context_pkey PRIMARY KEY (fid)
  37. );
  38. CREATE INDEX import_context_state ON import_context(state);
  39. CREATE INDEX import_context_user ON import_context("user");
  40. .. note:: The store has been tested with H2 and Postgresql with PostGIS extensions, it may work
  41. with other relational databases too assuming that they have a corresponding GeoTools data store
  42. plugin installed and the database is not changing the name of the columns (Oracle will most
  43. likely not work).
  44. .. note:: With some light extra development and testing the code could be extended to save the status
  45. of imports in any GeoTools supported store, e.g., SOLR, MongoDB.