{"id":1458,"date":"2023-03-23T22:31:04","date_gmt":"2023-03-23T14:31:04","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1458"},"modified":"2023-04-28T20:42:23","modified_gmt":"2023-04-28T12:42:23","slug":"disconf-web-deployment","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/23\/disconf-web-deployment\/","title":{"rendered":"disconf-web\u90e8\u7f72"},"content":{"rendered":"<h2>\u7b80\u4ecb<\/h2>\n<p>Disconf\uff0c\u5373Distributed Configuration Management Platform(\u5206\u5e03\u5f0f\u914d\u7f6e\u7ba1\u7406\u5e73\u53f0)<\/p>\n<p>\u4e13\u6ce8\u4e8e\u5404\u79cd\u300c\u5206\u5e03\u5f0f\u7cfb\u7edf\u914d\u7f6e\u7ba1\u7406\u300d\u7684\u300c\u901a\u7528\u7ec4\u4ef6\u300d\u548c\u300c\u901a\u7528\u5e73\u53f0\u300d, \u63d0\u4f9b\u7edf\u4e00\u7684\u300c\u914d\u7f6e\u7ba1\u7406\u670d\u52a1\u300d\u3002<\/p>\n<p><!-- more --><\/p>\n<p>homepage: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/disconf.readthedocs.io\">https:\/\/disconf.readthedocs.io<\/a><br \/>\ndisconf: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/knightliao\/disconf\">https:\/\/github.com\/knightliao\/disconf<\/a><br \/>\ndemos: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/knightliao\/disconf-demos-java\">https:\/\/github.com\/knightliao\/disconf-demos-java<\/a><br \/>\nwiki: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/knightliao\/disconf\/wiki\">https:\/\/github.com\/knightliao\/disconf\/wiki<\/a><\/p>\n<h2>\u914d\u7f6e<\/h2>\n<pre><code>$ cd \/disconf-web\n$ cp profile\/rd\/application-demo.properties profile\/rd\/application.properties\n$ vim profile\/rd\/application.properties\n$ vim profile\/rd\/jdbc-mysql.properties\n$ vim profile\/rd\/redis-config.properties\n$ vim profile\/rd\/zoo.properties<\/code><\/pre>\n<p>\u914d\u7f6e\u6587\u4ef6\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><code>jdbc-mysql.properties<\/code> (\u6570\u636e\u5e93\u914d\u7f6e)<\/li>\n<li><code>redis-config.properties<\/code> (Redis\u914d\u7f6e\uff0c\u4e3b\u8981\u7528\u4e8eweb\u767b\u5f55\u4f7f\u7528)<\/li>\n<li><code>zoo.properties<\/code> (Zookeeper\u914d\u7f6e)<\/li>\n<li><code>application.properties<\/code> (\u5e94\u7528\u914d\u7f6e\uff09<\/li>\n<\/ul>\n<blockquote>\n<p>\u6ce8\u610f\uff0c\u5373\u4f7f\u53ea\u6709\u4e00\u4e2aredis\uff0c\u4e5f\u5e94\u8be5\u914d\u7f6e\u4e24\u4e2aredis client\uff0c\u5426\u5219\u5c06\u9020\u6210\u5185\u90e8\u9519\u8bef<\/p>\n<\/blockquote>\n<h2>\u6784\u5efa<\/h2>\n<pre><code>$ cd \/disconf-web\n$ mkdir \/data\/www\/disconf\/disconf-rd\n$ mkdir \/data\/www\/disconf\/disconf-rd\/online-resources\n$ mkdir \/data\/www\/disconf\/disconf-rd\/war\n$ cp profile\/rd\/* \/data\/www\/disconf\/disconf-rd\/online-resources\/\n\n$ ONLINE_CONFIG_PATH=\/data\/www\/disconf\/disconf-rd\/online-resources\n$ WAR_ROOT_PATH=\/data\/www\/disconf\/disconf-rd\/war\n$ export ONLINE_CONFIG_PATH\n$ export WAR_ROOT_PATH\n$ sh deploy\/deploy.sh<\/code><\/pre>\n<p>\u8fd9\u6837\u4f1a\u5728 <code>\/data\/www\/disconf\/disconf-rd\/war<\/code> \u751f\u6210\u4ee5\u4e0b\u7ed3\u679c\uff1a<\/p>\n<ul>\n<li>disconf-web.war<\/li>\n<li>html<\/li>\n<li>META-INF<\/li>\n<li>WEB-INF<\/li>\n<\/ul>\n<h2>\u4e0a\u7ebf\u524d\u7684\u521d\u59cb\u5316\u5de5\u4f5c<\/h2>\n<h3>\u521d\u59cb\u5316\u6570\u636e\u5e93\uff1a<\/h3>\n<p>\u53ef\u4ee5\u53c2\u8003 disconf-web\/sql\/readme.md \u6765\u8fdb\u884c\u6570\u636e\u5e93\u7684\u521d\u59cb\u5316\u3002\u6ce8\u610f\u987a\u5e8f\u6267\u884c<\/p>\n<ul>\n<li>0-init_table.sql<\/li>\n<li>1-init_data.sql<\/li>\n<li>201512\/20151225.sql<\/li>\n<li>20160701\/20160701.sql<\/li>\n<\/ul>\n<p>\u91cc\u9762\u9ed8\u8ba4\u67096\u4e2a\u7528\u6237\uff08\u8bf7\u6ce8\u610f\u7ebf\u4e0a\u73af\u5883\u5220\u9664\u8fd9\u4e9b\u7528\u6237\u4ee5\u907f\u514d\u6f5c\u5728\u7684\u5b89\u5168\u95ee\u9898\uff09<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">name<\/th>\n<th style=\"text-align: center;\">password<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">admin<\/td>\n<td style=\"text-align: center;\">admin<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">testUser1<\/td>\n<td style=\"text-align: center;\">MhxzKhl9209<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">testUser2<\/td>\n<td style=\"text-align: center;\">MhxzKhl167<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">testUser3<\/td>\n<td style=\"text-align: center;\">MhxzKhl783<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">testUser4<\/td>\n<td style=\"text-align: center;\">MhxzKhl8758<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">testUser5<\/td>\n<td style=\"text-align: center;\">MhxzKhl112<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5982\u679c\u60f3\u81ea\u5df1\u8bbe\u7f6e\u521d\u59cb\u5316\u7684\u7528\u6237\u540d\u4fe1\u606f\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee3\u7801\u6765\u81ea\u5df1\u751f\u6210\u7528\u6237\uff1a<\/p>\n<pre><code>src\/main\/java\/com\/baidu\/disconf\/web\/tools\/UserCreateTools.java<\/code><\/pre>\n<h3>Tomcat\u90e8\u7f72War<\/h3>\n<p>\u4fee\u6539server.xml\u6587\u4ef6\uff0c\u5728Host\u7ed3\u70b9\u4e0b\u8bbe\u5b9aContext\uff1a<\/p>\n<pre><code>&lt;Context path=&quot;&quot; docBase=&quot;\/data\/www\/disconf\/disconf-rd\/war&quot;&gt;&lt;\/Context&gt;<\/code><\/pre>\n<p>\u5e76\u8bbe\u7f6e\u7aef\u53e3\u4e3a 8015\uff0c\u542f\u52a8Tomcat\uff0c\u5373\u53ef\u3002<\/p>\n<h3>\u90e8\u7f72\u524d\u7aef<\/h3>\n<p>\u4fee\u6539 nginx.conf<\/p>\n<pre><code>upstream disconf {\n    server 127.0.0.1:8015;\n}\n\nserver {\n    listen   8081;\n    server_name disconf.com;\n    access_log \/data\/www\/logs\/disconf\/access.log;\n    error_log \/data\/www\/logs\/disconf\/error.log;\n\n    location \/ {\n        root \/data\/www\/disconf\/disconf-rd\/war\/html;\n        if ($query_string) {\n            expires max;\n        }\n    }\n\n    location ~ ^\/(api|export) {\n        proxy_pass_header Server;\n        proxy_set_header Host $http_host;\n        proxy_redirect off;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Scheme $scheme;\n        proxy_pass http:\/\/disconf;\n    }\n}<\/code><\/pre>\n<p>\u5173\u4e8ehost\uff1a\u8fd9\u91cc\u7684host\u8bbe\u7f6e\u6210 disconf.com\uff08\u53ef\u4ee5\u81ea\u5b9a\u4e49\uff09\uff0c\u4f46\u5fc5\u987b\u4e0e<code>application.properties<\/code>\u91cc\u7684domain\u4e00\u6837\u3002<\/p>\n<ul>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/192.168.1.20:8081\/\">http:\/\/192.168.1.20:8081\/<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/disconf.com\/\">http:\/\/disconf.com\/<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u4ecb Disconf\uff0c\u5373Distributed Configuration Management Platfo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[362],"tags":[360],"class_list":["post-1458","post","type-post","status-publish","format-standard","hentry","category-apollo-disconf","tag-disconf"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1458","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1458"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1458\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}