Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gerrit Alexander Simon Evers
Verteilte Systeme Projekt
Commits
1b7ff6a4
Commit
1b7ff6a4
authored
Jan 31, 2021
by
Andre Blanke
Browse files
Add first HAProxy configuration file
parent
d1f7df70
Changes
4
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
1b7ff6a4
...
...
@@ -65,6 +65,25 @@ The project is currently deployed using an Apache Web Server instance which serv
by itself and redirects requests other than
`/index.html`
to the Spring backend running on one of the
workers picked by HAProxy which is running on the frontend server.
## Introducing further workers
Currently three worker servers are used with each one running one instance of our backend application,
an Apache HTTP Server instance and a CockroachDB node.
At the present time some configuration files need to be edited in order to introduce further workers.
The workers are automatically assigned an IP address of the form
`192.168.10.(10 + N)`
where
`N`
is
the index of the worker starting with 1.
The IP address
`192.168.10.10`
is reserved for the frontend server running the load balancer.
The following files currently need to be changed when one wants to add or remove a worker:
-
The
`num_workers`
variable in
`Vagrantfile`
-
The
`haproxy.cfg`
file located at
`/ansible/roles/frontend/files/haproxy/haproxy.cfg`
-
`/ansible/roles/worker/files/systemd/system/cockroach.service.d/override.conf`
Both of the latter two files should be changed at some point to make use of Ansible's templating
feature so that only
`num_workers`
has to be edited, at least this should be possible.
## API
See
[
API.md
](
API.md
)
for more information on the structure of the API.
ansible/frontend.yml
View file @
1b7ff6a4
...
...
@@ -6,6 +6,15 @@
package
:
name
:
haproxy
state
:
present
-
name
:
Copy haproxy.cfg file to /etc/haproxy/
copy
:
src
:
/vagrant/ansible/roles/frontend/files/haproxy/haproxy.cfg
dest
:
/etc/haproxy/haproxy.cfg
-
name
:
Start and enable haproxy.service
systemd
:
name
:
haproxy
state
:
started
enabled
:
yes
-
name
:
Install base-devel
package
:
...
...
ansible/roles/frontend/files/haproxy/haproxy.cfg
View file @
1b7ff6a4
frontend main
bind *:80
use_backend workers
backend workers
server worker-1 192.168.10.11:8080 check
# server worker-2 192.168.10.12:8080 check
# server worker-3 192.168.10.13:8080 check
ansible/worker.yml
View file @
1b7ff6a4
...
...
@@ -14,10 +14,12 @@
-
name
:
Add aur_builder user
block
:
-
user
:
-
name
:
Add aur_builder user
user
:
name
:
aur_builder
group
:
wheel
-
lineinfile
:
-
name
:
Remove password check for aur_builder user for binary /usr/bin/pacman
lineinfile
:
path
:
/etc/sudoers.d/00-aur_builder
line
:
'
aur_builder
ALL=(ALL)
NOPASSWD:
/usr/bin/pacman'
create
:
yes
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment