1.引入依赖:
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>4.1.3.RELEASE</version>
</dependency>2.生成密码:
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-shade-plugin</artifactId> | |
| <version>3.3.0</version> | |
| <executions> | |
| <execution> | |
| <phase>package</phase> | |
| <goals> | |
| <goal>shade</goal> | |
| </goals> |
| RandomStringUtils.random(16, "1234567890qwertyuioplkjhgfdsazxcvbnm") | |
| private static final String apns(long uid, int type, String alert, long sn) { | |
| String playload = APNS.newPayload().alertBody(alert).customField("type", type).build(); | |
| int length = 13 + 9 + playload.getBytes(CharsetUtil.UTF_8).length; | |
| ByteBuf bf = Unpooled.buffer(length); | |
| bf.writeInt(length) | |
| .writeByte(1) | |
| .writeLong(sn) | |
| .writeLong(uid) |
| <!-- bc0 bc1分库分表策略 --> | |
| <!-- 按uid分库:最后两位0-49在bc_0库,50-99在bc_1库 --> | |
| <rdb:strategy id="balanceDatabaseStrategy" sharding-columns="uid" | |
| algorithm-expression="bc_${if(uid.longValue()%100>49){1}else{0}}"/> | |
| <!--algorithm-expression="bc_${uid.longValue()%100>49?1:0}"/>--> | |
| <!-- 按uid%100分表 --> | |
| <rdb:strategy id="balanceTableStrategy" sharding-columns="uid" | |
| algorithm-expression="balance_${uid.longValue() % 100}"/> |
| <build> | |
| <plugins> | |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-compiler-plugin</artifactId> | |
| <version>3.5.1</version> | |
| <configuration> | |
| <source>1.7</source> | |
| <target>1.7</target> |
| 生成 rsa 私钥 | |
| openssl genrsa -out rsaprivatekey.pem 1024 | |
| 生成对应的公钥 | |
| openssl rsa -in rsaprivatekey.pem -pubout -out rsapublickey.pem | |
| 将 RSA 私钥转换成 PKCS8 格式 | |
| openssl pkcs8 -topk8 -inform PEM -in rsaprivatekey.pem -outform PEM -nocrypt -out rsaprivatepkcs8.pem |
| tickTime=2000 | |
| initLimit=10 | |
| syncLimit=5 | |
| dataDir=/data/cloudera/zookeeper | |
| dataLogDir=/data/cloudera/zookeeper | |
| clientPort=2181 | |
| maxClientCnxns=60 | |
| minSessionTimeout=4000 | |
| maxSessionTimeout=60000 | |
| autopurge.purgeInterval=24 |
| package com.uxin.feerate.util; | |
| import com.google.common.base.Charsets; | |
| import com.google.common.collect.Maps; | |
| import com.google.common.collect.Sets; | |
| import com.google.common.io.Files; | |
| import io.netty.buffer.ByteBuf; | |
| import io.netty.buffer.Unpooled; | |
| import lombok.extern.slf4j.Slf4j; | |
| import org.apache.commons.lang3.StringUtils; |
1.引入依赖:
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>4.1.3.RELEASE</version>
</dependency>2.生成密码:
1.configservice服务开发环境绑定至公网(由于开发服务器与工作环境不在同一网段): application.yml中的spring结点下添加如下配置(忽略掉不要绑定的网卡)
spring:
cloud:
inetutils:
ignored-interfaces:
- lo
- eth0