Java中的文件锁

假设这情况情况, 同一台服务器上有个服务有两个进程(一般用作负

Python数据可视化demo

要安装好以下依赖 pyecharts + panda + sqlite3 import sqlite3 import pandas as pd from pyecharts import Line with sqlite3.connect('csi_indices.db') as con: # re

SpringBoot自定义starter

pom.xml <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.3.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-autoconfigure</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId>

SpringBoot结合InfluxDB收集监控统计信息

pom.xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <!-- 统计信息输出到 influxdb --> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-influx</artifactId> </dependency> application.properties #### Spring Boot 监控 management.metrics.export.influx.enabled=true management.metrics.export.influx.auto-create-db=true man

SpringBoot结合MyBatis配置多数据源

application.properties # mysql spring.datasource.jdbc-url=@config.jdbc.url@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.username=@config.jdbc.username@ spring.datasource.password=@config.jdbc.password@ # clickhouse ## clickhouse spring.clickhouse.jdbc-url=@config.clickhouse.url@ spring.clickhouse.driver-class-name=ru.yandex.clickhouse.ClickHouseDriver spring.clickhouse.username= spring.clickhouse.password= Java 代码配置 主 datasource package com.uniweibo.config; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.annotation.MapperScan;

Java Metrics+Grafana+InfluxDB搭建监控系统

以下的测试, 都是基于 Ubuntu 14.04.2 LTS + Java 8 + SpringBoot Grafana 安装 sudo echo "deb https://packagecloud.io/grafana/stable/debian/ stretch main" > /etc/apt/sources.list.d/grafana.list curl

ClickHouse入门记录

安装 我写了个脚本放在 gist 可以执行以下命令来自动安装: curl -L https://gist.githubusercontent.com/emacsist/ebb98839c814cdb2f16e20efcef9474e/raw/aa8e035ad2e61fa74f4c904a7953806c62155fa3/install-clickhouse.sh | bash

Netty与epoll资料收集

为什么 Netty 支持 native epoll ? stackoverflow.com Netty 的 epoll transport 使用 epoll edge-triggered , 而 java 的 NIO 库珍的是 level-triggered. 除此