ÉèΪÊ×Ò³ ¼ÓÈëÊÕ²Ø

TOP

3.ÆôÍ£redis·þÎñ
2015-07-24 10:52:40 À´Ô´: ×÷Õß: ¡¾´ó ÖРС¡¿ ä¯ÀÀ:1´Î
Tags£ºÆôÍ£ redis ·þÎñ

1.±àÒëredis.conf²ÎÊýÎļþ°²×°Íê³Éºó£¬ÎÒÃǾ͵ó¢ÊÔÆô¶¯redis·þÎñÁË¡£ÔÚ$REDIS_HOME£¬±àÒëÈçÏÂÎļþ /home/ldh/redis/redis-2.8.3/redis.conf

Ð޸Ķ˿ڽ«PORT 6379¸Ä³ÉÄãÏëÒªµÄ±»¿Í»§·ÃÎʵĶ˿ڣ¬²»¸ÄÒ²¿ÉÒÔ£¬Ö»Òª²»³åÍ»¡£ ÉèÖÃÃÜÂ룺 redis.confÖÐrequirepassǰµÄ×¢ÊÍÈ¥µô£¬ºóÃæ¼ÓÉÏÃÜÂ룬Èç requirepass pass1234 Èç¹û·þÎñÒѾ­Æô¶¯£¬ÐÞ¸ÄÃÜÂëºóÐèÒªÖØÆô·þÎñ²ÅÄÜʹÐÂÃÜÂëÉúЧ¡£

2.Æô¶¯·þÎñÆô¶¯·þÎñ£¬¼ÙÈç²»ÓÃNohupµÄ»°£¬µ±Ç°»á»°¾Í²»ÄÜÔÙ½øÐÐÆäËû²Ù×÷¿©¡£ nohup redis-server /home/ldh/redis/redis-2.8.3/redis.conf & ÎÒÃÇÀ´¿´¿´nohup.outÖУ¬Õâ¸ö·þÎñÆô¶¯»á·´À¡Ê²Ã´ÐÅÏ¢ [ldh@hauser redis-2.8.3]$ vi nohup.out [22624] 25 Dec 11:00:06.456 # Fatal error, can't open config file '/home/otredis/redis/2.6.16/conf/redis.conf' [22726] 25 Dec 11:06:01.442 # Fatal error, can't open config file '/home/otredis/redis/2.6.16/conf/redis.conf' [22737] 25 Dec 11:06:25.925 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 992. _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 2.8.3 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in stand alone mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 6389 | `-._ `._ / _.-' | PID: 22737 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' [22737] 25 Dec 11:06:25.931 # Server started, Redis version 2.8.3 [22737] 25 Dec 11:06:25.931 # 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. [22737] 25 Dec 11:06:25.931 * The server is now ready to accept connections on port 6389

´Ëʱ£¬redis·þÎñÒѾ­Æô¶¯ÁË¡£

3.µÇ½redis ´ËʱÎÒÃǵǽµ½redisÊý¾Ý¿âµ±ÖÐ [ldh@hauser redis-2.8.3]$ redis-cli -h 127.0.0.1 -p 6389 -a pass1234 127.0.0.1:6389> set fwy abc OK 127.0.0.1:6389> get fwy "abc"

±¾»úµÇ½µÄ»°£¬Ò²¿ÉÒÔÊ¡ÂÔ-h£¬Èç¹ûÊÇÓÃĬÈ϶˿Ú6379£¬ÄÇô-pÒ²¿ÉÒÔÊ¡ÂÔ¡£Èçredis-cli -a pass1234µÇ½¼´¿ÉÈç¹ûÔ¶³ÌµÇ½£¬¿ÉÒÔÓÃtelnetµÇ½£¬Í˳öʱÇýøquit [fengweiyuan513@cnsz081003 ~]$ telnet 10.25.30.143 6389 Trying 10.25.30.143... Connected to 10.25.30.143 (10.25.30.143). Escape character is '^]'. auth pass1234 +OK get fwy $1 2 quit +OK Connection closed by foreign host. [fengweiyuan513@cnsz081003 ~]$

4.Í£Ö¹redis·þÎñ [ldh@hauser ~]$ redis-cli -h 127.0.0.1 -p 6389 -a pass1234 127.0.0.1:6389> shutdown 127.0.0.1:6389> exit ÔÙÁ¬½ÓÒ»´ÎÒѾ­·¢ÏÖ²»´æÔÚÁË£¬Ò²¿ÉÒÔͨ¹ýps -ef | grep redisÀ´¹Û²ì [ldh@hauser ~]$ redis-cli -p 6389 -a pass1234 Could not connect to Redis at 127.0.0.1:6389: Connection refused Ô¶³Ìͨ¹ýtelnetÀ´shutdownÒ²ÊÇ¿ÉÒԵģ¬¸Ð¾õͦ²»°²È«µÄ¡£

¡¾´ó ÖРС¡¿¡¾´òÓ¡¡¿ ¡¾·±Ìå¡¿¡¾Í¶¸å¡¿¡¾Êղء¿ ¡¾ÍƼö¡¿¡¾¾Ù±¨¡¿¡¾ÆÀÂÛ¡¿ ¡¾¹Ø±Õ¡¿ ¡¾·µ»Ø¶¥²¿¡¿
·ÖÏíµ½: 
ÉÏһƪ£ºmysql-5.6.24-x64°²×°»·¾³windows.. ÏÂһƪ£ºTNS-01201:Listenercannotfindexe..

ÆÀÂÛ

ÕÊ¡¡¡¡ºÅ: ÃÜÂë: (ÐÂÓû§×¢²á)
Ñé Ö¤ Âë:
±í¡¡¡¡Çé:
ÄÚ¡¡¡¡ÈÝ:

¡¤Linuxϵͳ¼ò½é (2025-12-25 21:55:25)
¡¤Linux°²×°MySQL¹ý³Ì (2025-12-25 21:55:22)
¡¤Linuxϵͳ°²×°½Ì³Ì£¨ (2025-12-25 21:55:20)
¡¤HTTP Åc HTTPS µÄ²î„ (2025-12-25 21:19:45)
¡¤ÍøÕ¾°²È«±ØÐ޿ΣºÍ¼ (2025-12-25 21:19:42)