In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Redis Overview Redis is a high-performance key-value database. The emergence of redis makes up for the deficiency of key/value storage such as memcached to a great extent, and can play a good complementary role to relational database in partial situations. It provides clients such as Java,C/C++,C#,PHP,JavaScript,Perl,Object-C,Python,Ruby,Erlang, which is easy to use. Redis has the advantage of extremely high data read and write speed support rich data types support data persistence atomicity support data backup Redis configuration file (/ etc/redis/6379.conf) bind: listening host address port: Port daemonize yes: enable daemon pidfile: specify PID file loglevel notice: log level logfile: specify log file Redis installation deployment # install and compile environment [root@localhost ~] # yum install gcc gcc-c++ make-y # remote mount source package [root@localhost] # mount.cifs / / 192.168.142.1/redis / mntPassword for root@//192.168.142.1/redis: # decompress the source package [root@localhost] # cd / mnt [root@localhost mnt] # tar zxvf redis-5.0.7.tar.gz-C / opt# compile and install [root@localhost mnt] # cd / opt/redis-5. 0.7 / [root@localhost redis-5.0.7] # make [root@localhost redis-5.0.7] # make PREFIX=/usr/local/redis/ install# create service command soft link to the system [root@localhost redis-5.0.7] # ln-s / usr/redis/bin/* / usr/local/bin/# cut into the utils directory [root@localhost redis-5.0.7] # cd / opt/redis-5.0.7/utils/# Execute the startup script [root@localhost utils] #. / install_server.sh# the following Enter by default Welcome to the redis service installerThis script will help you easily set up a running redis serverPlease select the redis port for this instance: [6379] Selecting default: 6379Please select the redis config file name [/ etc/redis/6379.conf] Selected default-/ etc/redis/6379.confPlease select the redis log file name [/ var/log/redis_6379.log] Selected default-/ var/log/redis_6379.logPlease select the data directory for this instance [/ var/lib/redis/6379] Selected default- / var/lib/redis/6379Please select the redis executable path [] / usr/local/redis/bin/redis-server# here you need to manually specify the extension directory path / usr/local/redis/bin/redis-server# use process control to start the service [root@localhost utils] # / etc/init.d/redis_6379 startStarting Redis server...# configure the 6379.conf file of redis Append listening address [root@localhost utils] # vim / etc/redis/6379.conf bind 127.0.0.1 192.168.142.13 "restart service [root@localhost utils] # / etc/init.d/redis_6379 restartStopping... Redis stoppedStarting Redis server...Redis common command demonstration # connect to local database [root@localhost utils] # / usr/local/redis/bin/redis-cli127.0.0.1:6379 > # number of remote connections According to the library [root@localhost utils] # redis-cli-h 192.168.142.136-p 6379192.168.142.136 set 6379 > [root@localhost utils] # / usr/local/redis/bin/redis-cli# get the set command help 127.0.0.1 set 6379 > help set SET key value [expiration EX seconds | PX milliseconds] [NX] summary: Set the string value of a key since: 1.0.0 group: string# stores data 127.0.0.16379 > set teacher WangminOK# get data 127.0.0.1teacher 6379 > get teacher "wangmin" # View current database all keys 127.0.0.1teacher * 1) "teacher" 2) "st" 3) "teacer" 4) "stu" 5) "student" # View current database 127.0.0.1wangmin 6379 > keys tweets 1) "teacher" 2) "teacer" # View the current database after it begins with s "st" # View the keys in the current database that start with s and contain any two sum characters (127.0.0.1 keys characters 1) "stu" # to determine whether the key value stores 127.0.0.1 keys 6379 > exists stu (integer) returns an int of 1 Then it indicates that there is a key value of 127.0.0.1 6379 > exists std (integer) returns an int value of 0 Then the key value does not exist. # Delete the specified key127.0.0.1:6379 > del st (integer) values of the current database to get the corresponding value type 127.0.0.1 integer 6379 > type stustring# to rename existing ones to override 127.0.0.1 rename student studOK127.0.0.1:6379 > get stud "yuanyuan" # to rename existing ones without overwriting 127.0.0.16379 > Renamenx stud st (integer) 1127.0.0.1 key 6379 > get st "yuanyuan" # View the number of key in the current database 127.0.0.1 key 6379 > dbsize (integer) 4redis-benchmark Test tool-h: specify server hostname-p: specify server port-C: specify number of concurrent connections-n: specify number of requests-d: specify the data size of the SET/ get value in bytes-Q: force redis. Show only query/ secvalue
1. Send 100 concurrent connections and 100000 requests to the redis server with IP address 192.168.142.136 at port 6379 to test performance
[root@localhost utils] # / usr/local/redis/bin/redis-benchmark-h 192.168.142.136-p 6379-c 100-n 1000000.. # main view set and get performance parameters = SET = 100000 requests completed in 1.03 seconds 100 parallel clients 3 bytes payload keep alive: 193.23%
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.