{"id":201567,"date":"2025-05-10T08:32:06","date_gmt":"2025-05-10T00:32:06","guid":{"rendered":"https:\/\/server.hk\/cnblog\/201567\/"},"modified":"2025-05-10T08:32:06","modified_gmt":"2025-05-10T00:32:06","slug":"64%e4%bd%8dwindows%e4%b8%8b%e5%ae%89%e8%a3%85redis%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/201567\/","title":{"rendered":"64\u4f4dWindows\u4e0b\u5b89\u88c5Redis\u6559\u7a0b"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>64\u4f4dWindows\u4e0b\u5b89\u88c5Redis\u6559\u7a0b<\/h1>\n<p><span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u600e\u4e48\u5165\u95e8\u6570\u636e\u5e93\u7f16\u7a0b\uff1f\u9700\u8981\u5b66\u4e60\u54ea\u4e9b\u77e5\u8bc6\u70b9\uff1f\u8fd9\u662f\u65b0\u624b\u4eec\u521a\u63a5\u89e6\u7f16\u7a0b\u65f6\u5e38\u89c1\u7684\u95ee\u9898\uff1b\u4e0b\u9762golang\u5b66\u4e60\u7f51\u5c31\u6765\u7ed9\u5927\u5bb6\u6574\u7406\u5206\u4eab\u4e00\u4e9b\u77e5\u8bc6\u70b9\uff0c\u5e0c\u671b\u80fd\u591f\u7ed9\u521d\u5b66\u8005\u4e00\u4e9b\u5e2e\u52a9\u3002\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u4ecb\u7ecd\u300a64\u4f4dWindows\u4e0b\u5b89\u88c5Redis\u6559\u7a0b\u300b\uff0c\u6d89\u53ca\u5230Redis\u3001windows\u5b89\u88c5\uff0c\u6709\u9700\u8981\u7684\u53ef\u4ee5\u6536\u85cf\u4e00\u4e0b<\/p>\n<p>Redis\u5bf9\u4e8eLinux\u662f\u5b98\u65b9\u652f\u6301\u7684,\u5b89\u88c5\u548c\u4f7f\u7528\u6ca1\u6709\u4ec0\u4e48\u597d\u8bf4\u7684,\u666e\u901a\u4f7f\u7528\u6309\u7167\u5b98\u65b9\u6307\u5bfc\uff0c5\u5206\u949f\u4ee5\u5185\u5c31\u80fd\u641e\u5b9a\u3002\u8be6\u60c5\u8bf7\u53c2\u8003: <\/p>\n<p>\u4f46\u6709\u65f6\u5019\u53c8\u60f3\u5728windows\u4e0b\u6298\u817e\u4e0bRedis,\u53ef\u4ee5\u4eceredis\u4e0b\u8f7d\u9875\u9762\u770b\u5230\u5982\u4e0b\u63d0\u793a\uff1a<br \/> \u4ee3\u7801\u5982\u4e0b:<br \/> Win64&nbsp;Unofficial&nbsp;The Redis project does not directly support Windows, <br \/> &nbsp;however the Microsoft Open Tech group develops and maintains <br \/> &nbsp;an Windows port targeting Win64.<\/p>\n<p>\u5927\u610f\u5c31\u662f Redis\u5b98\u65b9\u662f\u4e0d\u652f\u6301windows\u7684\uff0c\u53ea\u662f Microsoft Open Tech group \u5728 GitHub\u4e0a\u5f00\u53d1\u4e86\u4e00\u4e2aWin64\u7684\u7248\u672c,\u9879\u76ee\u5730\u5740\u662f\uff1a<\/p>\n<p>\u6253\u5f00\u4ee5\u540e\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u6d4f\u89c8\u5668\u4e0b\u8f7d\uff0c\u6216\u8005git\u514b\u9686\u3002<\/p>\n<p>\u53ef\u4ee5\u5728\u9879\u76ee\u4e3b\u9875\u53f3\u8fb9\u627e\u5230 zip\u5305\u4e0b\u8f7d\u5730\u5740: <\/p>\n<p>\u4e0b\u8f7d\u89e3\u538b\uff0c\u6ca1\u4ec0\u4e48\u597d\u8bf4\u7684\uff0c\u5728\u89e3\u538b\u540e\u7684bin\u76ee\u5f55\u4e0b\u6709\u4ee5\u4e0b\u8fd9\u4e9b\u6587\u4ef6\uff1a<br \/> \u4ee3\u7801\u5982\u4e0b:<br \/> redis-benchmark.exe&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #\u57fa\u51c6\u6d4b\u8bd5<br \/> redis-check-aof.exe&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # aof<br \/> redis-check-dump.exe&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # dump<br \/> redis-cli.exe&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # \u5ba2\u6237\u7aef<br \/> redis-server.exe&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # \u670d\u52a1\u5668<br \/> redis.windows.conf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # \u914d\u7f6e\u6587\u4ef6<\/p>\n<p>\u5f53\u7136\uff0c\u8fd8\u6709\u4e00\u4e2a RedisService.docx \u6587\u4ef6\uff0c\u770b\u4f3c\u662f\u4e00\u4e9b\u542f\u52a8\u548c\u5b89\u88c5\u670d\u52a1\u7684\u8bf4\u660e\u6587\u6863,\u4f46\u662f\u7167\u7740\u4ed6\u7684\u6307\u793a\u6765,\u4f60\u5c31\u4f1a\u6b7b\u7684\u5f88\u60e8\uff0c\u83ab\u540d\u5176\u5999\u7684\u6b7b\u4e86\uff0c\u4e0d\u77e5\u9053\u539f\u56e0\u3002<br \/> \u3010\u6362\u673a\u5668\u91cd\u65b0\u6d4b\u8bd5\u540e\u5df2\u67e5\u660e,\u5982\u679c\u4e0d\u662fAdministrator\u7528\u6237\uff0c\u5c31\u4f1a\u51fa\u5404\u79cd\u95ee\u9898\uff0c\u670d\u52a1\u5b89\u88c5\u4ee5\u540e\u542f\u52a8\u4e0d\u4e86\u7b49\u7b49\u95ee\u9898\uff0c\u5e94\u8be5\u53ef\u4ee5\u4fee\u6539\u670d\u52a1\u7684\u5c5e\u6027&#8211;&gt;\u767b\u5f55\u7528\u6237\u7b49\u9009\u9879\u6765\u4fee\u6b63.\u3011<\/p>\n<p>\u3010\u5982\u679c\u4f60\u5b89\u88c5\u7684windows\u6ca1\u6709Administrator\u8d26\u6237\uff0c\u8bf7\u53c2\u8003\u8fd9\u7bc7\u6587\u7ae0:\u3011<\/p>\n<p>\u7f51\u4e0a\u53c2\u8003\u4e86\u4e00\u4e9b\u8d44\u6599,\u53d1\u89c9\u53ef\u4ee5\u4f7f\u7528,\u4e5f\u5c31\u6ca1\u6709\u6df1\u7a76,\u76f4\u63a5\u62ff\u6765\u4e3b\u4e49:<\/p>\n<p>\u542f\u52a8\u811a\u672c\u5982\u4e0b:<br \/> \u4ee3\u7801\u5982\u4e0b:<br \/> redis-server&nbsp; redis.windows.conf<\/p>\n<p>\u53ef\u4ee5\u5c06\u5176\u4fdd\u5b58\u4e3a\u6587\u4ef6 startup.bat ; \u4e0b\u6b21\u5c31\u53ef\u4ee5\u76f4\u63a5\u542f\u52a8\u4e86\u3002<br \/> \u4f46\u662f\u5728cmd\u4e4b\u4e2d\u6267\u884c\u8fd9\u884c\u547d\u4ee4\u4e4b\u540e\u62a5\u9519\uff1a<br \/> \u4ee3\u7801\u5982\u4e0b:<br \/> D:\\Develop\\redis-2.8.12&gt;redis-server.exe redis.windows.conf<br \/> [7736] 10 Aug 21:39:42.974 #<br \/> The Windows version of Redis allocates a large memory mapped file for sharing<br \/> the heap with the forked process used in persistence operations. This file<br \/> will be created in the current working directory or the directory specified by<br \/> the &#8216;dir&#8217; directive in the .conf file. Windows is reporting that there is<br \/> insufficient disk space available for this file (Windows error 0x70).<\/p>\n<p>You may fix this problem by either reducing the size of the Redis heap with<br \/> the &#8211;maxheap flag, or by starting redis from a working directory with<br \/> sufficient space available for the Redis heap.<\/p>\n<p>Please see the documentation included with the binary distributions for more<br \/> details on the &#8211;maxheap flag.<\/p>\n<p>Redis can not continue. Exiting.<\/p>\n<p>\u6839\u636e\u63d0\u793a\uff0c\u662f maxheap \u6807\u8bc6\u6709\u95ee\u9898,\u6253\u5f00\u914d\u7f6e\u6587\u4ef6 redis.windows.conf ,\u641c\u7d22 maxheap , \u7136\u540e\u76f4\u63a5\u6307\u5b9a\u597d\u5185\u5bb9\u5373\u53ef.<br \/> \u4ee3\u7801\u5982\u4e0b:<br \/> &#8230;&#8230;.<br \/> #&nbsp; <br \/> # maxheap <br \/> maxheap 1024000000 <br \/> &#8230;&#8230;.  <\/p>\n<p>\u7136\u540e\u518d\u6b21\u542f\u52a8,OK,\u6210\u529f.<br \/> \u4ee3\u7801\u5982\u4e0b:<br \/> D:\\Develop\\redis-2.8.12&gt;redis-server&nbsp; redis.windows.conf<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _._<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _.-&#8220;__ &#8221;-._<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _.-&#8220;&nbsp;&nbsp;&nbsp; `.&nbsp; `_.&nbsp; &#8221;-._&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Redis 2.8.12 (00000000\/0) 64 bit<br \/> &nbsp; .-&#8220; .-&#8220;`.&nbsp; &#8220;`\\\/&nbsp;&nbsp;&nbsp; _.,_ &#8221;-._<br \/> &nbsp;(&nbsp;&nbsp;&nbsp; &#8216;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .-`&nbsp; | `,&nbsp;&nbsp;&nbsp; )&nbsp;&nbsp;&nbsp;&nbsp; Running in stand alone mode<br \/> &nbsp;|`-._`-&#8230;-` __&#8230;-.&#8220;-._|&#8217;` _.-&#8216;|&nbsp;&nbsp;&nbsp;&nbsp; Port: 6379<br \/> &nbsp;|&nbsp;&nbsp;&nbsp; `-._&nbsp;&nbsp; `._&nbsp;&nbsp;&nbsp; \/&nbsp;&nbsp;&nbsp;&nbsp; _.-&#8216;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; PID: 6736<br \/> &nbsp; `-._&nbsp;&nbsp;&nbsp; `-._&nbsp; `-.\/&nbsp; _.-&#8216;&nbsp;&nbsp;&nbsp; _.-&#8216;<br \/> &nbsp;|`-._`-._&nbsp;&nbsp;&nbsp; `-.__.-&#8216;&nbsp;&nbsp;&nbsp; _.-&#8216;_.-&#8216;|<br \/> &nbsp;|&nbsp;&nbsp;&nbsp; `-._`-._&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _.-&#8216;_.-&#8216;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http:\/\/redis.io<br \/> &nbsp; `-._&nbsp;&nbsp;&nbsp; `-._`-.__.-&#8216;_.-&#8216;&nbsp;&nbsp;&nbsp; _.-&#8216;<br \/> &nbsp;|`-._`-._&nbsp;&nbsp;&nbsp; `-.__.-&#8216;&nbsp;&nbsp;&nbsp; _.-&#8216;_.-&#8216;|<br \/> &nbsp;|&nbsp;&nbsp;&nbsp; `-._`-._&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _.-&#8216;_.-&#8216;&nbsp;&nbsp;&nbsp; |<br \/> &nbsp; `-._&nbsp;&nbsp;&nbsp; `-._`-.__.-&#8216;_.-&#8216;&nbsp;&nbsp;&nbsp; _.-&#8216;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `-._&nbsp;&nbsp;&nbsp; `-.__.-&#8216;&nbsp;&nbsp;&nbsp; _.-&#8216;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `-._&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _.-&#8216;<br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `-.__.-&#8216;<\/p>\n<p>[6736] 10 Aug 22:01:22.247 # Server started, Redis version 2.8.12<br \/> [6736] 10 Aug 22:01:22.248 * The server is now ready to accept connections on port 6379<\/p>\n<p>\u7136\u540e\u53ef\u4ee5\u4f7f\u7528\u81ea\u5e26\u7684\u5ba2\u6237\u7aef\u5de5\u5177\u8fdb\u884c\u6d4b\u8bd5\u3002<br \/> \u53cc\u51fb\u6253\u5f00 redis-cli.exe , \u5982\u679c\u4e0d\u62a5\u9519,\u5219\u8fde\u63a5\u4e0a\u4e86\u672c\u5730\u670d\u52a1\u5668,\u7136\u540e\u6d4b\u8bd5\uff0c\u6bd4\u5982 set\u547d\u4ee4\uff0cget\u547d\u4ee4:<br \/> \u4ee3\u7801\u5982\u4e0b:<br \/> 127.0.0.1:6379&gt; set tiemao https:\/\/www.jb51.net<br \/> OK<br \/> 127.0.0.1:6379&gt; get tiemao<br \/> &#8220;https:\/\/www.jb51.net&#8221;<br \/> 127.0.0.1:6379&gt;<\/p>\n<p>\u8fd9\u5e94\u8be5\u5f88\u597d\u7406\u89e3\uff0c\u8fde\u63a5\u4e0a\u4e86\u672c\u673a\u76846379\u7aef\u53e3\u3002<\/p>\n<p>\u5982\u679c\u9700\u8981\u5e2e\u52a9,\u53ef\u4ee5\u5728 cli\u7a97\u53e3\u4e2d\u8f93\u5165 help\u67e5\u770b,\u4f8b\u5982:<\/p>\n<p> \u4ee3\u7801\u5982\u4e0b:<br \/> 127.0.0.1:6379&gt; help<br \/> redis-cli 2.8.12<br \/> Type: &#8220;help @ &#8221; to get a list of commands in <br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;help &#8221; for help on <br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;help &#8221; to get a list of possible help topics <br \/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;quit&#8221; to exit <br \/> 127.0.0.1:6379&gt; help @string  <\/p>\n<p>\u6839\u636e\u63d0\u793a\uff0c\u53ef\u4ee5\u8f93\u5165 help \u7a7a\u683c \u7136\u540e\u6572tab\u952e\uff0c\u53ef\u4ee5\u50cf\u547d\u4ee4\u63d0\u793a\u4e00\u6837\u544a\u8bc9\u4f60\u53ef\u4ee5\u6709\u54ea\u4e9b\u5e2e\u52a9\u5206\u7ec4,\u591a\u6572\u51e0\u4e2a tab \u8bd5\u8bd5?<br \/> \u5907\u6ce8\u8bf4\u660e:<\/p>\n<p>1. \u8fd9\u4e2a\u7248\u672c\u662fWin64\u7684\uff0c\u6240\u4ee532\u4f4dwindows\u5c31\u4e0d\u8981\u6298\u817e\u4e86\u3002<\/p>\n<p>2. \u6211\u7684\u64cd\u4f5c\u7cfb\u7edf\u662fWindows 7 64\u4f4d\u65d7\u8230\u7248,\u8fd0\u884c\u5185\u5b5816GB,\u7528\u6237\u4e0d\u662fAdministrator,\u800c\u662f hasee\uff0c\u6240\u4ee5\u8bbe\u7f6e\u4e86\u4e0b redis-server.exe \u548credis-cli.exe \u7684\u5c5e\u6027\u4e2d\u7684\u517c\u5bb9\u6027\u6743\u9650(\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c),\u5982\u679c\u4f60\u8fd0\u884c\u51fa\u9519\uff0c\u53ef\u80fd\u9700\u8981\u8bbe\u7f6e\u4e00\u4e0b\u8fd9\u91cc\u3002<\/p>\n<p>3. \u4ec0\u4e48360\u554a\uff0cUAC\u554a\uff0c\u9632\u706b\u5899\u554a\uff0c\u8be5\u5173\u7684\u8bf7\u5173\u95ed\u3002\u3002\u3002<\/p>\n<p>4. \u5982\u679c\u6709\u5176\u4ed6\u95ee\u9898\uff0c\u6b22\u8fce\u7559\u8a00\u6216\u8005\u8bc4\u8bba, \u8fd9\u53ea\u662f\u4e00\u4e2a\u5fc3\u8840\u6765\u6f6e\u65f6\u7684\u6298\u817e<\/p>\n<p>\u63a5\u89e6\u4e86\u597d\u4e45Redis\u4f46\u4e00\u76f4\u6ca1\u5728windows\u4e0b\u4f7f\u7528\uff0c\u8bf7\u8f7b\u62cd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>64\u4f4dWindows\u4e0b\u5b89\u88c5Red&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-201567","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/201567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=201567"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/201567\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=201567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=201567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=201567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}