Linuxの展開disconf(分散構成センター)の下で

事前設定環境が必要です。

  1. MySQLのインストール:https://blog.csdn.net/qq_37598011/article/details/93489404
  2. 飼育係のインストール:https://blog.csdn.net/qq_37598011/article/details/88980317
  3. nginxのインストール:https://blog.csdn.net/qq_37598011/article/details/93497219
  4. Redisのインストール:https://blog.csdn.net/qq_37598011/article/details/93490113
  5. Tomcatのインストール:https://blog.csdn.net/qq_37598011/article/details/93502809

ここので、必要MavenとのGitのようにも、これらの2をインストールする必要があります。 

Mavenの

wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
yum -y install apache-maven

Gitの

yum -y install git

[OK]を〜どちらも、GitHubの上でコードまでインストールすることができます私を得ました。

展開Disconf

ダウンロード

それは戦争、資源、SRC 3つのフォルダでなければなりません

 mkdir -p /usr/local/disconf/{resource,src,war}

その後、次のdisconfディレクトリへ

cd /usr/local/disconf/

SRCへのGitHubへのプルからDisconfコード

git clone https://github.com/knightliao/disconf.git

 

中には/ usr / local / disconf /リソースには/ usr / local / disconf / SRC / disconf / disconf-ウェブ/プロファイル/ RDパスで使用されるコンフィギュレーション・ファイル

cp /usr/local/disconf/src/disconf/disconf-web/profile/rd/* /usr/local/disconf/resource/

そして、次は/ usr / local / disconf /リソースディレクトリへ

cd /usr/local/disconf/resource/

application-demo.propertiesはapplication.propertiesの名前を変更するファイルの名前を変更します

mv application-demo.properties application.properties 

設定ファイルを変更します。

それは4つのプロファイルに対応する改変されなければならない(application.properties、zoo.properties、redis-config.properties、jdbc-mysql.properties)

application.properties

vim application.properties 

zoo.properties 

vim zoo.properties

あなたは、マルチインスタンス参照したい場合はここで私は、単一のインスタンスを午前:https://blog.csdn.net/qq_37598011/article/details/89319334 

あなたは、この時間のローカルインスタンスをテストしている場合はここでピットがあり、ホストが空であるZKにつながる127.0.0.1を使用することはできません!

redis-config.properties

vim redis-config.properties 

jdbc-mysql.properties

vim jdbc-mysql.properties

環境設定を変更します。

それは戦争のパッケージと設定環境変数が作成した設定ファイルのパスへのパスでなければなりません。

vim /etc/profile

あなたは次のように変更する必要があります

ONLINE_CONFIG_PATH=/usr/local/disconf/resource
WAR_ROOT_PATH=/usr/local/disconf/war
export ONLINE_CONFIG_PATH
export WAR_ROOT_PATH

ブート設定

source /etc/profile

ファイルポンポンdisconfウェブ修正する必要性に加えて(1.8未満であればJDKのバージョンを、このステップは行わなくてもよいです)

vim /usr/local/disconf/src/disconf/disconf-web/pom.xml 

コンテンツ

<profile>
    <id>doclint-java8-disable</id>
    <activation>
      <jdk>[1.8,)</jdk>
    </activation>
    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <additionalparam>-Xdoclint:none</additionalparam>
          </configuration>
        </plugin>
      </plugins>
    </build>
  </profile>

の構築

コマンドを実行します(deploy.shにdisconf、ウェブの下にディレクトリを展開)

このプロジェクトは非常に大きな側でTomcatとnginxの設定を変更する側を構築することができます

sh /usr/local/disconf/src/disconf/disconf-web/deploy/deploy.sh 

Tomcatの構成変更

ビルドが戦争のパッケージはTomcatにデプロイされたとしてラベル付けされ、あなたは、Tomcatのserver.xmlファイルを変更する必要があります

その後、最初のTomcatの設定ディレクトリ、およびVIMによって変更

以下のように変更

<Context path="" docBase="/usr/local/disconf/war"></Context>

そして、完成設計disconf-ウェブは(binディレクトリ)を再起動することを忘れないでください後

./shutdown.sh 
./startup.sh 

nginxの設定の変更

nginxの設定ファイルを変更します

vim /usr/local/nginx/conf/nginx.conf

 下記マイプロフィール

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;
	

    upstream disconf {
	    server 127.0.0.1:8080; #Tomcat的IP和端口号
	}

    server {
        listen       8085;
        server_name  localhost; #这块要和application.properties中的domain属性相同
	access_log /usr/local/disconf/access.log;
        error_log /usr/local/disconf/error.log;
	
        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
                root /usr/local/disconf/war/html;   #html所在的路径
        	if ($query_string) {
           	 expires max;
       		 }
        }

    location ~ ^/(api|export) {
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_pass http://disconf;
    }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

再起動nginxの

cd /usr/local/nginx/sbin
./nginx -s reload

この時間は、それは静的なページにアクセスすることができますが、MySQLは、インポートされていません。

データベースを初期化

下には/ usr / local / disconf / SRC / disconf / disconf-ウェブ/ sqlディレクトリに高度な

cd /usr/local/disconf/src/disconf/disconf-web/sql

順序に従って、以下のいくつかのコマンドを実行します 

mysql -h127.0.0.1 -uroot -p'123456' < 0-init_table.sql 

mysql -h127.0.0.1 -uroot -p'123456' disconf < 1-init_data.sql

mysql -h127.0.0.1 -uroot -p'123456' disconf < 201512/20151225.sql    

mysql -h127.0.0.1 -uroot -p'123456' disconf < 20160701/20160701.sql  

OK ~~~

http://192.168.75.128:8085/login.html

管理者がログインすることができ、アカウントのパスワードです。

OK ~~~全体disconfの物流センターを展開しています

参照

官网地址:https://disconf.readthedocs.io/zh_CN/latest/index.html

GitHub地址:https://github.com/knightliao/disconf/blob/master/docs/source/index.rst

おすすめ

転載: blog.csdn.net/qq_37598011/article/details/93619525