In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Premise: preparation of environmental materials
CentOS Linux release 7.2.1511 (Core)
Redis-3.2.8.tar.gz
1. Download (Download), decompress (extract), integrity check (How to verify files for integrity)
Redis uses a standard practice for its versioning: major.minor.patchlevel. Redis uses standard practice for version control: major version number. The second edition number. Revision number
An even minor marks a stable release, like 1.2, 2.0, 2.2, 2.4, 2.6, 2.8. An even number of versions indicates a stable release, such as 1.2, 2.0, 2.4, 2.6, 2.8.
Odd minors are used for unstable releases, for example 2.9.x releases are the unstable versions of what will be Redis 3.0 once stable. The odd version number is used to indicate an unstable version, for example, 2.9.x is an unstable version, and once stable, it is 3.0.
Integrity: compared with redis-hashes
$wget $sha1sum redis-3.2.8.tar.gz6780d1abb66f33a97aad0edbe020403d0a15b67f redis-3.2.8.tar.gz$ tar zxvf redis-3.2.8.tar.gz$ cd redis-3.2.82. Compile (compile), install (Installing)
In order to install Redis binaries into / usr/local/bin just use:
% make install
You can use make PREFIX=/some/other/directory install if you wish to use a different destination. If you want to install binary commands to a different directory
Make install will just install binaries in your system, but will not configure init scripts and configuration files in the appropriate place. This is not needed if you want just to play a bit with Redis, but if you are installing it the proper way for a production system, we have a script doing this for Ubuntu and Debian systems:
Make install installs only binaries on the system, but does not configure init scripts and configuration files in the appropriate locations. If you only want to play a little Redis, this is not necessary. But if you are looking for a more appropriate way to install it for production systems, for Ubuntu and Debian systems, we have a script to do this:
% cd utils%. / install_server.sh
The script will ask you a few questions and will setup everything you need to run Redis properly as a background daemon that will start again on system reboots.
You'll be able to stop and start Redis using the script named / etc/init.d/redis_
For instance / etc/init.d/redis_6379.
# cd redis-3.2.8# make PREFIX=/usr/local/redis installHint: It's a good idea to run 'make test';) # make test.\ o / All tests passed without errorscleaning cleanup: may take some time... OK# mkdir-pv / usr/local/redis/ {etc,log Lib} mkdir: created directory'/ usr/local/redis/etc'mkdir: created directory'/ usr/local/redis/log'# cd utils#. / install_server.shWelcome 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] / usr/local/redis/etc/6379.confPlease select the redis log file name [/ var/log/redis_6379.log ] / usr/local/redis/log/redis_6379.logPlease select the data directory for this instance [/ var/lib/redis/6379] / usr/local/redis/lib/6379Please select the redis executable path [] / usr/local/redis/bin/redis-serverSelected config:Port: 6379Config file: / usr/local/redis/etc/6379.confLog file: / usr/local/redis/log/redis_6379.logData dir: / usr/ Local/redis/lib/6379Executable: / usr/local/redis/bin/redis-serverCli Executable: / usr/local/redis/bin/redis-cliIs this ok? Then press ENTER to go on or Ctrl-C to abort.Copied / tmp/6379.conf = > / etc/init.d/redis_6379Installing service...Successfully added to chkconfigsuccessful added to runlevels 345 starting Redis server...Installation fulfilling # ps aux | grep redisroot 58811 0.2 0.1 136912 7524? Ssl 18:31 0:00 / usr/local/redis/bin/redis-server 127.0.0.1:6379# The binaries that are now compiled are available in the src directory. The compiled binaries are now in the src directory. # cd src/# md5sum redis*3c507af948c7bc80cb92c66a5ed17bc1 redisassert.hd7fcdd079f9fb025e5e380603dfecf4b redis-benchmark4230b5d20e23fc25411d99cc56429692 redis-benchmark.cfd9d73aeb32a609957b77edb83e82fa9 redis-benchmark.od575a6cc0bc896a722a4d70cbe1352c2 redis-check-aof991bf6ef06e1fc4d0a66a48c1505e498 redis-check-aof.c2bdfdbbb16ec9c227128d6c239a5706c redis-check-aof.o1e3f0c6d96b88dcdca1b4d35d169b52f redis-check-rdb34cbd2a2be9ecf8ab21e65ca9095cc67 redis-check-rdb.c3068ffe1e036d12b8df0d9f28290f972 redis-check-rdb.o4e45e24376159a1121a54e9e5eee3f2f redis-cli2a2af684a4e598d024f1c606a5c7913e redis-cli.c9494101d9b9c68866ec95f8921574dcf redis-cli.o1e3f0c6d96b88dcdca1b4d35d169b52f redis-sentinel * same 1e3f0c6d96b88dcdca1b4d35d169b52f redis-server * 70b2284c8833a8773e26abe6ba7797c3 redis-trib.rb# tree / usr/local/redis//usr/local/redis/ ├── bin │ ├── redis-benchmark │ ├── redis-check-aof │ ├── redis-check-rdb │ ├── redis-cli │ | ├── redis-sentinel-> redis-server # the same │ └── redis-server ├── etc │ └── 6379.conf ├── lib └── log3. Modify the SysV service script # cat / etc/init.d/redis_6379 #! / bin/sh#Configurations injected by install_server below....EXEC=/usr/local/redis/bin/redis-serverCLIEXEC=/usr/local/redis/bin/redis-cliPIDFILE=/var/run/redis_6379.pidCONF= "/ usr/local/redis/etc/6379.conf" REDISPORT= "6379" # SysV Init Information# chkconfig:-30 5 minutes description: redis _ 6379 is the redis daemon.### BEGIN INIT INFO# Provides: redis_6379# Required-Start: $network $local_fs $remote_fs# Required-Stop: $network $local_fs $remote_fs# Default-Start: 2 3 4 "Default-Stop: 0 1" Should-Start: $syslog $named# Should-Stop: $syslog $named# Short-Description: start and stop redis_6379# Description: Redis daemon### END INIT INFOcase "$1" in start) if [- f $PIDFILE] Then echo "$PIDFILE exists Process is already running or crashed "else echo" Starting Redis server... "$EXEC $CONF fi Stop) if [!-f $PIDFILE] then echo "$PIDFILE does not exist Process is not running "else PID=$ (cat $PIDFILE) echo" Stopping... "$CLIEXEC-p $REDISPORT shutdown while [- x / proc/$ {PID}] do echo" Waiting for Redis to shutdown... " Sleep 1 done echo "Redis stopped" fi Status) PID=$ (cat $PIDFILE 2 > / dev/null) # after the original PID=$ (cat $PIDFILE) stop, the file does not exist. The exception if [- z ${PID}] # was originally if [!-x / proc/$ {PID}] PID, but / proc still exists even if it is empty Finally, you will return to the running status then echo 'Redis is not running' else echo "Redis is running ($PID)" fi ; restart) $0 stop $0 start;; *) echo "Please use start, stop, restart or status as first argument";; esac4. Connection test # redis-cli-h localhost-p 6379localhost:6379 > pingPONGlocalhost:6379 > set foo barOKlocalhost:6379 > get foo "bar" localhost:6379 > ping 'zcy' "zcy" 5. Shut down the service # netstat-tlnp | grep 6379 127.0.0.1 grep 6379 0.0.0.0 LISTEN 67387/redis-server # pkill-u root redis # method "netstat-tlnp | grep 637" service redis_6379 statusRedis is not running# service redis_6379 stoppid does not exist Process is not running# service redis_6379 startStarting Redis server...# redis-cli-h localhost-p 6379 get foo "bar" # redis-cli-h localhost-p 6379 shutdown # method 2: the service script uses this one. # service redis_6379 statusRedis is not running# regardless of which way to disable the service, the following log will be generated: 71428 User requested shutdown... M 25 Feb 22 User requested shutdown... 06VR 09.131 # log Close the user's request for 71428 Feb M 25 22 06lo 09.131 * Saving the final RDB snapshot before exiting. Save the last RDB snapshot 71428 Feb 22 DB saved on disk DB 71428 DB saved on disk DB 22 06 DB saved on disk DB 09.142 * on disk before closing. Save to disk 71428 DB saved on disk DB 22 06 DB saved on disk DB 09.142 * disk. Remove PID file 71428 Redis is now ready to exit M 25 Feb 22 Redis is now ready to exit 22 Redis is now ready to exit 09.142 # bye bye.. Pkill, kill send signal 15 SINTERM to generate log: 67387:signal-handler (1488031433) Received SIGTERM scheduling shutdown... The termination signal has been received and arranged to be turned off.
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.