You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
5. To build your own .deb or .rpm, run `make package`, which will generate a .deb and .rpm package.
54
46
55
47
## Installing from package
56
48
You can download .rpm or .deb packages here, on the [Releases](https://github.com/cybertec-postgresql/vip-manager/releases) page.
57
49
On Debian and Ubuntu, the universe repositories should provide you with vip-manager, though the version may be not as recent.
58
-
> NB! Our .deb is probably not compatible with the one from those repositories, do not try to install them side-by-side.
50
+
> **Warning**<br>
51
+
> Our packages are probably not compatible with the one from those repositories, do not try to install them side-by-side.
59
52
60
53
## Installing from source
61
54
62
55
- Follow the steps to [build](#building) vip-manager.
63
56
- Run `DESTDIR=/tmp make install` to copy the binary, service files and config file into the destination of your choice.
64
57
- Edit config to your needs, then run `systemctl daemon-reload`, then `systemctl start vip-manager`.
58
+
59
+
> **Note**<br>
65
60
> systemd will only pick the service files up if you chose a `DESTDIR` so that it can find it. Usually `DESTDIR=''` should work.
66
61
67
62
## Environment prerequisites
68
63
69
64
When vip-manager is in charge of registering and deregistering the VIP locally, it needs superuser privileges to do so.
70
65
This is not required when vip-manager is used to manage a VIP through some API, e.g. Hetzner Robot API or Hetzner Cloud API.
71
66
67
+
> **Note**<br>
72
68
> At some point it would be great to reduce this requirement to only the `CAP_NET_RAW` and `CAP_NET_ADMIN` capabilities, which could be added by a superuser to the vip-manager binary _once_.
73
69
> Right now, this is not possible since vip-manager launches plain shell commands to register and deregister virtual IP addresses locally (at least on linux), so the whole user would need these privileges.
74
-
> When vip-manager is eventually taught to directly use a library that directly uses the linux kernel's API to register/deregister the VIP, the capabilities set for the binary will suffice.
70
+
> When vip-manager is eventually taught to directly use a library that directly uses the Linux kernel's API to register/deregister the VIP, the capabilities set for the binary will suffice.
75
71
76
72
## PostgreSQL prerequisites
77
73
@@ -98,8 +94,9 @@ sysctl -p
98
94
99
95
The configuration can be passed to the executable through argument flags, environment variables or through a YAML config file. Run `vip-manager --help` to see the available flags.
100
96
97
+
> **Note**<br>
101
98
> The location of the YAML config file can be specified with the --config flag.
102
-
> An exemplary config file is installed into `/etc/default/vip-manager_default.yml` or is available in the vipconfig directory in the repository of the software.
99
+
> An exemplary config file is installed into `/etc/default/vip-manager.yml` or is available in the vipconfig directory in the repository of the software.
103
100
104
101
Configuration is now (from release v1.0 on) handled using the [`viper`](https://github.com/spf13/viper) library.
105
102
This means that environment variables, command line flags, and config files can be used to configure vip-manager.
@@ -108,15 +105,12 @@ When using different configuration sources simultaneously, this is the precedenc
108
105
- env
109
106
- config
110
107
108
+
> **Note**<br>
111
109
> So flags always overwrite env variables and entries from the config file. Env variables overwrite the config file entries.
112
110
113
-
All flags and file entries are written in lower case. To make longer multi-word flags and entries readable, they are separated by dashes.
114
-
115
-
> e.g. `retry-num`
116
-
117
-
If you put a flag or file entry into uppercase and replace dashes with underscores, you end up with the format of environment variables. To avoid overlapping configuration with other applications, the env variables are additionall prefixed with `VIP_`.
111
+
All flags and file entries are written in lower case. To make longer multi-word flags and entries readable, they are separated by dashes, e.g. `retry-num`.
118
112
119
-
> e.g. `VIP_RETRY_NUM`
113
+
If you put a flag or file entry into uppercase and replace dashes with underscores, you end up with the format of environment variables. To avoid overlapping configuration with other applications, the env variables are additionall prefixed with `VIP_`, e.g. `VIP_RETRY_NUM`.
120
114
121
115
This is a list of all avaiable configuration items:
122
116
@@ -142,51 +136,11 @@ This is a list of all avaiable configuration items:
142
136
`verbose` | `VIP_VERBOSE` | no | true | Enable more verbose logging. Currently only the manager-type=hetzner provides additional logs.
143
137
144
138
145
-
### Migrating configuration from releases before v1.0
146
-
As stated above, the configuration method has been changed from v1.0 onwards.
147
-
The breaking changes with regards to config handling are thus:
148
-
- Config flags are no longer prefixed with a single dash `-`, but in POSIX style with double dashes `--`.
149
-
- Some config keys have received new names, but the value handling has not changed.
150
-
151
-
However, some consideration has been made to ease migration:
152
-
- The old key names in VIP_* environment variables and in YAML config files are mapped to the new keys, a deprecation warning will be emitted for each old key that is used.
153
-
- If both old and new key names are used and have different values, vip-manager will exit; If both values are identical, the duplication will be ignored.
154
-
155
-
This means that migration should be pretty straight forward.
156
-
157
-
#### Migration for Service Files using Environment Variables
158
-
> These Service Files have been published in releases <v0.4 and on Debian/Ubuntu in release v0.6 as well.
159
-
In the "ENV style" Service Files, configuration was loaded in through an environment file and the values of the environment variables where shimmed in place of the flag values:
As a result, these Service Files should be replaced by ones that specify no flags at all:
165
-
```bash
166
-
ExecStart=/usr/bin/vip-manager
167
-
```
168
-
169
-
Since the environment variables are still there, the vip-manager (>=v1.0) will pick them up itself. It will pick up the old keys and use only emit log messages indicating the deprecation of those keys.
170
-
> You could even consider another shim, that will take the environment variables using old keys, get their values and assign them to environment variables using the new keys. Then unset the old keys and you will no longer see deprecation messages.
171
-
172
-
#### Migration for Service Files using YAML config files:
173
-
> These Service FIles have been published in release v0.6
174
-
In these "config file style" Service Files, the yaml configuration file was passed as a flag to the vip-manager.
Because the old keys in the YAML config files will be remapped to new keys, all that needs to be done is to add a single dash (`sed -i 's/-config/--config/'`):
0 commit comments