dstat -tamsl
dstat 是一个可以取代vmstat,iostat,netstat和ifstat这些命令的多功能产品。dstat克服了这些命令的局限并增加了一些另外的功能,增加了监控项,也变得更灵活了。dstat可以很方便监控系统运行状况并用于基准测试和排除故障。
ethtool eth0查网卡信息
dstat -tamsl
dstat 是一个可以取代vmstat,iostat,netstat和ifstat这些命令的多功能产品。dstat克服了这些命令的局限并增加了一些另外的功能,增加了监控项,也变得更灵活了。dstat可以很方便监控系统运行状况并用于基准测试和排除故障。
ethtool eth0查网卡信息
并提供了:数据绑定支持,@NumberFormatannotation支持,@DateTimeFormat支持,@Valid支持,读写XML的支持(JAXB),读写JSON的支持(Jackson)。
后面,我们处理响应ajax请求时,就使用到了对json的支持。
后面,对action写JUnit单元测试时,要从spring IOC容器中取DefaultAnnotationHandlerMapping与AnnotationMethodHandlerAdapter 两个bean,来完成测试,取的时候要知道是
declares support for general annotations such as @Required, @Autowired, @PostConstruct, and so on.
is actually rather pointless. It declares explicit support for annotation-driven MVC controllers (i.e.@RequestMapping, @Controller, etc), even though support for those is the default behaviour.
My advice is to always declare , but don't bother with unless you want JSON support via Jackson.
当我们需要controller返回一个map的json对象时,可以设定
同时设定
1.进入调试对话框

2.在调试对话框中,选择Apache的Tomcat v7.0。

3.完成Tomcat的配置并进入下一步

4.检查调试配置,并完成。

5.若显示以下对话框,请耐心等待(第一次操作时由于本地没有缓存,会配置时间稍长一点,第二次操作后,会快很多)。

6.正常运行,显示如下:

默认eclipse的项目结构是扁平结构的。
由于eclipse的项目管理不能像IDEAJ的那样,可以在不同的窗口中打开不同的项目,故在多个项目下扁平展示结构,容易导致一些混乱,故建议修改它。
多个项目下,默认的项目结构展示方式及修改后结果


eclipse-4.6.2版本,默认JDK的编译版本是1.8,故在编译目标平台为JDK1.7.x的时候,需要修改其编译版本,否则在导入工程时,会导致导入后的工程默认JAVA编译版本为1.8。

此外,仍然要添加1.7.x的已经安装版本。如下图

至此,仍有一些特殊,如使用Gradle,也需要同步修改导入的JDK版本,才能正常编译与调试,否则会出错,如下图。


按道理应该是可以在build.gradle中指定编译版本,但发现网上说的方法,均在导入项目过程中报脚本属性错误,估计网上的方法是适用于Android版本。
形如: sourceCompatibility = "1.6" targetCompatibility = "1.6"
@RequestMapping(value="/response", method=RequestMethod.GET)
public class ResponseController {
//http://127.0.0.1:8010/response/annotation
@RequestMapping("/annotation")
public @ResponseBody String responseBody() {
return "The String ResponseBody";
}
@RequestMapping("/charset/accept")
public @ResponseBody String responseAcceptHeaderCharset() {
return "\u3053\u3093\u306b\u3061\u306f\u4e16\u754c\uff01 (\"Hello world!\" in Japanese)";
}
//http://127.0.0.1:8010/response/charset/produce
@RequestMapping(value="/charset/produce", produces="text/plain;charset=UTF-8")
public @ResponseBody String responseProducesConditionCharset() {
return "\u3053\u3093\u306b\u3061\u306f\u4e16\u754c\uff01 (\"Hello world!\" in Japanese)";
}
//http://127.0.0.1:8010/response/entity/status
@RequestMapping("/entity/status")
public ResponseEntity responseEntityStatusCode() {
return new ResponseEntity("The String ResponseBody with custom status code (403 Forbidden)",
HttpStatus.FORBIDDEN);
}
//http://127.0.0.1:8010/response/entity/headers
@RequestMapping("/entity/headers")
public ResponseEntity responseEntityCustomHeaders() {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.TEXT_PLAIN);
return new ResponseEntity("The String ResponseBody with custom header Content-Type=text/plain",
headers, HttpStatus.OK);
}
}
经实际验证,发现eclipse-4.5.2版本,如果JDK只是1.7.x的版本,在安装STS离线包时,会跳过Spring的相关安装,故需要检查JDK是否为1.8.x版本。
——————————–
下载eclipse,不建议下载最新版本,因为很多外围辅助插件没有及时升级至最新版本的。如SpringMVC为例。
1.打下如下链接,下载STS的最新离线包版本,(可以通过eclipse来在线安装,但下载比较慢也容易失败。)
http://spring.io/tools/sts/all

2.下载相应的eclipse-for-jee,如果官网没有显示与之匹配的版本下载,则你需要尝试链接测试。
http://eclipse.stu.edu.tw/technology/epp/downloads/release/neon/2/eclipse-jee-neon-2-win32-x86_64.zip
3.或者你可以尝试以下地址,也就是从上述的下载地址猜测出的所有版本下载地址(也有可能会失效,但你可以仍然通过某一完整下载地址尝试测试)。
http://eclipse.stu.edu.tw/technology/epp/downloads/release/

4.打开刚下载的eclipe-4.6.2,help->install new software,打开如下安装对话框,选择你的离线包。

5.安装完成后,会提示重启,重启后,将可看到Gradle和Spring的相关项目如下。
File->New->Project

6.安装Tomcat,路径:Window->Preference。

7.测试Tomcat


8.添加并选择默认的项目JDK。

https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html
备忘:
export JAVA_HOME=/jdk1.8.0_211
export JRE_HOME=/jdk1.8.0_211/jre
export CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
1.下载文件:
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.0.tar.gz
https://artifacts.elastic.co/downloads/kibana/kibana-5.2.0-linux-x86_64.tar.gz
https://artifacts.elastic.co/downloads/logstash/logstash-5.2.0.tar.gz
https://artifacts.elastic.co/downloads/packs/x-pack/x-pack-5.2.0.zip
https://artifacts.elastic.co/downloads/beats/heartbeat/heartbeat-5.2.0-linux-x86_64.tar.gz
https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.2.0-linux-x86_64.tar.gz
https://artifacts.elastic.co/downloads/beats/packetbeat/packetbeat-5.2.0-linux-x86_64.tar.gz
2.分别解压elasticsearch\kibana\logstash后,各自执行以下命令安装xpack。
bin/elasticsearch-plugin install file:///path/to/file/x-pack-5.2.0.zip
bin/kibana-plugin install file:///path/to/file/x-pack-5.2.0.zip
bin/logstash-plugin install file:///path/to/file/x-pack-5.2.0.zip
卸载命令
bin/elasticsearch-plugin remove x-pack
bin/kibana-plugin remove x-pack
bin/logstash-plugin remove x-pack
3.启动相应应用
bin/elasticsearch
bin/kibana
bin/logstash
4.登录相关后台
----------------------------
kibana的后台:
http://localhost:5601
帐号与密码
Username: elastic Password: changeme
------------------------------
elasticsearch的restfullAPI
http://localhost:9200
-----------------------
logstash的后台
参考文档:
https://www.elastic.co/start
https://www.elastic.co/guide/en/x-pack/current/xpack-introduction.html
https://www.elastic.co/guide/en/x-pack/current/installing-xpack.html