搭建一个5个数据库的集群、数据实时同步
https://hub.docker.com/r/percona/percona-xtradb-cluster
[root@localhost ~]# docker pull percona/percona-xtradb-cluster
#创建网段、取名为:net1
[root@localhost ~]# docker network create net1
#查看指定网段详细信息
[root@localhost ~]# docker network inspect net1
#删除指定网段
[root@localhost ~]# docker network rm net1
[root@localhost ~]# docker network create --subnet=172.18.0.0/24 net1
字节流:  输入流:InputStream  方法:  read(byte[] b)  从输入流中读取一定数量的字节,并将其存储在缓冲区数组 b 中。
 输出流:OutPutStream  write(byte[] b, int off, int len)  将指定 byte 数组中从偏移量 off 开始的 len 个字节写入此输出流。 字符流:  输入流:Reader  输出流:Writer
	public static void inputStreamMethod(){
		File f = new File("F:\\z暂存文件\\test.txt");
		InputStream inputStream = null;
		try {
			inputStream = new FileInputStream(f);
			byte[] car = new byte[10];
			//接收实际读取大小
			int len = 0;
			while ((len = inputStream.read(car))!=-1) {
				//输出、字节数组转成字符串
				String info = new String(car,0,len);
				System.out.println(info);
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			System.out.println("文件不存在");
		} catch (IOException e) {
			e.printStackTrace();
			System.out.println("文件读取失败");
		} finally {
			if(inputStream != null) {
				try {
					inputStream.close();
				} catch (IOException e) {
					e.printStackTrace();
					System.out.println("流关闭失败");
				}
			}
		}
	}
消息队列中间件是分布式系统中重要的组件,主要解决应用解耦,异步消息,流量削锋等问题,实现高性能,高可用,可伸缩和最终一致性架构。目前使用较多的消息队列有ActiveMQ,RabbitMQ,ZeroMQ,Kafka,MetaMQ,RocketMQ
异步处理,应用解耦,流量削锋和消息通讯四个场景。
Nginx 是一个web服务器、用来做代理、转发,以及处理静态资源文件 Tomcat 是一个应用服务器、处理java开发文件
动态请求、交给Tomcat处理:
location / {
	proxy_next_upstream http_502 http_504 error timeout invalid_header;
	proxy_pass http://localhost:8080;
	# 真实的客户端IP
	proxy_set_header   X-Real-IP        $remote_addr;
	# 请求头中Host信息
	proxy_set_header   Host             $host;
	# 代理路由信息,此处取IP有安全隐患
	proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
	# 真实的用户访问协议
	proxy_set_header   X-Forwarded-Proto $scheme;
}
spring task 是一个定时任务、和Linux 的Crontab 相同
命令基本格式:
Java(Spring)
*    *    *    *    *    *    *
-    -    -    -    -    -    -
|    |    |    |    |    |    |
|    |    |    |    |    |    + year [optional]
|    |    |    |    |    +----- day of week (0 - 7) (Sunday=0 or 7)
|    |    |    |    +---------- month (1 - 12)
|    |    |    +--------------- day of month (1 - 31)
|    |    +-------------------- hour (0 - 23)
|    +------------------------- min (0 - 59)
+------------------------------ second (0 - 59)