标签:SQ res .gz pen lex cto port ati http
Redis is a flexible, open-source, key value data store. Following in the footsteps of other NoSQL databases, such as Cassandra, CouchDB, and MongoDB, Redis allows the user to store vast amounts of data without the limits of a relational database. Additionally, it has also been compared to memcache and can be used, with its basic elements as a cache with persistence.
Before installing redis, there are a couple of prerequisites that need to be downloaded in-order to proceed with the installation.
1. Update all of the apt-get packages.
1
|
sudo apt-get update
|
2. Download a compiler with build essential in-order to install Redis from source.
1
|
sudo apt-get install build-essential
|
3. Download and install tcl8.5
1
|
sudo apt-get install tcl8.5
|
After all of the prerequisites and dependencies downloaded to the server, you can proceed with the Redis installation from source.
1. Download the Stable Redis release from their website. google code. The latest stable version is 2.8.3
1
|
wget http://download.redis.io/releases/redis-2.8.3.tar.gz
|
2. Extract the downloaded .tar file, and switch into that directory.
1
|
tar -xvzf redis-2.8.3.tar.gz && cd redis-2.8.3
|
3. Proceed to with the make command.
1
|
make
|
4. Run the recommended make test .
1
|
make test
|
5. Do the make install , which installs the program system-wide.
1
|
sudo make install
|
6. Once the program has been installed, Redis comes with a built in script that sets up Redis to run as a background daemon. To access the script move into the utils directory.
1
|
cd utils
|
7. From there, run the Ubuntu/Debian install script.
1
|
sudo ./install_server.sh
|
8. As the script runs, you can choose the default options by pressing enter. Once the script completes, the redis-server will be running in the background. You can start and stop redis with these commands (the number depends on the port you set during the installation. 6379 is the default port setting).
1
2
|
sudo service redis_6379 start
sudo service redis_6379 stop
|
install:(3.2)
wsl0414@DESKTOP-AQ5HJNE:~$ sudo apt-get update wsl0414@DESKTOP-AQ5HJNE:~$ sudo apt-get install build-essential wsl0414@DESKTOP-AQ5HJNE:~$ sudo apt-get install tcl wsl0414@DESKTOP-AQ5HJNE:~$ wget http://download.redis.io/releases/redis-3.2.11.tar.gz wsl0414@DESKTOP-AQ5HJNE:~$ tar zxvf redis-3.2.11.tar.gz wsl0414@DESKTOP-AQ5HJNE:~$ cd redis-3.2.11 wsl0414@DESKTOP-AQ5HJNE:~/redis-3.2.11$ make wsl0414@DESKTOP-AQ5HJNE:~/redis-3.2.11$ sudo make install wsl0414@DESKTOP-AQ5HJNE:~/redis-3.2.11$ cd utils wsl0414@DESKTOP-AQ5HJNE:~/redis-3.2.11/utils$ sudo ./install_server.sh Welcome to the redis service installer This script will help you easily set up a running redis server Please select the redis port for this instance: [6379] Selecting default: 6379 Please select the redis config file name [/etc/redis/6379.conf] Selected default - /etc/redis/6379.conf Please select the redis log file name [/var/log/redis_6379.log] Selected default - /var/log/redis_6379.log Please select the data directory for this instance [/var/lib/redis/6379] Selected default - /var/lib/redis/6379 Please select the redis executable path [/usr/local/bin/redis-server] Selected config: Port : 6379 Config file : /etc/redis/6379.conf Log file : /var/log/redis_6379.log Data dir : /var/lib/redis/6379 Executable : /usr/local/bin/redis-server Cli Executable : /usr/local/bin/redis-cli Is this ok? Then press ENTER to go on or Ctrl-C to abort. Copied /tmp/6379.conf => /etc/init.d/redis_6379 Installing service... Success! Starting Redis server... Installation successful!
test:
wsl0414@DESKTOP-AQ5HJNE:~/redis-3.2.11/utils$ sudo service redis_6379 start wsl0414@DESKTOP-AQ5HJNE:~/redis-3.2.11/utils$ redis-cli 127.0.0.1:6379> ping PONG 127.0.0.1:6379> set key1 hello world (error) ERR syntax error 127.0.0.1:6379> set key1 [hello world] (error) ERR syntax error 127.0.0.1:6379> set key1 "hello world" OK 127.0.0.1:6379> get key1 "hello world" 127.0.0.1:6379> exit
标签:SQ res .gz pen lex cto port ati http
原文地址:https://www.cnblogs.com/xiaobin-hlj80/p/9047802.html