boot

Why is the root filesystem is loaded into a ramdisk?

爱⌒轻易说出口 提交于 2019-12-03 16:18:50
I am studying the boot process in Linux. I came across this sentence "RAM is several orders of magnitude faster than a floppy disk, so system operation is fast from a ramdisk" The kernel will anyway load the root filesystem in RAM for executing it. So my question why do we need a ramdisk for loading the the root filesystem, if the kernel loads the root file system into RAM ? The documentation for SUSE Linux provides a good explanation of why Linux is booted with a RAMDisk: As soon as the Linux kernel has been booted and the root file system (/) mounted, programs can be run and further kernel

SpringBoot中教你手把手配置 https

我怕爱的太早我们不能终老 提交于 2019-12-03 15:45:20
升级 https 记录 1、去阿里云购买证书(免费版),并提交审核资料 购买的证书 2、下载证书 下载证书 3、查看上图页面的第三步 JKS证书安装 4、在证书目录下执行阿里云提供的命令,密码都填 pfx-password.txt 中的内容(三次),会生成 your-name.jks 文件。 生成 jks 证书 此处我已改名为 any.jks 5、将 any.jks 复制到 spring boot 应用的 resources 目录下 移动证书 6、在 application.yml 中配置证书及端口,密码填写第四步中的密码 image.png 此配置会使 Undertow 容器监听 443 端口,那么只有在域名前添加 https:// 才能访问网站内容,添加 http:// 则不行,所以需要让 Undertow 容器监听 80 端口,并将 80 端口的所有请求重定向到 443 端口,即完成 http 到 https 的跳转。 7、添加 SslConfig.java ,配置 Undertow 监听 80 端口。 @Configuration public class SslConfig { @Bean public EmbeddedServletContainerFactory servletContainer() {

Spring Boot 日志处理你还在用Logback?

微笑、不失礼 提交于 2019-12-03 15:44:29
▶ Log4j2 性能 https://logging.apache.org/log4j/2.x/performance.html ▶ Spring Boot 依赖与配置 Maven 依赖 <!-- web --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifactId> </exclusion> </exclusions> </dependency> <!-- 日志 Log4j2 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-log4j2</artifactId> </dependency> <!-- Log4j2 异步支持 --> <dependency> <groupId>com.lmax</groupId> <artifactId

Pausing service until internet connection can be established

自古美人都是妖i 提交于 2019-12-03 15:16:49
I have a service that runs upon boot completion. This service requires internet connectivity. What's the best practice for waiting for the device to connect to the internet? Mobile of wifi doesn't really matter. My current solution involves a while loop that just checks ConnectivityManager until one of the networks becomes available, but this feels vulgar. Is there a better way to do this? Mr_and_Mrs_D but this feels vulgar Indeed :D Your receiver wakes your wakeful intent service (probably a simple intent service would do, as the phone does not sleep while booting AFAIK) service registers a

update-rc.d and init.d dependencies

 ̄綄美尐妖づ 提交于 2019-12-03 15:10:34
So I'm trying to write some init.d scripts satisfying LSB so they run appropriately at startup and shutdown. Unfortunately, I'm having issues with LSB/update-rc.d to satisfy dependencies. # Required-Start: $network $local_fs hadoop-namenode hadoop-datanode zookeeper-server # Required-Stop: $network $local_fs hadoop-namenode hadoop-datanode zookeeper-server # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 however, when I run update-rc.d defaults, it merely generates the defaults involved, with the exact same start time as the already dependencies, which breaks things horribly. Am I missing

springboot整合spring Data JPA

China☆狼群 提交于 2019-12-03 15:00:13
今天敲代码,一连串的错误,我也是服气~果然,我们不是在出bug,就是在找bug的路上…… 今天完成的是springboot整合spring data JPA ,出了一连串的错,真是头大 java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965) ~[mysql-connector-java-5.1.46.jar:5.1.46] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976) ~[mysql-connector-java-5.1.46.jar:5.1.46] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912) ~[mysql-connector-java-5.1.46.jar:5.1.46] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871) ~[mysql-connector-java-5.1.46.jar:5.1.46] at com

spring boot 面试题详解

