In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Download redis
You can install or download redis online
Before ① is installed online, you need to check whether there is a rpm package. If the yum package does not exist, you can only download it manually or by other means if the rpm package does not exist.
[root@localhost ~] # rpm-qa | grep redis [root@localhost ~] # yum list | grep redis
Which means it doesn't exist.
Download ② from the official website or online.
Wget http://redis.googlecode.com/files/redis-2.2.13.tar.gz
The redis downloaded from the official website already exists in the blog. Click to download redis.
two。 Installation
Because it is in tar.gz format, it needs to be unzipped and installed
After downloading, find the path where the downloaded file is located
[root@localhost ~] # whereis redisredis: / etc/redis [root@localhost ~] #
Decompressing and compiling redis software packages requires a gcc environment
In short, what is missing, what is installed.
Tar-zxvf reids-2.8.13.tar.gzcd redis-2.8.13makesudo make install# configuration starts-after compilation, there are four executable files redis-server, redis-benchmark, redis-cli, and redis.conf in the Src directory. Then copy it to a directory. End of mkdir / usr/rediscp redis-server / usr/rediscp redis-benchmark / usr/rediscp redis-cli / usr/rediscp redis.conf / usr/rediscd / usr/redis# configuration--
Or you can configure it like this.
Mkdir / etc/rediscp redis.conf / etc/redis/redis.confmkdir / var/lib/redis
You can download the modified redis.conf here
Start redisredis-server / etc/redis/redis.conf# and start the redis service in the background. After confirming that the service is running, you can use the redis-benchmark command to test and see if you can actually use the redis-cli command. For example, when # install is used, the redis command will be copied to / usr/local/bin.
3. test
The client tests whether the startup is successful.
[root@localhost src] # ps-aux | grep redisWarning: bad syntax, perhaps a bogus'-'? See / usr/share/doc/procps-3.2.8/FAQroot 23266 0.0 0.7 137356 7768? Sl 00:23 0:04 redis-server *: 6379root 23982 23982 19404 5100 pts/0 S + 01:09 0:00 redis-cliroot 24398 103244 876 pts/2 S + 01:44 0:00 grep redis [root@localhost src] # redis-cli127.0.0.1:6379 > set w wangOK127.0.0.1:6379 > get w "wang" 127.0.0.1 pts/0 6379 >
4. Shut down the service
Redis-cli shutdown if the port changes, you can specify the port: redis-cli-p 6379 shutdown127.0.0.1:6379 > i+jCould not connect to Redis at 127.0.0.1 Connection refusednot connected: Connection refusednot connected > set w 3Could not connect to Redis at 127.0.0.1 Connection refusednot connected: Connection refusednot 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 Increased maximum number of open files to 35.784 * Increased maximum number of open files to 1024. _. _.-`. `_. '' -. _ Redis 2.8.13 (000000Universe 0) 64 bit.-``.- ```. ```\ / _., _'-. _ (.-`|` ) Running in stand alone mode | `-. _` -.-`_ _...-.`` -. _ |'` _. -'| Port: 6379 | `-. _`. _ / _. -'| PID: 24502 `-. _` -. _ `-. _. -'| |` -. _ `-. _ _. -'_. -'| http://redis.io` -. _ `-. _. -'. | | `-. _` -. _ `. -'_. -'| |` -. _ `-. -'_. -'. _. -'`-. _`. -'. [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 sysctl vm.overcommit_memory=1' for this to take effect 54 sysctl vm.overcommit_memory=1' for this to take effect 35.786 * DB loaded from disk: 0.000 seconds [24502] 28 Oct 01 Switzerland 54Switzerland 35.786 * The server is now ready to accept connections on port 6379
After startup, it is best to reopen a window and run redsi-cli to enter the console.
Otherwise, a connection error may occur. Similar to running tomcat on cmd under windows.
[root@localhost redis] # redis-cliCould not connect to Redis at 127.0.0.1 redis-cliCould not connect to Redis at 6379: Connection refusednot connected > [root@localhost redis] # redis-cli127.0.0.1:6379 > set name = wangxin (error) ERR syntax error127.0.0.1:6379 > set name wangxinOK127.0.0.1:6379 > set age 26OK127.0.0.1:6379 > get name age (error) ERR wrong number of arguments for' Get' command127.0.0.1:6379 > get name "wangxin" 127.0.0.1 wangxin 6379 > get age "26" 127.0.0.1 VR 6379 >
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.