22
33## Database
44
5- Install postgresql and configure it ( [ see here for Fedora ] ( https://fedoraproject.org/wiki/PostgreSQL ) ) .
5+ Install postgresql and configure it.
66
7- Create a database and user:
7+ * One-liner with docker:
8+ ```
9+ sudo docker run --name postgresql-hibernate_demo -e POSTGRES_PASSWORD=hibernate_demo -e POSTGRES_USER=hibernate_demo -e POSTGRES_DB=hsearch_es_wikipedia -p 5432:5432 -d postgres:11.1
10+ ```
11+ * Otherwise, for Fedora, [ see here] ( https://fedoraproject.org/wiki/PostgreSQL ) ).
12+ You will need to enable the ` md5 ` authentication scheme for the local network connection,
13+ and to create a ` hibernate_demo ` user with the password ` hibernate_demo ` .
814
9- ```
10- # From a shell
11- sudo -i -u postgres
12- createuser -U postgres -P hibernate_demo # When prompted, use "hibernate_demo" as a password
13- createdb -U postgres -O hibernate_demo hsearch_es_wikipedia
14- ```
15-
16- You need to enable the ` md5 ` authentication scheme for the local network connection.
15+ ## Data
1716
18- So, if you just installed PostgreSQL, you should make your ` /var/lib/pgsql/data/pg_hba.conf ` file look like:
19- ```
20- local all all peer
21- host all all 127.0.0.1/32 md5
22- host all all ::1/128 md5
23- ```
24- (just change ` ident ` to ` md5 ` in the existing lines)
17+ You can try a fully automated initialization using this command:
2518
26- Don't forget to reload your PostgreSQL server after this change:
2719```
28- sudo systemctl reload postgresql
20+ ./src/init/init -d postgresql-hibernate_demo
2921```
3022
31- ## Data
32-
33- You can try a fully automated initialization using this command:
23+ Or, if not using docker:
3424
3525```
3626./src/init/init
3727```
3828
39- The script will ask for a password: just use ` hibernate_demo ` .
40-
4129If this succeeds, you're all set, you can go to the next step.
4230
4331Otherwise, Wikipedia's dumps page structure probably changed, but you can proceed as explained below.
@@ -63,9 +51,13 @@ The script will ask for a password: just use `hibernate_demo`.
6351
6452## Elasticsearch
6553
66- Ensure you have an Elasticsearch 5 instance running and accessible from < http://localhost:9200/ > .
54+ Ensure you have an Elasticsearch 5 instance running and accessible from < http://localhost:9200/ > :
6755
68- You can download Elasticsearch from here: < https://www.elastic.co/downloads/elasticsearch > .
56+ * One-liner using temporary storage with docker (ES6, but it should work for this demo):
57+ ```
58+ sudo docker run --ulimit memlock=-1:-1 -ti --tmpfs /run --tmpfs=/opt/elasticsearch/volatile/data:uid=1000 --tmpfs=/opt/elasticsearch/volatile/logs:uid=1000 -p 9200:9200 -p 9300:9300 --name es-it sanne/elasticsearch-light-testing
59+ ```
60+ * Otherwise, you can download Elasticsearch from here: < https://www.elastic.co/downloads/elasticsearch > .
6961Unzip the downloaded file, and just run ` bin/elasticsearch ` to start an instance on < http://localhost:9200 > .
7062
7163# Running the project
0 commit comments