2
2
3
3
## Database
4
4
5
- Install postgresql and configure it ( [ see here for Fedora ] ( https://fedoraproject.org/wiki/PostgreSQL ) ) .
5
+ Install postgresql and configure it.
6
6
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 ` .
8
14
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
17
16
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:
25
18
26
- Don't forget to reload your PostgreSQL server after this change:
27
19
```
28
- sudo systemctl reload postgresql
20
+ ./src/init/init -d postgresql-hibernate_demo
29
21
```
30
22
31
- ## Data
32
-
33
- You can try a fully automated initialization using this command:
23
+ Or, if not using docker:
34
24
35
25
```
36
26
./src/init/init
37
27
```
38
28
39
- The script will ask for a password: just use ` hibernate_demo ` .
40
-
41
29
If this succeeds, you're all set, you can go to the next step.
42
30
43
31
Otherwise, 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`.
63
51
64
52
## Elasticsearch
65
53
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/ > :
67
55
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 > .
69
61
Unzip the downloaded file, and just run ` bin/elasticsearch ` to start an instance on < http://localhost:9200 > .
70
62
71
63
# Running the project
0 commit comments