localhost

Tomcat日志配置文件分析

匿名 (未验证) 提交于 2019-12-03 00:40:02
Tomcat的conf目录下的logger.properties为tomcat的日志配置。 打开一看是不是很晕? 本人也是分析代码后才得到结论。 handlers = 1catalina.org.apache.juli.AsyncFileHandler, 2localhost.org.apache.juli.AsyncFileHandler, 3manager.org.apache.juli.AsyncFileHandler, 4host-manager.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler 定义所有可用的handler的key。这个key分解为两部分前缀+类型。 比如2localhost.org.apache.juli.AsyncFileHandler前缀为2localhost.,类名为org.apache.juli.AsyncFileHandler。 而java.util.logging.ConsoleHandler前缀为空。 Tomcat这样的设计为解决类型相同导致(比如org.apache.juli.AsyncFileHandler)的实例名 重复问题。 .handlers=1catalina.org.apache.juli.AsyncFileHandler, java.util

高性能的代理服务-Envoy

匿名 (未验证) 提交于 2019-12-03 00:38:01
Envoy最初建于Lyft,是一个高性能的代理服务,为服务网格提供了基础。 它与应用程序并行运行,通过以平台无关的方式提供通用功能来抽象网络。 当基础架构中的所有服务流量都通过Envoy网格时,通过一致的可观测性,很容易地查看问题区域,调整整体性能并在一个位置添加特殊。 官网: https://www.envoyproxy.io docker 安装 $ docker pull envoyproxy/ envoy:latest latest: Pulling from envoyproxy / envoy b234f539f7a1: Pull complete 55172d420b43: Pull complete 5ba5bbeb6b91: Pull complete 43ae2841ad7a: Pull complete f6c9c6de4190: Pull complete 332ac9c3e424: Pull complete de19b7c7b473: Pull complete 12a2b3ebc603: Pull complete 6f472521a27e: Pull complete 5d86eddb3779: Pull complete Digest: sha256

SpringBoot中@RestController,@RequestMapping, @PathVariable,@RequestParam,@GetMapping ,@PostMappin使用

匿名 (未验证) 提交于 2019-12-03 00:37:01
1.@RestController Spring4之后新加入的注解,原来返回json需要@ResponseBody和@Controller配合。 所以@RestController是@ResponseBody和@Controller的组合注解。 以下两个代码的功能是一样的。 2.@RequestMapping配置url映射 @RequestMapping注解可以作用于控制器的某个方法上,也可以作用于某个控制器的类上面,看以下列子。 (1).作用在类上面;通过http://localhost:8099/springboottest/hello正常访问 (2),作用在方法上面,通过http://localhost:8099/springboottest/hello正常访问 (3)作用在类跟方法上面 http://localhost:8099/springboottest/hello/world 3.@PathVariable 获取URL中的数据 访问url:http://localhost:8099/springboottest/hello/100/world 当然也可以放在类上面,此时的访问路径是url:http://localhost:8099/springboottest/100/hello/world 4.@RequestParam获取请求参数的值 请求结果:http:/

Jenkins构建自动化任务

匿名 (未验证) 提交于 2019-12-03 00:37:01
Jenkins是一个开源软件项目,是基于Java开发的一种持续集成工具,用于监控持续重复的工作,旨在提供一个开放易用的软件平台,使软件的持续集成变成可能。 一、环境配置 1、切换到jenkins.jar存放的目录,输入如下命令: $ java -jar jenkins.war 如果需要修改端口可以使用如下命令: $ java -jar jenkins.war--httpPort=8081 然后在浏览器中输入localhost:8080,localhost可以是本机的ip,也可以是计算机名。就可以打开jenkins。 2、用tomcat打开 解压tomcat到某个目录,如/usr/local,进入tomcat下的/bin目录,启动tomcat 将jenkins.war文件放入tomcat下的webapps目录下,启动tomcat时,会自动在webapps目录下建立jenkins目录,在地址栏上需要输入localhost:8080/jenkins。 二、新建任务 登入Jenkins后,左侧视图功能列表中,点击新建任务: 进入创建页面,输入任务名称,选择【构建一个自由风格的软件项目】,点击确定按钮。 三、项目配置 1、General部分可配置【丢弃旧的构建】,也可忽略,本次设置为保持构建的天数7天,保持构建的最大个数20。 3、构建触发器,选择Build periodically

使用keyfile部署分片集群

匿名 (未验证) 提交于 2019-12-03 00:37:01
Deploy Sharded Cluster with Keyfile Access Control mkdir - p / configdb / { conf , data , log } openssl rand - base64 756 > /db/ conf / keyfile chmod 400 / db / conf / keyfile 生成后复制到所有节点,集群中所有节点使用同一个keyfile storage : dbPath : "/configdb/data" journal : enabled : true systemLog : destination : file path : "/configdb/log/mongod.log" logAppend : true processManagement : fork : true net : bindIp : 192.168 . 3 .103 , 127.0 . 0 .1 port : 27020 security : keyFile : "/configdb/conf/keyfile" sharding : clusterRole : configsvr replication : replSetName : "config" mongod - f / configdb / conf / mongod .

