美文网首页
小问题记录(不断更新)

小问题记录(不断更新)

作者: 咸鱼佬 | 来源:发表于2018-10-14 20:27 被阅读15次

    Tomcat打印的错误日志的行数为啥是Java源文件

    前几天生产出现了一个bug、指出某个类的某行、当时突然想到这个行数到底是Java文件还是已经编译好的Class文件的行数、问了下同事、都说是Java文件的、因为打印日志哪里标明了XXX.java .....
    解决bug之后上网查了下

    http://www.blogjava.net/landon/archive/2011/02/27/345265.html

    原来Class文件中包含了Class文件字节码与源文件行数的映射关系、以前了解jvm的时候倒是没留意这个、说到底还是基础不扎实

    image

    记录于2018/10/14 20:26:42

    为什么es的索引不能大写字母

    This is ancient history. In prior versions, Elasticsearch used the name of the index as the name of a directory on disk. Some filesystems are case insensitive which meant that foo and FOO should be different indices yet could collide on disk. That’s bad so we forbid it. We no longer use the name of the index on disk so this limitation could be lifted. Yet, we think this limitation should remain. Having two indices whose name differ in case only is an anti-pattern and can be trappy (if a user searches foo but meant Foo that leads to hard to diagnose bugs). We have no intent of lifting this limitation.
    
    In the future please follow our contributing guidelines which point out that this repository is for verified bugs and feature requests only. For questions like you have here, please use the forum.
    

    https://github.com/elastic/elasticsearch/issues/31262

    大意就是以前的索引文件是以索引名字作为文件名存放在文件系统上、有些系统对大小写不敏感、当你的索引名字分别是相同的名字只是大小写不一样、那么就会冲突在文件系统上、所有就一直有这么一个限制、直到现在虽然不已索引名字创建索引文件夹

    quartz在job间隔期间内,保证上一个任务执行完后,再去执行下一个任务

    项目中使用quartz作为定时调度框架,因为定时任务比较多、配置文件堆积在一个配置文件中、所以开始按业务进行拆分、发现其中一个配置有点奇怪

    <property name="concurrent" value="true" />
    

    但是代码注释写着保证同一个任务不会并发执行..............

    所以上网查询了一下资料 o
    http://nesuk.iteye.com/blog/1582557

    然后就问了相关的同事、就把它改为false 上了测试
    然后过了几天、生产出现问题了 就是这个问题导致多线程扫描表导致数据重复
    .................

    ContextUtil

    https://blog.csdn.net/wklken/article/details/6342977
    一个存放Spring容器变量的静态类、用于在一些非Spring类中获取Spring中的对象、这个可以在一些非Spring管理的对象中通过这个静态类注入

    使用feign 作为http 客户端

    因为对接公司另一个项目的接口、而他们是采用微服务进行编写的、而我们组的项目也有些项目开始使用微服务架构了、so、当时考虑了很多框架、无意间发现feign还能作为一个单纯的客户端去进行restful调用

    @FeignClient(name = "xxx", url = "${connect.url}")  
    

    直接写死url 、当通过这个feign 去调用服务的时候、不会尝试在zk中找对应名称的服务的ip端口

    对于feign 默认使用jackson框架作为json的转型框架

     spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
    

    那么对于时间格式的转化、就不用每个字段去配置

     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    

    @PathVariable截断小数点之后的数

    同事妹子构建地图微服务的时候、坐标是通过路径参数传递过来的、刚刚好坐标的值是在路径的最后面、当时获取这个参数的时候一直丢失后面的小数位、然后当时我记得给的建议是在这个参数之后直接加多一个 / 没想到真的可以、不过调用方必须也在路径后面加上这个 / 后来查了一下

    解决方法就是在参数接收方的路径中、参数使用spel 由原来的{y} 改为{y:.+}

    ok、可以解决掉了
    .匹配除“\n”之外的任何单个字符。要匹配包括“\n”在内的任何字符,请使用像“(.|\n)”的模式。

    • 匹配前面的子表达式一次或多次。例如,“zo+”能匹配“zo”以及“zoo”,但不能匹配“z”。+等价于{1,}。

    centos java 路径配置 、chown 目录权限

    es 报错
    [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
    [2]: max number of threads [3797] for user [ljx] is too low, increase to at least [4096]
    [3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

    [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
    etc/sysctl.conf 加上 vm.max_map_count = 262144

    相关文章

      网友评论

          本文标题:小问题记录(不断更新)

          本文链接:https://www.haomeiwen.com/subject/dwutzftx.html