How to Setup Clustered Cache
Step 1, firstly you need to choose yourself a port different from what you csp is using,for the cache which must be forwarded in your router and instead of tcp define it as a udp port lets say for example "17500 "
Step 2, make sure you forward this port in UDP to your CSP Server's ip address,
Step 3, in your proxy xml file locate this :
Code:<cache-handler class="com.bowman.cardserv.DefaultCache"> <cache-config> <cw-max-age>14</cw-max-age> <max-cache-wait>11</max-cache-wait> </cache-config> </cache-handler>
it is normally near the bottom of the xml file, do not worry if its not exactly the same, now you are going to delete all of that and replace it, I will show with what shortly.
Step 4, you need to locate where your csp is kept, for example mine is /usr/local/csp
there also should be a cache directory, you need to open that and make a file just called " cluster "
Step 5, open / edit the new file ( cluster ) you made, in there will go your dns and port that you forwarded earlier ... ie myserver.homelinux.net :17500
also if someone has already given you details to exchange cache that would go on the next line
so you would have a file that looks like:
save that file and if any other cache exchange lines are given to you they will go in there as well.Code:myserver.homelinux.net :17500 friends.dyndns.addy :30001
Step 6, you will need to chmod the new file ie
or whatever path your csp is in.Code:chmod 755 /usr/local/csp/cache/cluster
step 7, this will be the replacement part of the xml file that you have deleted as of step 3
now remember the udp port you have forwarded also your dns you put in the cluster file and also the path where the cluster file is.
Code:<cache-handler class="com.bowman.cardserv.ClusteredCache"> <cache-config> <cw-max-age>11</cw-max-age> <max-cache-wait>150ms</max-cache-wait> <local-host>myserver.homelinux.net </local-host> <local-port>17500</local-port> <tracker-url>file:///usr/local/csp/cache/cluster</tracker-url> <tracker-update>1</tracker-update> <sync-period>5</sync-period> <hide-names>true</hide-names> <debug>true</debug> </cache-config> </cache-handler>
save the xml " save changes "
Step 8, Restart your CSP Proxy
that's all
to check if it works , go to Status page and you should see
Cache-Handler: com.bowman.cardserv.ClusteredCache
click on it and it opens up. you should see something like the example below
Code:avg-received-bytes/s: 113 avg-sent-bytes/s: 292 cache-peers: 3 cached-ecms: 73 instant-hits: 893 pending-ecms: 6 received-cached: 37926 received-discarded: 15322 received-pending: 30190 remote-hits: 533 sent-cached: 15895 sent-pending: 17336 timeouts: 443 tracker-failures: 0 wait-hits: 1225
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks