{"rsdb":{"rid":"395069","subhead":"","postdate":"0","aid":"272462","fid":"57","uid":"1","topic":"1","content":"

\u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528Redis\uff1f<\/p>

\u5982\u4e0a\u6240\u8ff0\uff0cRedis\u7684\u6027\u80fd\u548c\u5353\u8d8a\u529f\u80fd\u4f7f\u5176\u6bd4\u4f20\u7edf\u6570\u636e\u5e93\u66f4\u597d\u3002 Redis\u7684\u5178\u578b\u7528\u6cd5\u662f\uff1a<\/p>

\u5982\u4f55\u5728Ubuntu\u4e0a\u5b89\u88c5Redis\uff1f<\/strong><\/p>

Redis\u5b58\u5728\u4e8eUbuntu\u7684\u5b98\u65b9\u8f6f\u4ef6\u5305\u5b58\u50a8\u5e93\u4e2d\u3002\u73b0\u5728\u8ba9\u6211\u4eec\u5728Ubuntu\u4e0a\u5b89\u88c5Redis\uff1a<\/p>

1\u3001\u66f4\u65b0APT\u5b58\u50a8\u5e93\u7f13\u5b58<\/p>

\u4e3a\u4e86\u5b89\u88c5Redis\uff0c\u9996\u5148\u9700\u8981\u66f4\u65b0Ubuntu\u7684APT\u5b58\u50a8\u5e93\u7f13\u5b58\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u64cd\u4f5c\uff1a<\/p>

2\u3001\u4f7f\u7528APT\u547d\u4ee4\u5728Ubuntu\u4e0a\u5b89\u88c5Redis<\/p>

\"\u5982\u4f55\u5728Ubuntu<\/p>

\u6309y\uff0c\u7136\u540e\u6309Enter\u952e\u7ee7\u7eed\u3002<\/p>

3\u3001\u68c0\u67e5Redis\u7248\u672c<\/p>

\u4e3a\u4e86\u68c0\u67e5Redis\u662f\u5426\u6b63\u786e\u5b89\u88c5\u5e76\u6b63\u5e38\u5de5\u4f5c\uff0c\u53ef\u4ee5\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>

\"\u5982\u4f55\u5728Ubuntu<\/p>

\u8f93\u51fa\u5c06\u663e\u793a\u8ba1\u7b97\u673a\u4e0a\u5f53\u524d\u5b89\u88c5\u7684\u5b9e\u7528\u7a0b\u5e8f\u7684\u7248\u672c\u3002<\/p>

\u542f\u52a8\u548c\u505c\u6b62Redis<\/strong><\/p>

\u5b8c\u6210\u5b89\u88c5\u540e\uff0c\u53ef\u4ee5\u68c0\u67e5Redis\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002 \u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6267\u884c\u6b64\u64cd\u4f5c\uff1a<\/p>

In the output, locate Active: active (running).<\/p>

\u5728\u8f93\u51fa\u4e2d\uff0c\u627e\u5230\u201c Active: active (running)<\/span><\/strong>\u201c\u3002<\/p>

\"\u5982\u4f55\u5728Ubuntu<\/p>

\u5982\u679c\u5c1a\u672a\u542f\u52a8Redis\uff0c\u5219\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u542f\u52a8\u5b83\uff1a<\/p>

\u5982\u679cRedis\u5df2\u7ecf\u5728\u8fd0\u884c\u5e76\u4e14\u8981\u505c\u6b62\u5b83\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>

\u6b64\u540e\uff0c\u60a8\u5c06\u5728\u672c\u8282\u4e2d\u7b2c\u4e00\u4e2a\u547d\u4ee4\u7684\u8f93\u51fa\u4e2d\u770b\u5230\u201cActive: inactive (dead)<\/strong> \u201d\u3002<\/p>

\"\u5982\u4f55\u5728Ubuntu<\/p>

\u5982\u4f55\u5728Ubuntu\u4e0a\u914d\u7f6eRedis\u670d\u52a1\u5668<\/strong><\/p>

Redis\u7684\u9ed8\u8ba4\u914d\u7f6e\u4f4d\u4e8e\/etc\/redis\/redis.conf\u4e2d\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u4fa6\u542c\u6765\u81ea\u670d\u52a1\u5668\u4e0a\u6240\u6709\u53ef\u7528\u63a5\u53e3\u7684\u8fde\u63a5\u3002 \u60a8\u53ef\u4ee5\u8ba9\u5b83\u4fa6\u542c\u60a8\u9009\u62e9\u7684\u63a5\u53e3\uff0c\u6839\u636e\u9700\u8981\u53ef\u4ee5\u662f\u4e00\u4e2a\u6216\u591a\u4e2a\u63a5\u53e3\u3002 \u8fd9\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u7ed1\u5b9a\u914d\u7f6e\u6307\u4ee4\u6765\u5b8c\u6210\uff0c\u8be5\u6307\u4ee4\u540e\u8ddf\u4e00\u4e2a\u6216\u591a\u4e2aIP\u5730\u5740\u3002<\/p>

\u8981\u6307\u793aRedis\u670d\u52a1\u5668\u4fa6\u542c\u7279\u5b9a\u7684IP\u5730\u5740\uff0c\u60a8\u9700\u8981\u7f16\u8f91\/etc\/redis\/redis.conf\u6587\u4ef6\u3002 \u7528\u60a8\u559c\u6b22\u7684\u7f16\u8f91\u5668\u6253\u5f00\u5b83\u3002 \u6211\u4eec\u5c06\u4f7f\u7528vi\u3002 \u6211\u4eec\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6253\u5f00\u6587\u4ef6\uff1a<\/p>

sudo vim \/etc\/redis\/redis.conf<\/p>

\u627e\u5230 bind 127.0.0.1 ::1<\/p>

\"\u5982\u4f55\u5728Ubuntu<\/p>

\u73b0\u5728\uff0c\u901a\u8fc7\u8f93\u5165\u60a8\u5e0c\u671bRedis\u670d\u52a1\u5668\u76d1\u542c\u7684\u63a5\u53e3\u7684\u503c\u6765\u66f4\u6539IP\u5730\u5740\u3002 \u4f8b\u5982\uff1a<\/p>

bind 192.168.213.135<\/p>

\u5982\u679c\u60a8\u60f3\u6dfb\u52a0\u591a\u4e2aIP\u5730\u5740\uff0c\u53ea\u9700\u5c06\u5b83\u4eec\u7528\u7a7a\u683c\u9694\u5f00\u5373\u53ef\uff1a<\/p>

bind 192.168.213.135 192.168.213.136<\/p>

\u5728\u8fd9\u91cc\u60a8\u9700\u8981\u8f93\u5165\u81ea\u5df1\u7f51\u7edc\u7684IP\u5730\u5740\u3002<\/p>

\u4f46\u662f\uff0c\u5982\u679c\u5e0c\u671b\u670d\u52a1\u5668\u4fa6\u542c\u7f51\u7edc\u4e0a\u7684\u6240\u6709\u63a5\u53e3\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>

bind 0.0.0.0<\/p>

\u5b8c\u6210\u66f4\u6539\u540e\uff0c\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\u3002 \u5728vim\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u70b9\u51fb\uff1a\u5e76\u6267\u884cwq!\u6765\u505a\u5230\u8fd9\u4e00\u70b9\u3002 \u7136\u540e\u91cd\u65b0\u542f\u52a8Redis\u670d\u52a1\u5668\u4ee5\u5e94\u7528\u66f4\u6539\u3002 \u91cd\u65b0\u542f\u52a8\u7684\u547d\u4ee4\u662f\uff1a<\/p>

sudo systemctl restart redis-server<\/p>

\u57fa\u672cRedis\u547d\u4ee4\u793a\u4f8b<\/strong><\/p>

Redis\u4e2d\u6709\u4e0d\u540c\u7684\u547d\u4ee4\u7ec4\uff0c\u5305\u62ec\uff1a<\/p>

\u8fd9\u91cc\u6211\u4eec\u63d0\u4e00\u4e9b\u5728Redis\u4e2d\u4f7f\u7528\u7684\u547d\u4ee4\u7ec4\u5408:<\/p>

\u603b\u7ed3<\/strong><\/p>

\u5982\u4f55\u5728Ubuntu\u4e0a\u5b89\u88c5Redis\uff1f \u5c31\u8fd9\u4e48\u7b80\u5355\uff01 \u5728\u672c\u6559\u7a0b\u7684\u5e2e\u52a9\u4e0b\uff0c\u60a8\u5df2\u5c06\u8be5\u5b9e\u7528\u7a0b\u5e8f\u6210\u529f\u6dfb\u52a0\u5230\u4e86\u60a8\u7684\u5b9d\u8d1d\u5e93\u4e2d\u5e76\u53ef\u4ee5\u5f00\u59cb\u4f7f\u7528\u5b83\u4e86\uff01 \u6211\u4eec\u5e0c\u671b\u60a8\u80fd\u5145\u5206\u5229\u7528\u6b64\u529f\u80fd\u5f3a\u5927\u7684\u5de5\u5177\uff01<\/p>

\u5982\u679c\u4f60\u9047\u5230\u4e86\u95ee\u9898\u6216\u8005\u6709\u4e86\u53cd\u9988\uff0c\u8bf7\u5728\u4e0b\u9762\u7559\u8a00\u3002<\/p>","orderid":"0","title":"\u5982\u4f55\u5728Ubuntu 18.04\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eRedis","smalltitle":"","mid":"0","fname":"\u6570\u636e\u5e93\u7f16\u7a0b","special_id":"0","bak_id":"0","info":"0","hits":"370","pages":"1","comments":"0","posttime":"2023-07-26 08:18:16","list":"1690330696","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"https:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"\u4f55\u5728<\/A> Ubuntu<\/A> 18.04<\/A> \u5b89\u88c5\u548c<\/A> Redis<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"119.59.235.169","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"\u5982\u4f55\u5728Ubuntu 18.04\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eRedis","lastview":"1716072817","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}