自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

秦伟的博客

Peace of mind is impossible without a considerable amount of solitude.

  • 博客(36)
  • 收藏
  • 关注

原创 Spring Cloud Config 使用 JDBC 方式

Config Server <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot

2018-06-11 16:47:22 3680 1

原创 Spring Cloud Consul

先去官网下载 https://www.consul.io/downloads.html 解压unzip consul_1.1.0_linux_amd64.zip -d /home/qinwei/consul/在 .bash_profile 中添加 export PATH=$PATH:/home/qinwei/consulvim .bash_profilesource...

2018-06-05 10:08:37 309

原创 CentOS7 安装 docker

安装依赖包$ sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2添加 yum 软件源$ sudo yum-config-manager \ --add-repo \ https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docke...

2018-05-11 17:41:07 201

原创 Spring Boot Admin

Spring Boot Admin 是一个针对spring-boot的actuator接口进行UI美化封装的监控工具。<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLS...

2018-05-09 11:34:13 553

原创 Spring Cloud Sleuth 整合 Zipkin

Spring Cloud Sleuth 是分布式服务跟踪,Zipkin可以帮助收集时间数据,解决在microservice架构下的延迟问题。<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.or...

2018-05-07 17:38:19 435

原创 Spring Cloud Zuul

Spring Cloud Zuul 是实现 API 网关的功能<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/X

2018-05-07 17:11:57 211

原创 Spring Cloud Config

Config Server<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ht

2018-05-07 16:39:45 308

原创 Spring Cloud Feign

Spring Cloud Feign 其实是整合了Spring Cloud Ribbon 和 Spring Cloud Hystrix<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/200...

2018-05-07 16:18:31 174

原创 Spring Cloud Ribbon && Hystrix

Ribbon 是实现客户端负载均衡的<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocati...

2018-05-07 15:12:14 355

原创 Spring Cloud Eureka

搭建 eureka-serverEureka在CAP理论中属于AP,只要有一台Eureka还在,就能保证注册服务可用(保证可用性),只不过查到的信息可能不是最新的(不保证强一致性)。<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:...

2018-05-07 10:31:59 10534

原创 spring cloud config 默认端口号

无论你在 Config Server 中配置的端口号是什么,Config Client 启动时,都默认会去访问 Server 的 8888 端口。解决方法: 在resources文件夹下,新建 bootstrap.properties 文件( bootstrap.yml 也可以) 这样,Client 启动后就会访问 Server 中配置的端口号了。#配置在application.p...

2018-04-16 15:30:51 4809 1

原创 spring cloud config 中文乱码

在使用 spring cloud config 时,如果在 properties 文件里面有中文的话,会出现乱码。 乱码的原因是:spring 默认使用org.springframework.boot.env.PropertiesPropertySourceLoader 来加载配置,底层是通过调用 Properties 的 load 方法,而load方法输入流的编码是 ISO 8859-1...

2018-04-16 15:03:20 5569 9

原创 Spring Cloud Config 配置 git 时遇到的坑

今天在看Spring Cloud Config,配置时使用自己虚拟机上搭建的git,结果一直报错,查了好久终于解决了。pom.xml 加上下面的配置 <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> ...

2018-04-12 17:23:34 8666 7

原创 GitHub clone 速度过慢的问题

在hosts文件添加151.101.112.249 http://global-ssl.fastly.Net192.30.253.112 http://github.com这个网址可以查看网站对应的IP,https://www.ipaddress.com/

2018-03-27 17:45:01 9161 3

原创 Java 邮件发送 带附件

我用的是微软azure发送的email.properties#如果是qq邮箱的话是 smtp.qq.comhost=smtp.sendgrid.net#qq邮箱是 465port=587userName=azure帐号#qq邮箱的话是授权码,而不是邮箱密码password=密码from=azure帐号to=收件人帐号pom.xml <dependency>

2018-03-20 16:22:04 283

原创 IntelliJ IDEA 基本配置

自动导入:代码提示: 字体设置:设置编码格式:代码模版,可以自己定义: idea会自动生成.idea和*.iml文件,可以在 File Types中设置隐藏起来 配置maven: 配置模版: idea里面无法像eclipse那样,双击选中括号中的所有内容。 在kemap中搜索 extend,给Extend Selection 添加快捷键,我设置的是ctrl+空格,这样按住ctrl后,多按

2018-03-20 16:01:19 202

原创 springboot 整合 redis

pom.xml 添加redis <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency>application-dev.yml

2018-02-12 11:13:06 273

原创 CentOS 7 搭建 GIT 服务

yum 源仓库里的 Git是1.8,先卸载掉,安装最新的2.9yum remove git安装依赖yum install curl-devel expat-devel gettext-devel openssl-devel zlib-develyum install gcc perl-ExtUtils-MakeMaker下载新版的 Git 源码包 ,我下的是 git-2....

2018-01-26 16:38:21 147

原创 springboot 整合 web

