Distributed expansion process

1, the extended deployment of remote distributed database connection

  1. Mysql server connected to modify the system configuration related to grant permission to the remote connection and all subsequent user corresponding
  2. operating
use mysql;
select host,user,password from user;
grant all privileges  on *.* to root@'%' identified by "password";
flush privileges;
select host,user,password from user;
  1. verification

2, application re-deployment of the cloud

  1. Re-upload the application of the jar package
  2. Application.properties modified arrangement, the corresponding connecting distributed database configuration file url added
  3. Finally start, access authentication

3, nginx reverse proxy load balancer cloud deployment

  1. Direct installation package on a combination openresty
  2. A condition precedent, to be installed in linux pcre, openssl, gcc, curl, etc.
yum install pcre-devel openssl-devel gcc curl
  1. Download openresty download page  http://openresty.org/cn/download.html
  2. After the tar -xvzf openresty **. Tar.gz decompression after entering the download
  3. ./configure
  4. make
  5. make install
  6. The installation is complete, nginx is installed by default under // usr / local / openresty / nginx directory
  7. Modify the local path and host Ali cloud server to facilitate universal access
    Ali cloud server ip -> miaoshaserver

4, nginx static resource deployment

  1. Nginx into the html in the root directory, and create a new store front-end resources directory for static resources
  2. Static resource files in the set point location in the resources directory can access the corresponding html

5, nginx reverse proxy requests dynamic
reverse proxy configuration, a backend server configuration, may be used to point to different backend server cluster configured to LAN IP content server cluster, and the weight of the weight values in rotation, and a configuration LOCATION, when hit any location access rules when a rule you can enter the reverse proxy rules

   upstream backend_server{
        server miaoshaserverbk1 weight=1;
        server miaoshaserverbk2 weight=1;
    }
    location / {
         proxy_pass http://backend_server;
         proxy_set_header Host $http_host;
    }

6, acc tomcat dynamic service log
verification log switch switch acc

#日志开关
server.tomcat.accesslog.enabled=true

#日志格式
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D
server.tomcat.accesslog.directory=/var/www/miaosha/tomcat

7, redis server installation

  1. Official website to download the corresponding source code package redis
  2. Into the src directory make make install to install the complete corresponding function redis
  3. Compiled by the src directory ./redis-server start the cache server

Guess you like

Origin www.cnblogs.com/figsprite/p/11077512.html