511a35bb6c
* stable-2.8: Emit ref-updated event when editing project access via web UI Fix ChangeListener auto-registered implementations Fix: The email notification of review comments gets stuck. Use consistent grammatical tense in command descriptions Make skip bar more user friendly Bump version to 2.8.4 in plugin API and archetypes Helper script to update API version in plugin archetype pom files Serialize GWT dbg and opt compiles Bump GERRIT_VERSION to 2.8.4 Update the mysql documentation concerning charsets By default don't allow admins to create new branches by push Disable commitWithin when running Reindex Emit ref-updated event when editing project access via web UI SideBySide2: Fix syntax highlighting for shell files ChangeScreen2: Respect comment visibility strategy Don't add "Patch File" download link for merge commits The change 'ChangeScreen2: Respect comment visibility strategy' [1] is dropped intentionally, see [2]. [1] https://gerrit-review.googlesource.com/55081 [2] https://gerrit-review.googlesource.com/#/c/55536/3/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/History.java Conflicts: Documentation/config-gerrit.txt VERSION gerrit-gwtui/BUCK gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java gerrit-gwtui/src/main/java/com/google/gerrit/client/change/DownloadBox.java gerrit-gwtui/src/main/java/com/google/gerrit/client/change/History.java gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/SkipBar.java gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/project/ChangeProjectAccess.java gerrit-plugin-archetype/pom.xml gerrit-plugin-gwt-archetype/pom.xml gerrit-plugin-gwtui/pom.xml gerrit-plugin-js-archetype/pom.xml gerrit-server/src/main/java/com/google/gerrit/server/change/EmailReviewComments.java gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListMembersCommand.java Change-Id: I16c848cb385080fd25555c983a3030e0f1cc560b
121 lines
3.4 KiB
Plaintext
121 lines
3.4 KiB
Plaintext
[[createdb]]
|
|
== Database Setup
|
|
|
|
During the init phase of Gerrit you will need to specify which database to use.
|
|
|
|
[[createdb_h2]]
|
|
=== H2
|
|
|
|
If you choose H2, Gerrit will automatically set up the embedded H2 database as
|
|
backend so no set up or configuration is necessary.
|
|
|
|
Using the embedded H2 database is the easiest way to get a Gerrit
|
|
site up and running, making it ideal for proof of concepts or small team
|
|
servers. On the flip side, H2 is not the recommended option for large
|
|
corporate installations. This is because there is no easy way to interact
|
|
with the database while Gerrit is offline, it's not easy to backup the data,
|
|
and it's not possible to set up H2 in a load balanced/hotswap configuration.
|
|
|
|
If this option interests you, you might want to consider link:install-quick.html[the quick guide].
|
|
|
|
[[createdb_postgres]]
|
|
=== PostgreSQL
|
|
|
|
This option is more complicated than the H2 option but is recommended
|
|
for larger installations. It's the database backend with the largest userbase
|
|
in the Gerrit community.
|
|
|
|
Create a user for the web application within Postgres, assign it a
|
|
password, create a database to store the metadata, and grant the user
|
|
full rights on the newly created database:
|
|
|
|
----
|
|
$ createuser --username=postgres -RDIElPS gerrit2
|
|
$ createdb --username=postgres -E UTF-8 -O gerrit2 reviewdb
|
|
----
|
|
|
|
Visit PostgreSQL's link:http://www.postgresql.org/docs/9.1/interactive/index.html[documentation] for further information regarding
|
|
using PostgreSQL.
|
|
|
|
[[createdb_mysql]]
|
|
=== MySQL
|
|
|
|
This option is also more complicated than the H2 option. Just as with
|
|
PostgreSQL it's also recommended for larger installations.
|
|
|
|
Create a user for the web application within the database, assign it a
|
|
password, create a database, and give the newly created user full
|
|
rights on it:
|
|
|
|
----
|
|
mysql
|
|
|
|
CREATE USER 'gerrit2'@'localhost' IDENTIFIED BY 'secret';
|
|
CREATE DATABASE reviewdb;
|
|
GRANT ALL ON reviewdb.* TO 'gerrit2'@'localhost';
|
|
FLUSH PRIVILEGES;
|
|
----
|
|
|
|
If you are using the MyISAM engine, you need to set latin1 as charset:
|
|
|
|
----
|
|
mysql
|
|
|
|
ALTER DATABASE reviewdb charset=latin1;
|
|
----
|
|
|
|
Visit MySQL's link:http://dev.mysql.com/doc/[documentation] for further
|
|
information regarding using MySQL.
|
|
|
|
[[createdb_oracle]]
|
|
=== Oracle
|
|
|
|
PostgreSQL or H2 is the recommended database for Gerrit Code Review.
|
|
Oracle is supported for environments where running on an existing Oracle
|
|
installation simplifies administrative overheads, such as database backups.
|
|
|
|
Create a user for the web application within sqlplus, assign it a
|
|
password, and grant the user full rights on the newly created database:
|
|
|
|
----
|
|
SQL> create user gerrit2 identified by secret_password default tablespace users;
|
|
SQL> grant connect, resources to gerrit2;
|
|
----
|
|
|
|
JDBC driver ojdbc6.jar must be obtained from your Oracle distribution. Gerrit
|
|
initialization process tries to copy it from a known location:
|
|
|
|
----
|
|
/u01/app/oracle/product/11.2.0/xe/jdbc/lib/ojdbc6.jar
|
|
----
|
|
|
|
If this file can not be located at this place, then the alternative location
|
|
can be provided.
|
|
|
|
Instance name is the Oracle SID. Sample database section in
|
|
$site_path/etc/gerrit.config:
|
|
|
|
----
|
|
[database]
|
|
type = oracle
|
|
instance = xe
|
|
hostname = localhost
|
|
username = gerrit2
|
|
port = 1521
|
|
----
|
|
|
|
Sample database section in $site_path/etc/secure.config:
|
|
|
|
----
|
|
[database]
|
|
password = secret_pasword
|
|
----
|
|
|
|
|
|
GERRIT
|
|
------
|
|
Part of link:index.html[Gerrit Code Review]
|
|
|
|
SEARCHBOX
|
|
---------
|