Step 8 of 9 · lab · 25 min
Change an address in every config
The backend has moved: thirty configs with the address written in different ways, and the comments and similar addresses must stay.
Situation
The store runs thirty instances of its application, each with its own settings file in
/etc/app.d/ — lines of the form key=value. The orders backend has moved: it was
10.20.0.15:8080, now it is 10.20.0.40:8080. The old server goes off tonight, and by then the
instances that talk to it must talk to the new one. The key holding the backend address is
upstream.
Different people have edited these configs by hand for years.
Task
Make sure that in every /etc/app.d/*.conf:
- each
upstreamline that pointed to10.20.0.15:8080points to10.20.0.40:8080; - the comments stay as they were, including commented-out settings: your colleagues read the history from them;
- the other lines don't change — other keys and the
upstreamlines that point to other addresses.
There is no need to restart the application, it rereads its settings by itself. Editing thirty
files by hand takes long — edit them as a stream, but first look at how upstream is written in
different files.
Lab · on your own
No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.
Goals
0 of 3-
In every /etc/app.d/*.conf the upstream lines that pointed to 10.20.0.15:8080 point to 10.20.0.40:8080 — not done yet
-
The comments and commented-out settings are as they were — not done yet
-
The other lines are as they were, including upstream lines with other addresses — not done yet
The machine is starting
Hints
0 of 3Lab goals
0 of 3-
In every /etc/app.d/*.conf the upstream lines that pointed to 10.20.0.15:8080 point to 10.20.0.40:8080 — not done yet
-
The comments and commented-out settings are as they were — not done yet
-
The other lines are as they were, including upstream lines with other addresses — not done yet
Goals are checked on the machine after every command.