gemfire基本使用以及spring-data-gemfire的使用

匿名 (未验证) 提交于 2019-12-03 00:36:02
locator 启动 locator gfsh> start locator --name=locator1 指定端口启动 gfsh> start locator --name=locator1 --port=12105 指定端口和绑定 ip 启动 gfsh> start locator --name=locator1 --port=12105 --bind-address=10.10.10.110 查看 locator 状态 gfsh> status locator --name=locator1 gfsh> status locator --host=localhost --port=10334 连接 locator gfsh> connect gfsh> connect --locator=localhost[10335] 关闭 locator gfsh> stop locator --name=locator1 关闭整个集群 gfsh> shutdown --include-locators=true server 启动 server gfsh> start server --name=server1 指定 locator 启动 gfsh> start server --name=server1 --locators=localhost[10334] 指定端口和

How can I install SSL on localhost in Ubuntu?

那年仲夏 提交于 2019-12-03 00:35:16
问题 I want to install an SSL certificate on my localhost in Ubuntu environment because I can't work on the production server directly. I have to put some conditions in my code on the basis of whether the page is HTTP or HTTPS. How can I do this? 回答1: Enable the apache module by typing: sudo a2enmod ssl After you have enabled SSL, you'll have to restart the web server for the change to be recognized: sudo service apache2 restart Let's start off by creating a subdirectory within Apache's

利用 Express 托管静态文件

匿名 (未验证) 提交于 2019-12-03 00:34:01
通过 Express 内置的 express.static 可以方便地托管静态文件,例如图片、CSS、JavaScript 文件等。 将静态资源文件所在的目录作为参数传递给 express.static 中间件就可以提供静态资源文件的访问了。例如,假设在 public 目录放置了图片、CSS 和 JavaScript 文件,你就可以: app . use ( express . static ( 'public' ) ) ; 现在, public 目录下面的文件就可以访问了。 http : / / localhost : 3000 / images / kitten . jpg http : / / localhost : 3000 / css / style . css http : / / localhost : 3000 / js / app . js http : / / localhost : 3000 / images / bg . png http : / / localhost : 3000 / hello . html 所有文件的路径都是相对于存放目录的,因此,存放静态文件的目录名不会出现在 URL 中。 如果你的静态资源存放在多个目录下面,你可以多次调用 express.static 中间件: app . use ( express . static (

Spring Cloud Config + Spring Cloud Bus 实现配置文件动态刷新(版本 Finchley.RC1)

匿名 (未验证) 提交于 2019-12-03 00:34:01
Spring Cloud 应用篇 之 Spring Cloud Config(配置中心) 一文中介绍了 Spring Cloud Config 的使用,已经实现了配置文件的统一管理(git 仓库),但是,每次修改配置文件后,还需要重新启动应用才能加载到修改后的配置文件,这还没有达到我们的目的,我们最终想要的是,修改完配置文件后,不需要重启我们的应用,就可以重新加载到修改后的配置文件,其实 Spring Cloud 已经为我们提供了这样的支持,那就是 Spring Cloud Bus 组件。 (一)简介 下面是官方文档介绍,我们可以使用消息中间件 RabbitMQ 或者 Kafka,只需要在项目中引用相应的依赖。至于消息中间件的使用,可以查阅相关资料。 Spring Cloud Bus works by adding Spring Boot autconfiguration if it detects itself on the classpath. To enable the bus, add spring-cloud-starter-bus-amqp or spring-cloud-starter-bus-kafka to your dependency management. Spring Cloud takes care of the rest. Make sure the

系统健康检查利器-Spring Boot-Actuator

匿名 (未验证) 提交于 2019-12-03 00:34:01
前言 实例由于出现故障、部署或自动缩放的情况,会进行持续启动、重新启动或停止操作。它可能导致它们暂时或永久不可用。为避免问题,您的负载均衡器应该从路由中跳过不健康的实例,因为它们当前无法为客户或子系统提供服务。 应用实例健康状况可以通过外部观察来确定。您可以通过重复调用 GET /health 端点或通过自我报告来实现。现在主流的服务发现解决方案,会持续从实例中收集健康信息,并配置负载均衡器,将流量仅路由到健康的组件上。 Spring Boot-Actuator 就是帮助我们监控我们的Spring Boot 项目的。 使用 Spring Boot 最主要的特性就是AutoConfig(自动配置),而对于我们这些使用者来说也就是各种starter, Spring Boot-Actuator 也提供了starter,为我们自动配置,在使用上我们只需要添加starter到我们的依赖中,然后启动项目即可。 < dependency > < groupId > org.springframework.boot </ groupId > < artifactId > spring-boot-starter-actuator </ artifactId > </ dependency > 常用Endpoint Spring Boot-actuator,提供了许多有用的EndPoint