• Stars
    star
    396
  • Rank 105,350 (Top 3 %)
  • Language
    Go
  • License
    BSD 3-Clause "New...
  • Created over 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NGINX load balancer configurator

Loadcat

Loadcat is an Nginx configurator that allows you to use Nginx as a load balancer. The project is inspired by the various Nginx load balancing tutorial articles available online and also the existence of Linode's load balancer service NodeBalancers. So far the tool covers some of HTTP and HTTPS load balancing features, such as SSL termination, adding servers on the fly, marking them as unavailable or backup as necessary, and setting their weights to distribute load fairly.

Installation

Docker Image

Install Loadcat using Docker:

# docker run -p 26590:26590 -p 80:80 -p 443:443 loadcat/base:v0.1.1

From Source

Install Loadcat using the go install command:

$ go install github.com/hjr265/loadcat/cmd/loadcatd@latest

Usage

If you installed Loadcat using the distribution specific package, you can start it as a service using systemctl:

# systemctl start loadcat.service

If you installed Loadcat from source, you can launch it with:

$ cd $GOPATH/src/github.com/hjr265/loadcat
# $GOPATH/bin/loadcatd

Loadcat parses a TOML encoded configuration file. In case one is not found, Loadcat will create one with same sane defaults. The location of the configuration file can be specified with the -config flag.

Loadcat works by generating Nginx configuration files under a particular directory (a directory named "out" under Loadcat's working directory, as set in loadcat.conf). Nginx must be configured to load configuration files from this directory. For example on Arch Linux, when installed from AUR, Loadcat uses /var/lib/loadcat/out as the directory where generated Nginx configuration files are stored. You must include the following line inside the http {} block of /etc/nginx/nginx.conf to load configuration files generated by Loadcat:

include  /var/lib/loadcat/out/*/nginx.conf

Once Loadcat is running, you can navigate to http://{host}:26590 on your web browser, where {host} is the domain name or IP address of the machine where Loadcat is running (for example http://localhost:26590 when running locally). To save a thousand words, here is a (kind of big) picture:

4 steps primer

Make sure that Nginx is running as a systemd service and is configured to load generated configuration files from the appropriate directory.

Caution

As this is a very young project, and pretty experimental, you may encounter bugs and issues here and there. It would be really appreciated if you could open an issue outlining details of the bug or issue, or any feature that you would like to request. Any contribution or criticism (constructive or destructive) is really appreciated.

A lot of Nginx load balancing features is still not covered by this tool and at this moment that makes this rather limited in context of practical applications. However, solving this problem is just a matter of time. Although Nginx Plus specific features may have to wait for a while - at least until I get my hands on an instance or someone else with access to Nginx Plus starts contributing.

Documentation

Resources

Contributing

Contributions are welcome.

License

Loadcat is available under the BSD (3-Clause) License.

More Repositories

1

redsync.go

*DEPRECATED* Please use https://github.com/go-redsync/redsync.
Go
304
star
2

toptal-recommengine

Prototype recommendation engine built to accompany an article on Toptal Blog
CoffeeScript
115
star
3

tonesa

Sample app for Toptal article
Go
54
star
4

arteegee

Simple implementation of the popular game Connect Four over WebRTC
JavaScript
28
star
5

battlescripts

A simple bot-vs-bot Battleships webgame
JavaScript
17
star
6

postmark.go

A Go library for the Postmark API
Go
16
star
7

gnome-shell-extension-services

Toggle common services on/off from a menu on the top panel
JavaScript
12
star
8

ptrace.go

A wrapper library for the set of ptrace-related system calls in Linux
Go
10
star
9

toptal-hopper

Prototype deployment automation tool in Go
Go
8
star
10

sport-programming

C++
5
star
11

redis-too

Redis module that implements a Jaccardian similarity and memory-based collaborative filtering recommendation engine
C
5
star
12

brdgd

Brdgd (read bridged) is an extremely simple P2P file transfer webapp
CoffeeScript
4
star
13

yxorp

Reverse proxy, booyah!
Go
2
star
14

express-bundles

A dumb asset bundling middleware for Express
2
star
15

deen

A command line companion to get prayer timings, Quran verses, and more
Go
2
star
16

sneak

Tool to hide files within other file formats
Go
2
star
17

jail.go

Go package for sandboxed execution of arbitrary processes
Go
1
star
18

node-whois-lambda

JavaScript
1
star
19

go-zrsc

Simple ways to embed and access resources from within a Go binary
Go
1
star
20

sorters

JavaScript
1
star
21

go-dataurl

Go
1
star
22

print.php

Simple web interface to print arbitrary text to the server's printer
PHP
1
star
23

updateasap

Get email digests and Slack notifications when your programming tools and self-hosted services get updates.
Python
1
star