{"id":209708,"date":"2021-02-14T08:11:43","date_gmt":"2021-02-14T00:11:43","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=209708"},"modified":"2021-01-29T14:17:59","modified_gmt":"2021-01-29T06:17:59","slug":"saltstack-file-management","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/saltstack-file-management.html","title":{"rendered":"\u4ecb\u7ecd Saltstack\u6279\u91cf\u7ba1\u7406\u6587\u4ef6\u548c\u8ba1\u5212\u4efb\u52a1"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | saltstack\u662f\u7531thomas Hatch\u4e8e\u521b\u5efa\u7684\u4e00\u4e2a\u5f00\u6e90\u9879\u76ee\uff0c\u8bbe\u8ba1\u521d\u8877\u662f\u4e3a\u4e86\u5b9e\u73b0\u4e00\u4e2a\u5feb\u901f\u7684\u8fdc\u7a0b\u6267\u884c\u7cfb\u7edf\u3002\u7528\u6765\u7ba1\u7406\u4f60\u7684\u57fa\u7840\u67b6\u6784\uff0c\u53ef\u8f7b\u677e\u7ba1\u7406\u6210\u5343\u4e0a\u4e07\u53f0\u670d\u52a1\u5668\u3002\u672c\u6587\u4e3b\u8981\u6f14\u793a\u4f7f\u7528saltstack\u6765\u7ba1\u7406\u670d\u52a1\u5668\u7684\u6587\u4ef6(\u4f8b\u5982\/etc\/hosts\uff0c\/etc\/resolv.conf)\u548c\u8ba1\u5212\u4efb\u52a1\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n <\/p>\n \u7b80\u4ecb<\/strong><\/div>\n saltstack\u662f\u7531thomas Hatch\u4e8e\u521b\u5efa\u7684\u4e00\u4e2a\u5f00\u6e90\u9879\u76ee\uff0c\u8bbe\u8ba1\u521d\u8877\u662f\u4e3a\u4e86\u5b9e\u73b0\u4e00\u4e2a\u5feb\u901f\u7684\u8fdc\u7a0b\u6267\u884c\u7cfb\u7edf\u3002\u7528\u6765\u7ba1\u7406\u4f60\u7684\u57fa\u7840\u67b6\u6784\uff0c\u53ef\u8f7b\u677e\u7ba1\u7406\u6210\u5343\u4e0a\u4e07\u53f0\u670d\u52a1\u5668\u3002<\/p>\n \u5173\u4e8esaltstack\u66f4\u591a\u529f\u80fd\u672c\u6587\u4e0d\u591a\u4ecb\u7ecd\u4e86\uff0c\u672c\u6587\u4e3b\u8981\u6f14\u793a\u4f7f\u7528saltstack\u6765\u7ba1\u7406\u670d\u52a1\u5668\u7684\u6587\u4ef6(\u4f8b\u5982\/etc\/hosts\uff0c\/etc\/resolv.conf)\u548c\u8ba1\u5212\u4efb\u52a1\u3002<\/p>\n \u4f7f\u7528\u573a\u666f<\/strong><\/div>\n \u5728\u7ef4\u62a4\u5927\u91cf\u670d\u52a1\u5668\u7684\u65f6\u5019\uff0c\u7cfb\u7edf\u4e00\u822c\u521d\u59cb\u5316\u5e76\u4e0a\u7ebf\u4ee5\u540e\uff0c\u6211\u4eec\u5e0c\u671b\u6240\u6709\u7684\u670d\u52a1\u5668\u7cfb\u7edf\u7684\u67d0\u4e9b\u914d\u7f6e\u6587\u4ef6\u4e00\u6837\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u9700\u8981\u4e00\u79cd\u5de5\u5177\u6765\u6279\u91cf\u7ba1\u7406\u8fd9\u4e9b\u6587\u4ef6\uff0c\u4fdd\u8bc1\u914d\u7f6e\u6587\u4ef6\u7684\u4e00\u81f4\u6027\uff0c\u6bd4\u5982\uff1a\/etc\/resolv.conf\u8fd9\u4e2a\u6587\u4ef6\u3002\u6211\u4eec\u4f1a\u5e0c\u671b\u8fd9\u4e2a\u6587\u4ef6\u4e0d\u7ba1\u5728\u4efb\u4f55\u65f6\u5019\u90fd\u662f\u7edf\u4e00\u7684\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u5c31\u901a\u8fc7saltstack\u6765\u6f14\u793a\u8fd9\u4e2a\u529f\u80fd<\/p>\n \u73af\u5883\u51c6\u5907<\/strong><\/div>\n \u4f60\u9700\u81ea\u884c\u5b89\u88c5\u597dsalt-master salt-minion,\u5e76\u4e14\u5728master\u4e0a\u80fd\u591f\u4f7f\u7528test.ping\u6a21\u5757\u68c0\u67e5\u5230minion\uff0c\u5982\u4e0b\u6240\u793a<\/p>\n \r\n [root@saltmaster001 salt] salt 'qd01-stop-free002*' test.ping \r\n qd01-stop-free002: \r\n True \r\n<\/pre>\n |