Übersicht
Redis is an advanced key-value cache and store, similar to memcached with better performance. It is available on newer platforms (v6+) without any additional compilation from source. Accounts with terminal access are eligible to use Redis.
Schnellstart
From the Terminal, run: redis-server --bind 127.0.0.1 --port PORT
where PORT is a preassigned port to the account.
Hinweis: use 127.0.0.1 to prevent outside network activity. 127.0.0.1 will only allow traffic that originates from the same server. A better solution, if using CGI or a Schiene application, is to specify —unixsocket /tmp/redis.sock
anstelle von --bind
/--port
to specify a local UNIX domain socket instead of a TCP socket.
Configuring & Daemonizing
Now with Redis up and running, you can create a long-term solution that starts up with the server and always runs in the background. Start with either the stock configuration or just copy and paste, making sure to update the port
parameter to a port assigned to your account.
Note: as with most configuration files, any line that begins with a octothorpe/pound/hash symbol (#) denotes a comment. These are never interpreted by an application, but serve as guidance. The following configuration omits these helpful comments for brevity.
Copy and paste the following content to a file named redis.conf
in your home directory:
# run as service daemonize yes pidfile ~/redis.pid ######################################### # USE A PREALLOCATED PORT TO YOUR ACCOUNT ######################################### port 123 # limit to local traffic only bind 127.0.0.1 # To use a high performance local socket, uncomment # these 2 lines and comment port/bind: # unixsocket /tmp/redis.sock # unixsocketperm 700 timeout 60 tcp-keepalive 30 # Create a log file and log errors to redis.log loglevel warning logfile /tmp/redis.log # Limit to 1000 concurrent clients maxclients 1000 # Restrict Redis to use only 128 MB of memory # More may result in service interruption maxmemory 128m
A quick and easy way to do this is with Vim, a text-editor available through the terminal:
vim ~/redis.conf
- Type
i
on the keyboard to switch to “Insert” mode- Depending upon client, paste the text through CTRL + V, Shift + INS, or a suitable key combination
- Hit the Esc(ape) key.
- Type
:wq
- Done!
Now to start Redis using the configuration, type: redis-server ~/redis.conf
Starting on Start-up
- Visit Dev > Task Scheduler innerhalb der Bedienfeld to schedule a new task.
- Under Command, enter
redis-server ~/redis.conf
- Under Scheduling, select Server Start
- Click Add