@MapperScan(basePackages = "com.example")@SpringBootApplication(scanBasePackages = "com.example")public class Application { public static void main(String[] args) { SpringApplication.run(A

2018-01-16 11:00:59 244

原创 springboot 使用 logback

在src/main/resources/下新建 logback-spring.xml<?xml version="1.0" encoding="UTF-8"?><!-- debug:打印logback内部日志信息,实时查看logback的运行状态,默认为false --> <!-- scan:配置文件如果发生改变,是否被重新加载,默认为true。 --> <!-- scanPeriod:

2018-01-09 09:38:39 202

原创 springboot 整合 quartz

quartz.properties# Default Properties file for use by StdSchedulerFactory# to create a Quartz Scheduler Instance, if a different# properties file is not explicitly specified.org.quartz.scheduler.inst

2018-01-05 10:22:35 217

原创 springboot 整合 mybatis

启动类//mybatis会扫描的包@MapperScan(basePackages = "com.example")@SpringBootApplication(scanBasePackages = "com.example")public class Application { public static void main(String[] args) { Sprin

2018-01-05 10:10:00 215

原创 quartz 集群

quartz.properties# Default Properties file for use by StdSchedulerFactory# to create a Quartz Scheduler Instance, if a different# properties file is not explicitly specified.org.quartz.scheduler.inst

2017-12-27 10:05:38 225

原创 高德地图API的简单使用

<meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width"><style type="text/css">body, h

2017-12-25 16:43:48 542

原创 springboot 整合 rabbitmq

pom.xml<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/PO

2017-12-24 16:29:54 174

原创 CentOS7 在普通用户下安装 mysql 5.7

先查看系统中是否安装过mariadb:rpm -qa|grep -i mariadb卸载mariadb: 切换root用户执行rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64切换回普通用户解压:tar -zxvf mysql-5.7.20-linux-glibc2.12-x86_64.tar.gzmv mysql-5.7.20-linux-glib

2017-12-24 14:47:28 2307

原创 webuploader 实现文件断点续传

先去下载webuploader只需要将下面4个文件添加到工程里面就可以了<link href="${ctxStatic }/webupload/webuploader.css" type="text/css" rel="stylesheet" /><script type="text/javascript" src="${ctxStatic }/webupload/webuploa

2017-12-22 16:27:30 6391 17

原创 iframe 的使用

<div id="rightTable" style="display: none;"> <iframe id="myFrameId" name="myFrameName" scrolling="no" frameborder="0" style="width: 100%; height: 100%;"></iframe> </div>

2017-12-22 16:11:18 269

原创 js 只能输入数字和小数点

function clearNoNum(obj) { //先把非数字的都替换掉,除了数字和. obj.value = obj.value.replace(/[^\d.]/g, ""); //必须保证第一个为数字而不是. obj.value = obj.value.replace(/^\./g, ""); //保证只有出现

2017-12-22 16:04:07 636

原创 CentOS7 在普通用户下安装rabbitmq

之前装过一次rabbitmq,不过是在root用户下,想起以前一个同事说的,使用Linux尽量不要用root用户操作,所以这次又重新装一次。一、安装erlang环境下载最新的版本 otp_src_20.1.tar.gz 官网下载:http://www.erlang.org/downloads这个文件其实不是gz格式的,使用file otp_src_20.1.tar.gz可以查看它的真实数据格式

2017-11-08 11:03:25 2829

原创 Redis的持久化

redis的持久化方式只有2种,rdb和aof。RDB:redis会单独创建(fork)一个子进程来进行实例化,会先将数据写入到一个临时文件中,待持久化过程都结束了,再用这个临时文件替换上次持久化好的文件。整个过程中,主进程是不进行任何 IO操作的,这就确保了极高的性能。RDB的缺点是最后一次持久化后的数据可能丢失。RDB保存的是dump.rdb文件fork的作用是复制一个与当前进程一

2017-11-03 23:06:24 154

原创 CentOS 7 安装 Redis

这是Redis官方下载地址:https://redis.io/download tar -zxvf redis-4.0.2.tar.gz cd redis-4.0.2/ make 复制一份配置文件 cp redis.conf ../myredis/ 修改配置文件 vim redis.conf 进入src目录,启动Redis服务 ./redis-server ../../myRedi

2017-11-03 23:01:14 130

原创 dubbox 在实际项目中的使用

dubbox的github地址: https://github.com/dangdangdotcom/dubbox 先下载下来,在pom.xml文件中修改jdk版本mvn clean package install -Dmaven.test.skip=true 如果报错,查看缺少什么jar包,删除jar包,重新执行上面的命令 dubbox是需要zookeeper的,所以必须要先安装zk。 d

2017-11-01 22:37:10 947

原创 CentOS 7 安装 Mysql

先输入 rpm -qa|grep -i mysql,查看是否安装过mysqlcentos7 内部集成了mariadb,而安装mysql的话会和mariadb的文件冲突,所以需要通过命令rpm -e --nodeps 先卸载掉mariadb.输入 rpm -ivh MySQL-server-5.5.48-1.linux2.6.i386.rpm命令安装服务端时会

2017-11-01 20:00:43 231

原创 CentOS 7 安装 zookeeper

1. 解压tar -zxvf zookeeper-3.4.9.tar.gz2. 创建数据和日志文件夹cd /opt/zookeeper-3.4.9mkdir datamkdir logs3. 将zookeeper目录下conf下的zoo_sample.cfg拷贝一份,命名为zoo.cfg$cp zoo_sample.cfg zoo.cfg

2017-10-31 20:39:44 194

原创 CentOS 7 安装 RabbitMQ

一、安装erlang下载rpm仓库:wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm安装rpm仓库:rpm -Uvh erlang-solutions-1.0-1.noarch.rpm安装openjdk(centos自带的,但我当时卸载了):yum

2017-10-30 22:26:36 271

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除