You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

databases.apt 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. ------
  2. Apache Archiva Databases
  3. ------
  4. Olivier Lamy
  5. ------
  6. 2011-10-06
  7. ------
  8. ~~ Licensed to the Apache Software Foundation (ASF) under one
  9. ~~ or more contributor license agreements. See the NOTICE file
  10. ~~ distributed with this work for additional information
  11. ~~ regarding copyright ownership. The ASF licenses this file
  12. ~~ to you under the Apache License, Version 2.0 (the
  13. ~~ "License"); you may not use this file except in compliance
  14. ~~ with the License. You may obtain a copy of the License at
  15. ~~
  16. ~~ http://www.apache.org/licenses/LICENSE-2.0
  17. ~~
  18. ~~ Unless required by applicable law or agreed to in writing,
  19. ~~ software distributed under the License is distributed on an
  20. ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  21. ~~ KIND, either express or implied. See the License for the
  22. ~~ specific language governing permissions and limitations
  23. ~~ under the License.
  24. Apache Archiva Database
  25. Archiva uses an external database for one purpose:
  26. * As a default user store for security
  27. []
  28. Generally, it is unnecessary to configure anything - the built in embedded database is suitable for the artifact management, and if
  29. an external authentication mechanism is not needed, the user database.
  30. However, it is possible to configure an external database as needed.
  31. * Configuring an external database
  32. Archiva uses JNDI data sources to locate the databases to use:
  33. * <<<jdbc/users>>> - the user store
  34. Configuring an external database for either or both of these sources depends is configured in <<<jetty.xml>>> if you are using the
  35. {{{./standalone.html} standalone installation}}, or in the application server configuration if you are using the {{{./webapp.html} web application
  36. installation}}.
  37. By default the archiva and users databases are stored in the <<<databases>>> directory where Archiva is installed. To change the
  38. path, just edit all instances of the "DatabaseName" property in <<<conf/jetty.xml>>> (see below).
  39. <<Note:>> If you are using MySQL as your database, Archiva fails when the users database created is initially set to UTF-8 for the character encoding.
  40. As a workaround, set the database to UTF-8 encoding after it has been populated. See {{{http://jira.codehaus.org/browse/MRM-1373} MRM-1373}} for more details.
  41. +------+
  42. <!-- omitted xml -->
  43. <New id="users" class="org.mortbay.jetty.plus.naming.Resource">
  44. <Arg>jdbc/users</Arg>
  45. <Arg>
  46. <New class="org.apache.derby.jdbc.EmbeddedDataSource">
  47. <Set name="DatabaseName">/path/to/database/directory/users</Set>
  48. <Set name="user">sa</Set>
  49. <Set name="createDatabase">create</Set>
  50. </New>
  51. </Arg>
  52. </New>
  53. <New id="usersShutdown" class="org.mortbay.jetty.plus.naming.Resource">
  54. <Arg>jdbc/usersShutdown</Arg>
  55. <Arg>
  56. <New class="org.apache.derby.jdbc.EmbeddedDataSource">
  57. <Set name="DatabaseName">/path/to/database/directory/users</Set>
  58. <Set name="user">sa</Set>
  59. <Set name="shutdownDatabase">shutdown</Set>
  60. </New>
  61. </Arg>
  62. </New>
  63. <!-- omitted xml -->
  64. +------+
  65. * Backing up the database
  66. While it is a good idea to back up both databases, it is not strictly necessary to back up the repository database on a regular basis. Should any
  67. data loss be suffered, this database can be regenerated by deleting it's contents and re-scanning the repositories.
  68. If you are using the default user security mechanism, it is important to back up the users database on a regular basis to ensure that the user
  69. passwords and information are not lost in the event of corruption. With the default embedded storage this is simply a matter of making a copy of
  70. the database directory on the filesystem. If you have configured an external database as the source for user information, please refer to your
  71. database documentation for backup instructions.
  72. ~~TODO: link to wiki location that does others
  73. * MySql setup
  74. +------+
  75. create database archiva character set utf8;
  76. GRANT ALL PRIVILEGES ON archiva.* TO 'archivauser'@'localhost' IDENTIFIED BY 'archivauserpassword'
  77. +------+
  78. Replace "archivauser" and "archivauserpassword" with a username and password of your choice. If Archiva is not running on the same server as your MySQL database server, replace "localhost" with the hostname or IP address of the Archiva server.