倖福魔咒の 提交于 2019-12-03 13:56:21
1、 什么是springboot 用来简化spring应用的初始搭建以及开发过程 使用特定的方式来进行配置(properties或yml文件) 创建独立的spring引用程序 main方法运行 嵌入的Tomcat 无需部署war文件 简化maven配置 自动配置spring添加对应功能starter自动化配置 答:spring boot来简化spring应用开发,约定大于配置,去繁从简,just run就能创建一个独立的,产品级别的应用 2、 Spring Boot有哪些优点? 答:-快速创建独立运行的spring项目与主流框架集成 -使用嵌入式的servlet容器,应用无需打包成war包 -starters自动依赖与版本控制 -大量的自动配置,简化开发,也可修改默认值 -准生产环境的运行应用监控 -与云计算的天然集成 3、如何重新加载Spring Boot上的更改,而无需重新启动服务器? 这可以使用DEV工具来实现。通过这种依赖关系,您可以节省任何更改,嵌入式tomcat将重新启动。 Spring Boot有一个开发工具(DevTools)模块,它有助于提高开发人员的生产力。Java开发人员面临的一个主要挑战是将文件更改自动部署到服务器并自动重启服务器。 开发人员可以重新加载Spring Boot上的更改,而无需重新启动服务器。这将消除每次手动部署更改的需要。Spring

Spring boot入门

孤街醉人 提交于 2019-12-03 13:54:08
一,概述   spring boot是spring全家桶的一员,在项目中常常作为spring的补充而存在,其设计目的是为了简化新spring应用的初始创建搭建和开发过 程,较之spring,spring boot节省了大部分创建配置文件的时间,官方号称零配置. 二,特点 使用 “习惯优于配置” (项目中存在大量的配置,此外还内置一个习惯性的配置,让你无须)的理念让你的项目快速运行起来。 它并不是什么新的框架,而是默认配置了很多框架的使用方式,就像 Maven 整合了所有的 jar 包一样,Spring Boot 整合了所有框架 简单、快速、方便地搭建项目;对主流开发框架的无配置集成;极大提高了开发、部署效率 三,spring boot项目快速搭建   1,新建项目   创建spring initializr项目      修改Groud,Artifact      选择骨架web-->spring web      一路next...   成功后的项目界面    来源: https://www.cnblogs.com/changzhen/p/11797839.html

VMware安装Redhat6.5

蓝咒 提交于 2019-12-03 13:29:37
首先,电脑上需要安装VMware,RedHat镜像下载地址: 链接:https://pan.baidu.com/s/16xZ65Abd7xpUF243Xa8ivQ 提取码:51qy 一、新建一个虚拟机 二、配置虚拟机的镜像文件 三、开始安装Redhat6.5 四、开始分盘 选择分区方案。 Use All Space:使用所有空间。删除所有分区,并执行默认的安装策略。 Replace Existing Linux System(s):替换现有 Linux 系统。只删除 Linux 文件系统的分区,并执行默认的安装策略。 Shrink Current System:缩小现有系统。缩小现有分区大小,并执行默认的安装策略。 Use Free Space:使用剩余空间。使用剩余的空间,执行默认的安装策略。 Create Custom Layout:创建自定义布局。 默认的安装策略: ① 分出一个单独的分区,挂载到 /boot 目录; ② 创建 SWAP 分区,一般为内存的 1.5-2 倍; ③ 剩余空间全部分给 / 分区 我们选择最后一项。 我们这里就简单说一下分盘,讲我们前面设置的30G分成3个盘使用,具体分法如下: 200MB /boot 4096 SWAP 剩下全部 / 创建分区。 点击 Create(创建); 选择 Standard Partition(标准分区); 点击

Spring boot整合Mybatis

早过忘川 提交于 2019-12-03 13:28:49
  时隔两个月的再来写博客的感觉怎么样呢,只能用“棒”来形容了。闲话少说,直接入正题,之前的博客中有说过,将spring与mybatis整个后开发会更爽,基于现在springboot已经成为整个业界开发主流框架的情况下,今天在这里就直接将mybatis整合spring boot了。   先简单地提一下Spring boot。在Mybatis还没火起来之前,大家用的是SSH(Struts2+Spring+Hibernate),之后mybatis以其小巧轻便的优点成为中小型项目的首选,与此同时基于Spring的自家mvc框架SpringMVC也火起来了,于是开发的框架又成了SSM(SpringMVC+Spring+Mybatis),但是Spring和Spring MVC本是同源,叫起来还得分开叫真是头疼,然后Spring boot出现了,它是基于Spring4的条件注册的一套快速开发整合包,同时又整合了Spring MVC了,所以说SpringMVC的那一套注解可以原封不动地搬来用。同时Spring boot为了解决Spring框架需要进行大量的配置的问题又引入自动配置的概念,也就是说能用注解我绝不用配置文件。关于Spring boot具体一点的东西我就直接在下面结合代码里讲了。   首先呢,新建一个maven项目,记得勾选上create a simple project