|
1 | | -# OpenBMP Postgres |
| 1 | +# Postgres |
2 | 2 | The postgres container is a plain postgres/timescaleDB container with |
3 | | -some modifications to support OpenBMP. Any postgres install will work as long as |
4 | | -they have similar changes as shown in [Dockerfile](Dockerfile). |
| 3 | +some modifications to support our application. |
5 | 4 |
|
6 | 5 | ## Building |
7 | 6 | See the [Dockerfile](Dockerfile) notes for build instructions. |
8 | 7 |
|
9 | | -## Running |
| 8 | +## Getting Started |
10 | 9 | ``` |
11 | 10 | docker run --rm -it -p 5432:5432 \ |
12 | | - -e POSTGRES_PASSWORD=openbmp \ |
13 | | - -e POSTGRES_USER=openbmp \ |
14 | | - -e POSTGRES_DB=openbmp \ |
15 | | - openbmp/postgres:<version> |
| 11 | + -e POSTGRES_PASSWORD=bgpdata \ |
| 12 | + -e POSTGRES_USER=bgpdata \ |
| 13 | + -e POSTGRES_DB=bgpdata \ |
| 14 | + bgpdata/postgres:<version> |
16 | 15 | ``` |
17 | 16 |
|
18 | | -### Configuration/Environment Variables |
19 | | -See both [Postgres](https://hub.docker.com/_/postgres) and |
20 | | -[TimescaleDB](https://hub.docker.com/r/timescale/timescaledb) documentation for more |
21 | | -information on how to configure/run the docker container. |
22 | | - |
23 | | -### PostgreSQL Related |
| 17 | +### Additional Information |
24 | 18 |
|
25 | 19 | #### Postgres can be killed by the Linux OOM-Killer |
26 | 20 | This is very bad as it causes Postgres to restart. This will happen because postgres uses a large shared buffer, |
@@ -52,38 +46,36 @@ then try the below: |
52 | 46 | echo never > /sys/kernel/mm/transparent_hugepage/defrag |
53 | 47 | sync && echo 3 > /proc/sys/vm/drop_caches |
54 | 48 |
|
55 | | - |
56 | | -#### Postgres Vacuum (reclaim disk space) |
| 49 | +#### Postgres Vacuum (Reclaim Disk Space) |
57 | 50 | Postgres reclaims deleted/updated records using the vacuum process. You can run this manually/cron via the |
58 | 51 | ```VACUUM``` command. **autovacuum** is used to do this periodically. Careful tuning of this |
59 | 52 | is required. Checkout [autovacuum-tuning-basics](https://blog.2ndquadrant.com/autovacuum-tuning-basics/), |
60 | 53 | [Routine Vacuuming](https://www.postgresql.org/docs/current/static/routine-vacuuming.html), and |
61 | 54 | [VACUUM](https://www.postgresql.org/docs/current/static/sql-vacuum.html) for more details. |
62 | 55 |
|
63 | | -#### Create persistent postgres locations |
| 56 | +#### Persistent Postgres locations |
64 | 57 |
|
65 | 58 | *You should use fast SSD and/or ZFS.* Size of these locations/mount points are directly related to the |
66 | 59 | number of NLRI's maintained and number of changes/updates per second. |
67 | 60 |
|
68 | | -> TODO: Will post numbers of how to determine the disk size needed. For now, if you have less |
69 | | -> than 50,000,00 prefixes, then you can use 1TB. If you have more than that, you should consider |
70 | | -> multiple disks. ZFS can make your life easier as you can easily add disks and it supports compression. |
| 61 | +> NOTE: If you have less than 50,000,00 prefixes, then you can use 1TB. If you have more than that, please consider |
| 62 | +> multiple disks. ZFS can make our life easier as you can easily add disks and it supports compression. |
71 | 63 |
|
72 | 64 | - **postgres/main** - This location will be used for the main postgres data |
73 | 65 | files and tables. |
74 | 66 |
|
75 | 67 | > This really should be a mount point to a dedicated filesystem |
76 | 68 |
|
77 | 69 | ``` |
78 | | - mkdir -p /var/openbmp/postgres/main |
79 | | - chmod 7777 /var/openbmp/postgres/main |
| 70 | + mkdir -p /var/bgpdata/postgres/main |
| 71 | + chmod 7777 /var/bgpdata/postgres/main |
80 | 72 | ``` |
81 | 73 |
|
82 | 74 | - **postgres/ts** - This location will be used for the time series postgres tables |
83 | 75 |
|
84 | 76 | > This really should be a mount point to a dedicated filesystem |
85 | 77 |
|
86 | 78 | ``` |
87 | | - mkdir -p /var/openbmp/postgres/ts |
88 | | - chmod 7777 /var/openbmp/postgres/ts |
| 79 | + mkdir -p /var/bgpdata/postgres/ts |
| 80 | + chmod 7777 /var/bgpdata/postgres/ts |
89 | 81 | ``` |
0 commit comments