There is nothing required to configure in the hosts.cfg file, just leave it empty.
Looking at the /etc/caringo/scspproxy/scspproxy.cfg file, you will notice a few options that must be configured to make the proxy aware of the Swarm cluster.
In the [scsp] section you have a parameter called "hosts". If you have static Swarm node IPs, you can fill one or more of these here (space separated).
Like: [scsp] #list of castor nodes to be used with --staticlocator option hosts = 192.168.201.84
If you want the proxy to use avahi-browse to locate the available Swarm nodes, do NOT fill in the hosts parameter. Use the clusterName parameter, like:
clusterName = cluster.example.com
This assumes that avahi-browse is configured and active on this proxy. This also assumes that the proxy has an interface on the Swarm VLAN.
If you are unclear whether avahi-browse is working and whether you are seeing Swarm nodes, you can type:
avahi-browse -tr _scsp._tcp
If you get nothing returned, check to see if iptables is active: iptables -S
A default CentOS build has iptables active and this will block avahi.
Also, verify the service called messagebus is active:
service messagebus status
Once you think you have these parameters set correctly, start the proxy service:
service scspproxy start
and then check the status:
service scspproxy status
If the status is up, great. Verify that your proxy is seeing your configured Swarm nodes. You may need to change forceReportHosts to True (restart scspproxy service) to get the following to work. Alternatively, you can curl the private side IP of the scsp proxy instead of 127.0.0.1.
This should return the list of nodes from your "hosts" parameter or from avahi-browse via the clusterName.
You may then test the proxy by writing a sample stream through the proxy. Write to the outside interface IP of the proxy (I will use 10.1.1.64 in the example below):
Next, let's change a couple configuration parameters to enable logging and log rotation. By default, logging is to localhost and CentOS is not setup to capture these logs in a default log location.
This FAQ will only describe how to setup logging to the local proxy, but you can easily setup logging to an external log location by following the proxy documentation.
I like to log to the location: /var/log/caringo/ just like on a CSN. To do that, you need to first create that directory:
mkdir -p /var/log/caringo
Next, change the log level in the scspproxy.cfg file to something besides 40. 40 is not much information at all. Let's change to 30 at a minimum:
[log] #<10 = CHATTER, which includes twisted.internet logs #10 = DEBUG - Turns on detail message handling logs #20 = INFO - Turns on request and response echo and connection pool logging #40 = ERROR - Turns on error logging level = 30
In the [log section], comment out the "host" line: [log] #host = localhost
Then include: file = /var/log/caringo/scspproxy.log
That will log the file locally to that location. Since we created the directory already, that will be enough to log the file to scspproxy.log.
To pick up these changes, type:
service scspproxy restart
Next, we want to ensure that we are rotating that log file.
Verify that /etc/logrotate.conf has: include /etc/logrotate.d
Then, create the file called: /etc/logrotate.d/caringo-scspproxy with the following parameters: