<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[天使的心跳]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/moest</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; moest]]></copyright><item><title><![CDATA[unable to bind listener to any port in the range 32000 to 32999]]></title><link>https://blog.youkuaiyun.com/moest/article/details/78843983</link><guid>https://blog.youkuaiyun.com/moest/article/details/78843983</guid><author>moest</author><pubDate>Tue, 19 Dec 2017 16:15:24 +0800</pubDate><description><![CDATA[Solution :

First check whether any other application is LISTENING on the port range which you have given by using below command

sudo netstat -an|less

output :

Active Internet connections (]]></description><category></category></item><item><title><![CDATA[使用tracing插件定位RabbitMQ问题]]></title><link>https://blog.youkuaiyun.com/moest/article/details/72874496</link><guid>https://blog.youkuaiyun.com/moest/article/details/72874496</guid><author>moest</author><pubDate>Tue, 06 Jun 2017 09:02:14 +0800</pubDate><description><![CDATA[在定位某个问题的时候，我坚持说我已经把信息发到了RabbitMQ里，但是同事说没收到，只好打开了日志，用日志来定位问题。

首先启用tracing
./rabbitmq-pluginsenable rabbitmq_tracing



然后在management页面中查看admin/Tracing页面

 
新增一个Trace，Trace的format设置为String即可]]></description><category></category></item><item><title><![CDATA[shc编译的脚本遇到了[x]+ Stopped错误]]></title><link>https://blog.youkuaiyun.com/moest/article/details/69267278</link><guid>https://blog.youkuaiyun.com/moest/article/details/69267278</guid><author>moest</author><pubDate>Wed, 05 Apr 2017 17:53:11 +0800</pubDate><description><![CDATA[在CentOS6.5上编译的脚本，在我的RHEL6.5上执行OK，在测试环境中就报上述错误，google了一下，貌似也没有找到具体原因，但是有解决方案如下：


出处：http://www.thegeekstuff.com/2012/05/encrypt-bash-shell-script/?utm_source=tuicool


也就是编译的时候增加一个T参数就行了，但是参数T的作]]></description><category></category></item><item><title><![CDATA[Spring源代码阅读]]></title><link>https://blog.youkuaiyun.com/moest/article/details/59121407</link><guid>https://blog.youkuaiyun.com/moest/article/details/59121407</guid><author>moest</author><pubDate>Wed, 01 Mar 2017 19:45:53 +0800</pubDate><description><![CDATA[反正我是读不懂。


1，关于Bean的创建
位于BeanUtils.java中的instantiateClass方法，其实就是用构造器（？）创建了个bean


2，关于Bean的注入
位于InjectoinMetadata.java中的inject方法，其实就是用反射给field赋了个值]]></description><category></category></item><item><title><![CDATA[elasticsearch坑爹二三事之——程序启动时的配置文件位置 篇]]></title><link>https://blog.youkuaiyun.com/moest/article/details/53066947</link><guid>https://blog.youkuaiyun.com/moest/article/details/53066947</guid><author>moest</author><pubDate>Mon, 07 Nov 2016 16:01:50 +0800</pubDate><description><![CDATA[因为要实现安装自动化，所以在安装某个大型系统的elasticsearch 组件的时候用到了如下安装脚本：


但是安装完成之后无论怎么查询，cluster.name都是奇怪的：


讲道理我已经用sed命令将配置文件中的cluster.name字段替换了，但是为什么程序起来之后还是会使用XXX_ES_CLUSTER_NAME这个默认名称呢？
后来才发现，问题出在了倒数第二句 /usr]]></description><category></category></item><item><title><![CDATA[通过判断请求Header中的Referer来防止伪造请求]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52957924</link><guid>https://blog.youkuaiyun.com/moest/article/details/52957924</guid><author>moest</author><pubDate>Fri, 28 Oct 2016 17:06:30 +0800</pubDate><description><![CDATA[其实不会根本性的解决这个问题。
解决方法：
在web.xml中增加：
    
        refererFilter
        ltd.miku.web.securityenhance.xss.RefererFilter
    
    
        refererFilter
        /*
        REQUEST
    
然后RefererFilter]]></description><category></category></item><item><title><![CDATA[设置X-Frame参数防止页面被Frame]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52957271</link><guid>https://blog.youkuaiyun.com/moest/article/details/52957271</guid><author>moest</author><pubDate>Fri, 28 Oct 2016 16:55:48 +0800</pubDate><description><![CDATA[针对问题：
防止网页被Frame，虽然我也不知道有啥好Frame的（我理解是在some-hack-web.com上Frame淘宝的页面，然后在密码框之类的控件上加一个隐藏的Frame，然后账号密码信息直接发送到some-hack-web.com而不是淘宝）
解决方案：
在web.xml中加入一个Filter：
    
        httpHeaderSecurity]]></description><category></category></item><item><title><![CDATA[备份Elasticsearch的数据]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52862299</link><guid>https://blog.youkuaiyun.com/moest/article/details/52862299</guid><author>moest</author><pubDate>Wed, 19 Oct 2016 19:24:40 +0800</pubDate><description><![CDATA[其实某种意义上Elasticsearch也可以认为是一种noSQL数据库，我们的产品把他作为日志存储使用，于是自然而然就有了备份的需求。


备份：
curl -X PUT "http://127.0.0.1:9200/_snapshot/log_backup" -d '{"type":"fs","settings":{"location":"/tmp/logb/"}}'
curl -X]]></description><category></category></item><item><title><![CDATA[hostname设置不对，导致logback出错从而spring起不来的问题]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52858001</link><guid>https://blog.youkuaiyun.com/moest/article/details/52858001</guid><author>moest</author><pubDate>Wed, 19 Oct 2016 11:35:30 +0800</pubDate><description><![CDATA[Logging system failed to initialize using configuration from 'classpath:log/logback.xml'
java.lang.IllegalStateException: Logback configuration error detected: 
ERROR in ch.qos.logback.core.util.Conte]]></description><category></category></item><item><title><![CDATA[Spring boot + elasticsearch的最简单实践]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52797857</link><guid>https://blog.youkuaiyun.com/moest/article/details/52797857</guid><author>moest</author><pubDate>Wed, 12 Oct 2016 16:16:21 +0800</pubDate><description><![CDATA[之所以说是最简单，是因为这样能搭建出一个能跑出来结果的框架，而更高级的功能往往就是在最简单的框架的基础上建设的，对吧。
客户端环境：spring boot 1.4.1
ElasticSearch环境：Elasticsearch2.4.0 on Windows 2008R2 100.2.92.100:9300


POM：

<project xmlns="http://maven.ap]]></description><category></category></item><item><title><![CDATA[解决maven内网私服与外网同步的问题]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52797343</link><guid>https://blog.youkuaiyun.com/moest/article/details/52797343</guid><author>moest</author><pubDate>Wed, 12 Oct 2016 15:08:54 +0800</pubDate><description><![CDATA[公司的maven私服在内网，完全连不上外网，那么有时需要添加一个依赖，但是依赖还有依赖，从前的做法是在外网电脑里的eclipse添加pom依赖，然后把本地整个.m2覆盖到私服的central目录。这样有很大的缺点：
1，拷贝慢
2，覆盖了原有的文件
最近项目升级spring boot从1.2.3到1.4.1，更新了很多依赖，为了更快的解决问题，提出了如下的方案：
这不是最佳实践，但是比起以]]></description><category></category></item><item><title><![CDATA[使用xcopy命令将文件复制到远程机器上]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52668469</link><guid>https://blog.youkuaiyun.com/moest/article/details/52668469</guid><author>moest</author><pubDate>Mon, 26 Sep 2016 11:13:58 +0800</pubDate><description><![CDATA[@echo off
echo deploy index.html to 100.2.91.99
net use \\100.2.93.12\ipc$ "123456!@#" /user:"Administrator"
echo begin copy
xcopy index.html \\100.2.93.12\htdocs /c /e /r /y
echo copy end
net use \\1]]></description><category></category></item><item><title><![CDATA[javax.persistence.EntityExistsException:a different object with the same identifier value was alrea]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52575231</link><guid>https://blog.youkuaiyun.com/moest/article/details/52575231</guid><author>moest</author><pubDate>Sun, 18 Sep 2016 16:00:43 +0800</pubDate><description><![CDATA[原因：我用了truncate表操作，可能是由于这个导致的。]]></description><category></category></item><item><title><![CDATA[JPQL里解决SUM会返回空指针的问题]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52471436</link><guid>https://blog.youkuaiyun.com/moest/article/details/52471436</guid><author>moest</author><pubDate>Thu, 08 Sep 2016 14:51:20 +0800</pubDate><description><![CDATA[@Query("SELECT SUM(misaka.power) FROM Misaka misaka WHERE misaka.id>?1")
Long getSumPowerByIdGreatThan(long id);


但是这样如果misaka.id>?1没有符合条件的记录的话，就会返回空指针，有时候希望没有符合条件的记录返回0即可，在mysql中，可以用ifnull函数改写为]]></description><category></category></item><item><title><![CDATA[Not supported for DML operations [ UPDATE ltd.miku.xxx.xxx SET xxxxxxx]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52458594</link><guid>https://blog.youkuaiyun.com/moest/article/details/52458594</guid><author>moest</author><pubDate>Wed, 07 Sep 2016 13:10:40 +0800</pubDate><description><![CDATA[在@Query注解上加上@Modifying注解]]></description><category></category></item><item><title><![CDATA[mongo2.x的mongo.exe连接3.x的mongod的时候，show collections不出内容]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52185616</link><guid>https://blog.youkuaiyun.com/moest/article/details/52185616</guid><author>moest</author><pubDate>Thu, 11 Aug 2016 19:08:30 +0800</pubDate><description><![CDATA[但是仍可以用db.T_SOMETHING.find()命令查找。解决方案：mongo.exe换成3.x的]]></description><category></category></item><item><title><![CDATA[@query语句能直接返回bean吗]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52154288</link><guid>https://blog.youkuaiyun.com/moest/article/details/52154288</guid><author>moest</author><pubDate>Mon, 08 Aug 2016 18:10:54 +0800</pubDate><description><![CDATA[没找到方法]]></description><category></category></item><item><title><![CDATA[记小问题：linux下mysql的表名默认区分大小写]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52105613</link><guid>https://blog.youkuaiyun.com/moest/article/details/52105613</guid><author>moest</author><pubDate>Wed, 03 Aug 2016 17:25:13 +0800</pubDate><description><![CDATA[其实没有这种需求，不区分就行，所以进行如下修改：


这是修改之前的


修改的配置文件，在/etc/my.cnf下的mysqld节点下面增加：
lower_case_table_names=1



修改之后看效果




附my.cnf：
[mysqld]
port=9100
datadir=/var/lib/mysql
socket=/var/lib/mys]]></description><category></category></item><item><title><![CDATA[使用jstack+ProcessExplorer来寻找java程序中的死循环]]></title><link>https://blog.youkuaiyun.com/moest/article/details/52034326</link><guid>https://blog.youkuaiyun.com/moest/article/details/52034326</guid><author>moest</author><pubDate>Tue, 26 Jul 2016 11:50:00 +0800</pubDate><description><![CDATA[java程序没有输入的情况下狂占25%的CPU，应该是有死循环，所以寻找错误代码在哪儿。


使用任务管理器，查看java的进程id是2128，然后用jdk自带的jstack执行



jstack -l 2128 > 2128.stack.txt
然后用ProcessExplorer打开进程列表，在2128上点击右键->属性->线程，查找占用最多的线程ID是3520，转成二进制是]]></description><category></category></item><item><title><![CDATA[mongo3.0权限设置问题]]></title><link>https://blog.youkuaiyun.com/moest/article/details/51892673</link><guid>https://blog.youkuaiyun.com/moest/article/details/51892673</guid><author>moest</author><pubDate>Tue, 12 Jul 2016 21:30:56 +0800</pubDate><description><![CDATA[在linux下面用脚本的形式调用命令db.createUser添加用户之后，用spring boot死活连接不上，于是直接取出admin库的system.users表查看具体内容：


左边是Mongo2.4使用了MONGODB-CR认证方式，右面是Mongo3.2，使用了SCRAM-SHA-1认证方式，所以spring 连不上了。
存放认证方式的位置：admin数据库的system.ve]]></description><category></category></item></channel></rss>