NoSQL Redis
Install and test apsaradb for Redis-CentOS 6.5 1. Download redis to install it online or download redis ① check whether the rpm package does not exist before online Installation
Install and test apsaradb for Redis-CentOS 6.5 using NoSQL
1. Download redis
You can install or download redis online.
① Check whether the rpm package does not exist before online installation. If you check whether the rpm package does not exist in yum online, you can only download the package manually or in other ways.
[Root @ localhost ~] # Rpm-qa | grep redis
[Root @ localhost ~] # Yum list | grep redis
It indicates that it does not exist.
② Go to the official website or download it online
Wget
Redis downloaded from the official website already exists. Click to download redis.
2. Installation
Because it is in the tar.gz format, you need to decompress and install
Find the path of the downloaded file
[Root @ localhost ~] # Whereis redis
Redis:/etc/redis
[Root @ localhost ~] #
The gcc environment is required for decompressing and compiling the redis software package.
In short, what installation is missing.
Tar-zxvf reids-2.8.13.tar.gz
Cd redis-2.8.13
Make
Sudo make install
# Start configuration ---
After compilation, the Src directory contains four executable files: redis-server, redis-benchmark, redis-cli, and redis. conf. Then copy it to a directory.
Mkdir/usr/redis
Cp redis-server/usr/redis
Cp redis-benchmark/usr/redis
Cp redis-cli/usr/redis
Cp redis. conf/usr/redis
Cd/usr/redis
# End of configuration --
Or you can configure it like this
Mkdir/etc/redis
Cp redis. conf/etc/redis. conf
Mkdir/var/lib/redis
You can download the modified redis. conf from here.
Start redis
Redis-server/etc/redis. conf
# You can start the redis service in the background and check whether it is running. You can run the redis-benchmark command to test it. You can also use the redis-cli command to perform the following operations:
# When installing, The redis command will be copied to/usr/local/bin.
3. Test
Check whether the client is successfully started.
[Root @ localhost src] # ps-aux | grep redis
Warning: bad syntax, perhaps a bogu '-'? See/usr/share/doc/procps-3.2.8/FAQ
Root 23266 0.0 0.7 137356 7768? Sl redis-server *: 6379
Root 23982 0.0 0.5 19404 5100 pts/0 S + redis-cli
Root 24398 0.0 0.0 103244 876 pts/2 S + grep redis
[Root @ localhost src] # redis-cli
127.0.0.1: 6379> set w wang
OK
127.0.0.1: 6379> get w
"Wang"
Wagner. 0.0.1: 6379>
4. Close the service
Redis-cli shutdown
If the port changes, you can specify the Port:
Redis-cli-p 6379 shutdown
127.0.0.1: 6379> I + j
Cocould not connect to Redis at 127.0.0.1: 6379: Connection refused
Not connected> set w 3
Cocould not connect to Redis at 127.0.0.1: 6379: Connection refused
Not connected>
5. Start the service
[Root @ localhost src] # redis-server
[24502] 28 Oct 01:54:35. 784 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server/path/to/redis. conf
[24502] 28 Oct 01:54:35. 784 * Increased maximum number of open files to 10032 (it was originally set to 1024 ).
_._
_.-''__''-._
_.-'''. '_. ''-. _ Redis 2.8.13 (00000000/0) 64 bit
.-''.-"."\/_.,_''-._
(',.-' | ',) Running in stand alone mode
| '-. _'-...-'_...-.'-. _ | ''_.-'| Port: 6379
| '-. _'. _/_.-'| PID: 24502
'-._'-._'-./_.-'_.-'
| '-. _.-' |
| '-. _'-. _.-'_.-' |
'-._'-._'-.__.-'_.-'_.-'
| '-. _.-' |
| '-. _'-. _.-'_.-' |
'-._'-._'-.__.-'_.-'_.-'
'-._'-.__.-'_.-'
'-.__.-'
'-.__.-'
[24502] 28 Oct 01:54:35. 786 # Server started, Redis version 2.8.13
[24502] 28 Oct 01:54:35. 786 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. to fix this issue add'vm. overcommit_memory = 1' to/etc/sysctl. conf and then reboot or run the command 'sysctl vm. overcommit_memory = 1' for this to take effect.
[24502] 28 Oct 01:54:35. 786 * DB loaded from disk: 0.000 seconds
[24502] 28 Oct 01:54:35. 786 * The server is now ready to accept connections on port 6379
It is recommended that you re-open a window to run redsi-cli to enter the Console