- 博客(174)
- 资源 (43)
- 问答 (1)
- 收藏
- 关注
原创 JAVA操作Influxdb
influxdb中measurement类似于关系形数据库中的表,tag为列,有索引,可以进行快速查询,field列没有索引不能进行快速查询,但field可以进行运算。命名:measurement通过一个唯一的字符串名称来标识,通常反映其所代表的数据(如 cpu_usage、temperature、server_metrics)。它们定义了所存储数据的上下文,并作为查询InfluxDB中数据的主要入口点。Measurement 定义了所收集数据的上下文和类别,类似于关系型数据库中的一个表。
2024-04-23 11:45:03
2315
2
原创 springboot配置MQTT 接收字节码
这两个行用于配置接收MQTT的字节码信息。如果不进行这个配置,当MQTT发送字节码时,会自动转换为字符串。2、在yml配置中增加MQTT的相关配置信息。4、设置接收MQTT消息类方法。3、设置mqtt配置类。
2023-09-08 11:02:36
505
1
原创 mongodb数据库操作
1、启动mongodb /usr/local/mongodb/bin/mongod --dbpath /var/mongodb/data/ --logpath /var/mongodb/logs/log.log &在mongodb启动命令中--dbpath 指定mongodb的数据存储路径--logpath 指定mongodb的日志存储路径2、停止mongodb...
2023-09-08 10:56:25
486
原创 openoffice中遇到的问题
1、用openoffice将word转为pdf,页眉和页脚设置了居中对齐,转码完成后,页眉页脚样式丢失问题2、用openoffice将ppt转为pdf,ppt宽度超过pdf时,内容自动换行
2023-09-08 10:55:24
336
原创 K8S存储服务
1、在所有K8S服务器安装 NFS服务yum install -y nfs-utils2、在主节点服务器创建共享目录,并设置目录访问权限mkdir /home/szykdjtest/nfs/echo "/home/szykdjtest/nfs/ *(insecure,rw,sync,no_root_squash)">/etc/exports3、在主节点服务器启动NFS相关服务 systemctl enable rpcbind --now systemctl enable
2023-02-15 17:32:42
116
原创 Neo4j操作说明
Cypher语句操作Node语法()代表匹配任意一个节点(node1)代表匹配任意一个节点,并给它起了一个别名(:Label)代表查询一个类型的数据(person:Label)代表查询一个类型的数据并给它起一个别名(person:Label{name:'aaa'})查询某个类型下,节点属性满足某个值的数据(person:Label{name:'aa',sex:12})查询某个类型下,节点name=aa and sex=12的数据关系语法→ 指向一个节点-[role
2022-04-19 09:55:28
632
原创 云原生K8S之Ingress的使用
1、官方Ingress介绍Ingress | KubernetesFEATURE STATE: Kubernetes v1.19 [stable] An API object that manages external access to the services in a cluster, typically HTTP. aka: tags: - networking - architecture - extension --- -- Ingress 是对集群中服务的外部访问进行管理的 API 对象.
2022-02-22 10:49:20
1190
原创 springboot启动找不到Eureka问题
最近在启动项目里启动日志如下: _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/
2021-09-10 17:55:17
925
原创 简单的数字转金额算法
function Cash(num) { if (!/^\d+\.{0,1}\d{0,2}$/.test(num)) { alert('输入格式有误'); return; } //单位 var dw = ['元','万','亿','兆']; //单位描述 var dw_ms=['拾','佰','仟']; var xs_dw = ['分','角']; //var Dw = ['分','角','元','拾','佰..
2021-07-20 11:24:37
381
原创 Springboot 中嵌入ActiveMQ
由于在项目中要用于MQ,但是如果独立安装一下MQ不太适合服务的迁移,因此决定采用内嵌的方式进行整全ACTIVEMQ具体步骤如下:1、在新建的SpringBoot项目中引下如下依赖
2021-06-01 10:12:53
1276
原创 EA架构设计器学习-EA数据库建库脚本(MYSQL脚本)
在使用Enterprise Architect进行建模时,有时需要进行协同工作,这里我们使用连接到数据库服务器功能。下面就是数据库的建表语句:/* Create Tables */CREATE TABLE `t_attribute`( `Object_ID` INT NOT NULL DEFAULT 0, `Name` VARCHAR(255) NOT NULL, `Scope` VARCHAR(50) , `Stereotype` VARCHAR...
2021-02-18 15:55:08
771
1
原创 nginx权限问题-403 Forbidden
访问Nginx出现异常界面报403 Forbidden日志文件为[error] 33014#33014: *4 open() "/opt/deploy/web/web-manage" failed (13: Permission denied), client: 10.115.133.13, server: localhost, request: "GET /web-manage HTTP/1.1", host: "192.168.26.8"解决方案:...
2020-11-09 20:40:40
229
原创 request.getAttribute null问题
目前大家的后台开发大部分是用微服务,由于微服务经常会部署到多个服务器上,而当我们使用request.setAttribute或session.setAttribute后,在其他地方通过getAttribute经常会出现null的情况,这种情况一般是由于域名问题造成,当本地测试时是没有问题,而由于部署的服务器不同就有可能造成这样的问题,所以解决办法是设置cookie的域名。如cookie.setDomain(domain);将domain设置为相同的就可以使用了...
2020-09-21 16:27:39
2095
原创 springboot websocket 环境搭建
当前环境:springboot2.0.6.RELEASE首先创建一个SpringBoot项目,包名为com.test;形成的代码如下 :pom文件:<?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:schemaLocatio..
2020-09-16 18:45:52
286
原创 SpringSecurity+OAuth2.0权限认证第四天-实现动态配置角色实现权限控制
第一步:创建一个新的SpringCloud项目;项目的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/POM/4.0.0 https
2020-09-04 20:46:45
1619
2
原创 Spring Security + OAuth2.0第三天 HttpSecurity的几个重要参数说明
HttpSecurity全名为org.springframework.security.config.annotation.web.builders.HttpSecurity这个类是SpringSecurity中继承WebSecurityConfigurerAdapter时需要复写的接口中的一个重要参数,用于配置Security重要的拦截及权限控制。这方法在父类中保护方法。同时这个类也是OAuth2.0中资源服务继承ResourceServerConfigurerAdapter时,需要复写的接口中.
2020-09-04 11:45:13
2427
6
原创 OAuth2.0授权码/oauth/authorize接口调用unauthorized异常
调用/oauth/authorize接口时,代码首先进入org.springframework.web.method.support.InvocableHandlerMethod类的invokeForRequest方法;代码如下:@Nullable public Object invokeForRequest(NativeWebRequest request, @Nullable ModelAndViewContainer mavContainer, Object... providedArg
2020-09-03 19:10:58
15693
6
原创 OAuth2资源访问控制 OAuth2.0认证服务器配置和资源服务器配置(OAuth2.0学习第二天)
本文代码接着第一天的内容进行更新。(OAuth2.0基础配置信息,OAuth2.0学习第一天地址-https://blog.youkuaiyun.com/tianlong1569/article/details/108366395)在前文中我们已经获得了access_token,但是当通过access_token调用相关的接口的时候报出下面异常{ "timestamp": "2020-09-03T06:57:33.443+0000", "status": 401, "error": "
2020-09-03 18:29:43
4799
3
原创 oauth2 的基本使用 spring security + oauth 服务端的基本配置 (oauth2学习第一天)
说明:本文采用JDK1.8,springboot 采用2.0.6.RELEASE,我这里采用的内存用户配置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://mav
2020-09-02 18:54:29
1107
原创 spring security的基本应用
一、 基本配置配置在系统中使用SpringSecurity,需要在pom.xml中加入spring-boot-starter-security依赖代码如下<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId></dependency>然后新建一个类继
2020-08-31 16:50:16
1002
原创 Eureka集群的搭建及分区管理
1、eureka服务端的几个重要配置eureka: server: #清理间隔10s eviction-interval-timer-in-ms: 10000 #关闭自我保护,默认开启状态# enable-self-preservation: false instance: prefer-ip-address: true client: # false表示不向注册中心注册自己# register-with-eureka: false
2020-08-04 14:51:33
749
原创 redis复本的方式搭建集群及redis写入异常处理
1、第一种方案 redis主从模式搭建(在这种模式下是无法对从进行存储操作的,只能进行读取操作)具体实施步骤如下我里有有两个服务器,分别是10.112.2.8, 10.112.1.93查看一下相关的版本:首先是10.112.2.8服务器的Redis版本[root@localhost ~]# redis-cli -vredis-cli 4.0.1[root@localhost ~]# 另一个是10.112.1.93服务器的版本[root@localhost ~]# redis
2020-08-04 14:18:40
195
原创 nginx根据前缀匹配文件夹
1、所有以 web开头的URL跳转到某个路径 location ^~ /web- { root /opt/deploy/web/; }
2020-08-04 14:10:58
1440
原创 spring启动监听org.springframework.context.SmartLifecycle
org.springframework.context.SmartLifecycle实现这个接口类只有当Spring所有的Bean加载完成并且初始化完毕后开始执行。可以通过这个接口控制初始化一些信息,如定时任务、MQ读取监听等org.springframework.context.SmartLifecycle接口继承了另外两个接口,分别是org.springframework.context.Lifecycle和org.springframework.context.Phased接口。其中org
2020-07-29 10:09:10
519
原创 springcloud通过接口重启及读取配置
1、由于重启或读取配置需要用到actuator相关的功能,因此需要先引入包,在pom.xml中加入如下配置 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>2、在启动类中用户自动刷新配置功能,即在启动类中加入@R
2020-07-24 11:53:34
561
原创 Spring不重复执行的过滤器 OncePerRequestFilter
每次请求只执行一次Filter,不会重复执行org.springframework.web.filter.OncePerRequestFilter相关代码:/* * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in co.
2020-05-19 11:54:53
2026
原创 Mybatis的结果集返回类型处理方案;动态改变返回结果集类型
Mybatis返回结果集形成对应的Bean方法;下面这段代码在org.apache.ibatis.executor.resultset包中的DefaultResultSetHandler类; private Object createResultObject(ResultSetWrapper rsw, ResultMap resultMap, List<Class<?>> constructorArgTypes, List<Object> constructor.
2020-05-12 11:28:14
4010
2
原创 Spring高级使用
@ConditionalOnClass@ConditionalOnWebApplication@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)@ConditionalOnNotWebApplication@AutoConfigureAfter(WebFluxAutoConfi...
2020-04-29 09:08:51
1557
原创 通过Freemarker的模板生成相关的文件(生成docx)
1、首先创建一个docx文件,将这个文件另存为xml文件类型2、通过editplus等纯文本文件打开工具,打开相关的文件,将需要相关的值设置为变量,即freemarker的变量设置;如${test};3、将文件名改为ftl文件的后缀4、开始搭建freemarker框架;代码如下:引入freemarker <dependency> <groupId&g...
2020-04-27 11:44:36
855
原创 spring feign连接配置
feign: hystrix: enabled: false httpclient: enabled: true poolingConnection: 30 # 长连接保持时长(秒) maxTotal: 3000 # 最大连接数(毫秒) maxPerRoute: 200 # 每个路由的最大并发数(毫秒) conne...
2020-04-14 11:17:19
1869
原创 CentOS系统的FTP匿名访问根目录配置
修改匿名用户的访问首目录信息:首先打开FTP的配置文件vi /etc/vsftpd/vsftpd.conf 在配置文件中增加以下内容anon_root=/opt/deploy/logs形成的内容如下:anonymous_enable=YES## Uncomment this to allow local users to log in.# When SELin...
2020-03-31 16:07:09
1291
原创 Linux批处理相关
1、文件判断,判断目录是否存在,如果不存在创建目录if [[ ! -d $object_java_deploy_path ]]; then mkdir -p $object_java_deploy_pathfi2、文件判断,判断文件是否存在,如果不存在提示异常if [[ ! -e $java_file ]]; then echo 'java...
2020-03-28 13:30:51
184
原创 Linux 批处理 启动Springboot程序
#!/bin/bash#use function#deploy [-o object_java_deploy_path] [-p point] [-b java_back_path] [-m spring.profiles.active] [-l log_path] [-x Xms1024m] [-X Xmx1024m] [-e -XX:MaxMetaspaceSize=512] so...
2020-03-28 13:30:14
349
原创 swagger Illegal DefaultValue null for parameter type integer 异常问题
2020-03-24 10:30:11.808 WARN 11876 --- [nio-8282-exec-5] i.s.m.p.AbstractSerializableParameter : Illegal DefaultValue null for parameter type integerjava.lang.NumberFormatException: For input s...
2020-03-24 11:44:12
526
原创 JAVA中 forEach 方法用法 及 stream.map用法
forEach方法不能中断循环且没有返回值如:public static void main(String[] args) { List<String> abc = Arrays.asList("1","2","23","11"); abc.forEach(i->{ System.out.println(i); return; }); }代...
2020-03-12 11:42:59
3154
fckedior 4实现文件上传
2013-04-10
ORACLE动态执行语句 正则表达式 游标
2012-03-29
VMWare workstation中linux系统与windows系统之间的通信
2011-03-28
excelUtil.rar
2021-06-02
excel-analysis.rar
2020-09-17
security.rar
2020-09-06
spring-security-oauth-test.rar
2020-09-04
Oauth2-mem-test.rar
2020-09-03
Oauth2-mem-test.rar
2020-09-02
自定义Excel的上传下载(解析Excel文件)
2019-07-23
activiti-eclipse插件.rar
2019-06-03
自定义属性编辑及Spring处理器映射
2014-03-25
Spring+freemarker+Hibernate搭建
2014-03-25
tx-lcn分布式事务客户端无法启动
2019-06-25
TA创建的收藏夹 TA关注的收藏夹
TA关注的人