{"id":4502,"date":"2023-02-21T14:58:52","date_gmt":"2023-02-21T06:58:52","guid":{"rendered":"https:\/\/km94.com\/?p=4502"},"modified":"2023-02-21T14:58:52","modified_gmt":"2023-02-21T06:58:52","slug":"hostwinds-vps%e5%ae%89%e8%a3%85redis%e5%b9%b6%e8%ae%be%e7%bd%ae%e8%bf%9c%e7%a8%8b%e8%bf%9e%e6%8e%a5%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/dy208.cn\/index.php\/2023\/02\/21\/hostwinds-vps%e5%ae%89%e8%a3%85redis%e5%b9%b6%e8%ae%be%e7%bd%ae%e8%bf%9c%e7%a8%8b%e8%bf%9e%e6%8e%a5%e7%9a%84%e6%96%b9%e6%b3%95\/","title":{"rendered":"Hostwinds VPS\u5b89\u88c5Redis\u5e76\u8bbe\u7f6e\u8fdc\u7a0b\u8fde\u63a5\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>Redis\u662f\u4e00\u79cd\u7075\u6d3b\u7684\u9ad8\u6027\u80fd\u6570\u636e\u5e93\u5f15\u64ce\uff0c\u652f\u6301\u590d\u6742\u7684\u64cd\u4f5c\u548c\u4f7f\u7528\u60c5\u51b5\u3002\u60a8\u53ef\u4ee5\u8bbe\u7f6eRedis\u670d\u52a1\u5668\u4ee5\u5728VPS\u4e0a\u8fd0\u884c\uff0c\u5e76\u63a5\u53d7\u8fdc\u7a0b\u547d\u4ee4\u6765\u4fee\u6539\u3001\u8bfb\u53d6\u548c\u6267\u884c\u6570\u636e\u5e93\u7684\u64cd\u4f5c\u3002\u672c\u6587\u4ee5Hostwinds VPS\u4e3a\u4f8b\uff0c\u4e0b\u9762\u6765\u770b\u4e0b\u5b89\u88c5Redis\u5e76\u8bbe\u7f6e\u8fdc\u7a0b\u8fde\u63a5\u7684\u65b9\u6cd5\u6b65\u9aa4\u4ecb\u7ecd\u3002<\/p>\n<p><strong>\u6b65\u9aa41\u3001<\/strong>Hostwinds\u7f8e\u56fdVPS\u548c\u6b27\u6d32VPS\u652f\u6301Windows\u6216Linux\u7cfb\u7edf\uff0c\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662fLinux\u53d1\u884c\u7248\uff0c\u90a3\u4e48\u53ef\u6309\u7167\u6240\u9009\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0d\u540c\uff0c\u8fd0\u884c\u76f8\u5173\u547d\u4ee4\u6765\u5b89\u88c5Redis\u3002<\/p>\n<p>a\u3001RHEL \/ CentOS \/ Amazon Linux<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">sudo yum install Redis<\/code><\/pre>\n<p>b\u3001Ubuntu \/ Debian<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">sudo apt-get install Redis-server<\/code><\/pre>\n<p>c\u3001Fedora<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">sudo dnf -y install Redis<\/code><\/pre>\n<p><strong>\u6b65\u9aa42\u3001<\/strong>\u7136\u540e\u542f\u52a8Redis Server\u540e\u7aef\u670d\u52a1\u3002<\/p>\n<p>a\u3001RHEL \/ CentOS \/ Amazon, Linux<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">sudo systemctl, start Redis<\/code><\/pre>\n<p>b\u3001Ubuntu \/ Debian<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">sudo systemctl start Redis-server. service<\/code><\/pre>\n<p>c\u3001Fedora<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">sudo systemctl start Redis<\/code><\/pre>\n<p><strong>\u6b65\u9aa43\u3001<\/strong>\u786e\u8ba4Redis\u670d\u52a1\u5668\u6b63\u5728\u8fd0\u884c<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">ps -aux | grep redis<\/code><\/pre>\n<p>\u60a8\u8fd8\u53ef\u4ee5\u901a\u8fc7\u542f\u52a8Redis-CLI\u5e76\u53d1\u51faping\u547d\u4ee4\u6765\u9a8c\u8bc1\u670d\u52a1\u5668\u6b63\u5728\u5904\u7406\u8bf7\u6c42\u3002<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">redis-cli 127.0.0.1:6379&gt; ping<\/code><\/pre>\n<p><strong>\u6b65\u9aa44\u3001<\/strong>\u4f7f\u7528ifconfig\u83b7\u53d6\u516c\u5171IPv4\u5730\u5740<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">ifconfig -a<\/code><\/pre>\n<p>\n\t<figure class=\"wp-block-image size-full\"><img decoding=\"async\" class=\"wp-image-4504\" alt=\"\u4f7f\u7528ifconfig\u83b7\u53d6\u516c\u5171IPv4\u5730\u5740\" src=\"https:\/\/km94.com\/wp-content\/uploads\/2023\/02\/ho1-1-1.jpg\"><\/figure>\n\t<\/p>\n<p><strong>\u6b65\u9aa45\u3001<\/strong>\u5c06Redis\u670d\u52a1\u5668\u7ed1\u5b9a\u5230\u60a8\u7684IPv4\u5730\u5740<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">sudo vi \/etc\/redis.conf<\/code><\/pre>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cRedis\u670d\u52a1\u5668\u5c06\u7ed1\u5b9a\u5230127.0.0.1\uff0c\u53ea\u80fd\u4ece\u670d\u52a1\u5668\u672c\u8eab\u8bbf\u95ee\u3002 \u8981\u4f7fRedis Server\u53ef\u516c\u5f00\u8bbf\u95ee\uff0c\u60a8\u5fc5\u987b\u7ed1\u5b9a\u670d\u52a1\u5668\u4ee5\u6536\u542c\u4e0e\u516c\u5171IPv4\u5173\u8054\u7684\u7f51\u7edc\u63a5\u53e3\u3002\u4f8b\u5982\uff0c\u5728\u7b2c66\u884c\uff0c\u4fee\u6539\u7ed1\u5b9a127.0.0.1\u5e76\u5c06IP\u66ff\u6362\u4e3a\u8be5Hostwinds VPS\u4f7f\u7528\u7684IPv4\u3002<\/p>\n<p>\n\t<figure class=\"wp-block-image size-full\"><img decoding=\"async\" class=\"wp-image-4505\" alt=\"\u5c06Redis\u670d\u52a1\u5668\u7ed1\u5b9a\u5230\u60a8\u7684IPv4\u5730\u5740\" src=\"https:\/\/km94.com\/wp-content\/uploads\/2023\/02\/ho2-2.jpg\"><\/figure>\n\t<\/p>\n<p><strong>\u6b65\u9aa46\u3001<\/strong>\u91cd\u65b0\u542f\u52a8Redis<\/p>\n<p>a\u3001RHEL \/ CentOS \/ Amazon Linux<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">sudo systemctl restart redis<\/code><\/pre>\n<p>b\u3001Ubuntu \/ Debian<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">sudo systemctl restart Redis. service<\/code><\/pre>\n<p>c\u3001Fedora<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">sudo systemctl restart Redis<\/code><\/pre>\n<p><strong>\u6b65\u9aa47\u3001<\/strong>\u9a8c\u8bc1\u5916\u90e8\u4e3b\u673a\u8bbf\u95ee<\/p>\n<p>\u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u4f7f\u7528redis-cli\u547d\u4ee4\uff0c\u60a8\u53ef\u4ee5\u63d0\u4f9b-h\u53c2\u6570\u4ee5\u8fde\u63a5\u5230\u521a\u521a\u5728VPS\u4e0a\u8bbe\u7f6e\u7684\u8fdc\u7a0bredis\u670d\u52a1\u5668\u3002<\/p>\n<pre class=\"wp-block-code\"><code class=\"hljs text\"><span class=\"hljs-selector-tag\">redis-cli -h 104.168.165.99 104.168.165.99:6379&gt; ping PONG<\/code><\/pre>\n<p>\u73b0\u5728\u60a8\u53ef\u4ee5\u8fdc\u7a0b\u8bbf\u95eeHostwinds VPS\u4e0a\u7684Redis\u8282\u70b9\u3002<\/p>\n\n<div>\n<div>\n\n\n\n<\/div>\n<div>\n\n\n\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Redis\u662f\u4e00\u79cd\u7075\u6d3b\u7684\u9ad8\u6027\u80fd\u6570\u636e\u5e93\u5f15\u64ce\uff0c\u652f\u6301\u590d\u6742\u7684\u64cd\u4f5c\u548c\u4f7f\u7528\u60c5\u51b5\u3002\u60a8\u53ef\u4ee5\u8bbe\u7f6eRedis\u670d\u52a1\u5668\u4ee5\u5728VPS\u4e0a\u8fd0\u884c\uff0c&hellip;<\/p>\n","protected":false},"author":1,"featured_media":4503,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,2],"tags":[],"class_list":["post-4502","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-zjjc","category-jc","entry"],"_links":{"self":[{"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/posts\/4502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/comments?post=4502"}],"version-history":[{"count":0,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/posts\/4502\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/media?parent=4502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/categories?post=4502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dy208.cn\/index.php\/wp-json\/wp\/v2\/tags?post=4502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}