Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

Version 1 Next »

Created 10/10/2016 aaron.enfield · Updated 10/13/2016 aaron.enfield

When initially installed with the caringo-install.sh script , the standalone SCSP proxy is not fully operational.

The configuration options are available in the proxy documentation so I will not belabor that here. There are a few necessary steps to get a standalone proxy installation viable in your environment.

First, the /etc/caringo/scspproxy/ directory includes configuration samples but these examples but not live files.

hosts.cfg.sample

scspproxy.cfg.sample

To make functional configuration files, simple copy them without the ".sample" extension:

root@c-csn1-proxy1:/etc/caringo/scspproxy>cp scspproxy.cfg{.sample,}

root@c-csn1-proxy1:/etc/caringo/scspproxy>cp hosts.cfg{.sample,}

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:

>curl 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):

>curl -v --post301 --data-binary "hello world" "10.1.1.64?alias=yes" -D header.txt

Assuming your cluster doesn't require a domain (enforceTenancy=true in your cluster.cfg) that should write a stream to the cluster and show you that you used the proxy:

< X-Forwarded-For: c-csn1-proxy1

< X-Forwarded-Server: c-csn1-proxy1

< SCSP-PROXY-AGENT: ScspProxyService/8.2.1

That means you have a fully functional proxy.

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:

root@c-csn1-proxy1:/etc/logrotate.d>cat caringo-scspproxy

#

  1. SCSP Proxy logrotate.d file

    #

    #

    /var/log/caringo/scspproxy.log {

    daily

    rotate 20

    size 512M

    compress

    missingok

    copytruncate

    }

    You may use what values you like in here, but I keep 20 days minimum and rotate daily. It only rotates as necessary.

    That should complete your standalone proxy configuration.

  • No labels