Skip to content

Commit 3bb24c1

Browse files
committed
builtin routelib
1 parent 4e0604d commit 3bb24c1

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

content/features/proxy/install.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,13 @@ To download and compile Memcached with its proxy features enabled, follow these
8989
- proxy_arg: string to pass to lua library
9090
```
9191
92-
1. Download the route library:
92+
1. [Optionally] Download the route library:
93+
94+
Memcached ships with `routelib` built in. If you want to modify this base
95+
library or use a newer version than what was provided with memcached you may download it yourself.
9396

9497
```console
9598
wget https://github.com/memcached/memcached-proxylibs/main/lib/routelib/routelib.lua
9699
```
97100

98-
1. Move the `routelib.lua` file that you downloaded in the previous step to some permanent place on your file system, and take note of it. You will need to refer to its path when you run the Memcached proxy.
101+
1. [Optionally] Move the `routelib.lua` file that you downloaded in the previous step to some permanent place on your file system, and take note of it. You will need to refer to its path when you run the Memcached proxy.

content/features/proxy/quickstart.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,6 @@ Because the Memcached built-in proxy is a non-default, compile-time configuratio
6767
6868
Note: For the sake of simplicity and easier cleanup, this quick-start guide doesn't include a `make install` step. If you want to install the proxy-enabled Memcached on this machine, then you can do as a final step at the end of this guide.
6969
70-
## Download the route library
71-
72-
Run the following command:
73-
74-
```
75-
wget https://github.com/memcached/memcached-proxylibs/main/lib/routelib/routelib.lua
76-
```
77-
7870
## Configure the proxy
7971
8072
To create a minimal proxy configuration file named `config.lua`, run the following command:
@@ -113,10 +105,10 @@ routes{
113105
./memcached -l localhost -p 11213 &
114106
```
115107
116-
1. Launch a third Memcached server in proxy mode, by specifying the proxy-specific configuration files that you downloaded and created, respectively, in previous steps:
108+
1. Launch a third Memcached server in proxy mode, by specifying the proxy-specific configuration file that you created, in previous steps:
117109
118110
```
119-
./memcached -l localhost -p 11211 -o proxy_config=routelib.lua,proxy_arg=config.lua &
111+
./memcached -l localhost -p 11211 -o proxy_config=routelib,proxy_arg=config.lua &
120112
```
121113
122114
## Connect to and use the proxy

content/features/proxy/run.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ To run the proxy in the background, append a `&` to the end of the command, in t
3838

3939
The following example command launches a Memcached proxy with the following aspects:
4040

41-
* The proxy loads a route library file named `routelib.lua` stored in your home directory. For more information about obtaining this file, see [Download and build the proxy]({{<proxy_base_path>}}install#download).
41+
* The proxy loads a route library file named `routelib` that it ships with. For more information about updating or modifying this file, see [Download and build the proxy]({{<proxy_base_path>}}install#download).
4242
* The proxy loads a configuration file named `my_config.lua` stored in your home directory.
4343
* The proxy listens for connections on TCP port `11212`.
4444
* The proxy runs in the background.
4545

4646
```console
47+
# Using the builtin routelib
48+
memcached -o proxy_config=routelib,proxy_arg=$HOME/my_config.lua -p 11212 &
49+
# Manually using a modified or newer routelib
4750
memcached -o proxy_config=$HOME/routelib.lua,proxy_arg=$HOME/my_config.lua -p 11212 &
4851
```
4952

@@ -88,7 +91,7 @@ To specify multiple, tagged TCP ports, include the `-l` or `--listen` command-li
8891
For example, the following command runs the proxy with three TCP ports active. Two of the ports are tagged `main` and `alt`, respectively, and one port has no tag associated with it:
8992

9093
```console
91-
memcached -o proxy_config=$HOME/routelib.lua,proxy_arg=$HOME/my_config.lua -l 127.0.0.1:11211 -l main:127.0.0.1:11212 -l alt:127.0.0.1:11213 &
94+
memcached -o proxy_config=routelib,proxy_arg=$HOME/my_config.lua -l 127.0.0.1:11211 -l main:127.0.0.1:11212 -l alt:127.0.0.1:11213 &
9295
```
9396

9497
For more information on configuring the proxy to handle requests based on connected ports, see [Define multiple route trees]({{<proxy_base_path>}}configure/#multiple-trees).

0 commit comments

Comments
 (0)