boot

Passing Linux boot opts to Init

筅森魡賤 提交于 2019-12-07 19:37:31
问题 I would like to pass some parameters to a customized Linux init via the boot options configured in the bootloader at boot. I've written test init's in both Python and C. The Python version is able to see anything in the kernel boot options that doesn't have a '=' or '.' in it. The values are found in sys.argv. However, the C program doesn't seem to get passed the values. I would have thought the sys.argv list in Python was generated by parsing the **argv array. Below are the test scripts and

springboot(六):如何优雅的使用mybatis

假装没事ソ 提交于 2019-12-07 16:11:03
这两天启动了一个新项目因为项目组成员一直都使用的是mybatis,虽然个人比较喜欢jpa这种极简的模式,但是为了项目保持统一性技术选型还是定了 mybatis。到网上找了一下关于spring boot和mybatis组合的相关资料,各种各样的形式都有,看的人心累,结合了mybatis的官方demo和文档终于找到了最简的两种模式,花了一天时间总结后分享出来。 orm框架的本质是简化编程中操作数据库的编码,发展到现在基本上就剩两家了,一个是宣称可以不用写一句SQL的hibernate,一个是可以灵活调试动态sql的mybatis,两者各有特点,在企业级系统开发中可以根据需求灵活使用。发现一个有趣的现象:传统企业大都喜欢使用hibernate,互联网行业通常使用mybatis。 hibernate特点就是所有的sql都用Java代码来生成,不用跳出程序去写(看)sql,有着编程的完整性,发展到最顶端就是spring data jpa这种模式了,基本上根据方法名就可以生成对应的sql了,有不太了解的可以看我的上篇文章 springboot(五):spring data jpa的使用 。 mybatis初期使用比较麻烦,需要各种配置文件、实体类、dao层映射关联、还有一大推其它配置。当然mybatis也发现了这种弊端,初期开发了 generator 可以根据表结果自动生产实体类

Centos7上使用Docker部署spring boot项目

会有一股神秘感。 提交于 2019-12-07 15:07:23
前提: 1.有个spring boot项目(可参考: https://blog.csdn.net/hometing218/article/details/84580142 ) 2.安装好Centos7系统且安装好Docker环境(可参考: https://blog.csdn.net/hometing218/article/details/84646603 ) 1.在spring boot目录的main下建个docker文件夹存放Dockerfile文件;如图: 2.安装JDK yum -y install java-1.8.0-openjdk* 这样JDK默认安装在/usr/lib/jvm/; 切到安装路径下查看安装的jdk版本,然后配置环境变量 vim /etc/profile 添加一下内容,JAVA_HOME路径填自己安装的路径 export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64 export PATH=$PATH:$JAVA_HOME/bin 修改完成之后,使其生效,使用java -version查看版本;返回版本则说明配置没有问题 source /etc/profile java -version 3.安装Maven 3.1:下载maven 包 wget http:/

SpringBoot与SpringCloud的版本对应详细版

倾然丶 夕夏残阳落幕 提交于 2019-12-07 15:04:24
缘起 初学spring cloud的朋友可能不知道,其实SpringBoot与SpringCloud需要版本对应,否则可能会造成很多意料之外的错误,比如eureka注册了结果找不到服务类啊,比如某些jar导入不进来啊,等等这些错误。下面列出来springBoot和spring cloud的版本对应关系,需要配套使用,才不会出现各种奇怪的错误。 关于maven仓库的版本列表 spring-cloud-dependencies 版本列表可查看: https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies spring-boot-starter-parent 版本列表可查看: https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent 版本对应关系 大版本对应: Spring Cloud Spring Boot Angel版本 兼容Spring Boot 1.2.x Brixton版本 兼容Spring Boot 1.3.x,也兼容Spring Boot 1.4.x Camden版本 兼容Spring Boot 1.4.x,也兼容Spring Boot 1.5.x

Kafka Spring Boot 消费者配置注意事项

喜你入骨 提交于 2019-12-07 11:59:27
Kafka Spring Boot 消费者配置注意事项 Kafka 使用Spring Boot集成时,配置Consumer时遇到运行时错误: java.io.EOFException: null 或者 Bootstrap broker … disconnected 如果配置了SASL参数,那么,恭喜你,这个问题,本篇博客可以解决你的问题。 由于SASL配置在Spring Boot集成时的配置是非标准的,所以如果配置文件不对,那么链接kafka服务器是链接就会断开,而不会提示是否是SASL参数问题,为了找到问题,调试好久才发现。 正确的配置方式是:(yaml格式) spring: kafka: # 舆情系统Kafka参数配置 consumer: #省略... key-deserializer: org.apache.kafka.common.serialization.StringDeserializer value-deserializer: org.apache.kafka.common.serialization.StringDeserializer #这里是关键<---- properties: security.protocol: SASL_PLAINTEXT sasl.mechanism: PLAIN sasl.kerberos.service.name: kafka #

微服务应用-基于Spring Cloud和Docker构建电影推荐微服务

时光总嘲笑我的痴心妄想 提交于 2019-12-07 10:55:03
前言 最近为了扩展自己对云应用的理解,找了好多基于Spring Cloud的demo,下面推荐两个开源社区项目:spring-cloud-microservice-example(基于Spring Cloud和Docker构建电影推荐微服务)和spring-cloud-event-sourcing-example(基于Spring Cloud和Reactor实现Event Sourcing构建网上商店微服务),我会相继写出作者项目博客的翻译文档,考虑外网问题,我将原英文文档pdf上传到资源里了,如果你对原文感兴趣,可以下载看看。 使用Spring Cloud和Docker构建电影推荐微服务 如果你对云应用很了解,可以直接移步下载运行项目(https://github.com/kbastani/spring-cloud-microservice-example),或跳转到部署步骤。 English tutorial available here: Building Microservices with Spring Cloud and Docker .(原文翻译如下) 本博客系列将向你介绍一些使用Spring Cloud和Docker构建微服务平台的基本概念。 什么是Spring Cloud? Spring Cloud 是Pivotal提供的用于简化分布式系统构建的工具集

Spring Boot学习笔记(一)——spring boot项目搭建及配置文件初探

别来无恙 提交于 2019-12-07 09:56:47
简介 L 1.Hello World! 一、初始化项目 二、添加基本的配置 三、简单controller 四、spring boot开发过程中的热加载 L 2. Spring Boot项目中的配置文件 一、两种常用的配置文件 1. 文件格式 2. 语法特点 二、常用的配置项 简介 Spring Boot 是当前十分流行的用于开发微服务的 Java 框架。其设计目的是用来简化 Spring 应用的初始搭建以及开发过程。 Spring Boot 使用了特定的方式(约定大于配置的理念)进行配置,从而使开发人员不再需要定义样板化的配置。基于 Spring Boot 开发服务时,只需要几个简单的配置就可以搭建起来一个 Web 项目。 Spring Boot 进行开发优点在于:简单、快速、方便地搭建项目;对于主流开发框架可以做到无配置集成,提高开发效率。 L1.Hello World! Spring Boot 因其简单与快速构建项目的特点,构建一个简单的只需要简单的几步,就可以搭建一个可用的 web 工程。 初始化项目主要有两种方式:在 IDE 中新建 Spring Boot 工程,或者是通过 Spring initializer 快速创建一个基础的 spring boot 工程。下面将介绍使用 spring initializer 创建一个基础 spring boot 工程的步骤。 一

Reset vector in 386+ processors

寵の児 提交于 2019-12-07 09:38:57
问题 The wikipedia page for Reset vector says (for 386+ processors): The value of the selector portion of the CS register at reset is F000h, the value of the base portion of the CS register is FFFF0000h, and the value of the IP register at reset is FFF0h to form the segmented address FFFFF000h:FFF0h in real mode. All my reading on computer boot up has said that the processor starts in real mode, and hence "selectors" should not come into picture. Then why the mention here ? Also, what is the "base

Start Service at boot without activity

。_饼干妹妹 提交于 2019-12-07 05:29:46
问题 I want create an application which contains only a service (no activity). This service must start on boot. My problem is that it seems the boot receiver don't seems call if there aren't activity. I have test with the following example. I have the different files : MyReceiver.java : package com.test.teststartserviceatboot; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; import android.widget.Toast; public class

Docker部署Spring Boot应用

旧巷老猫 提交于 2019-12-07 01:35:28
Docker是一个开源的引擎,可以轻松的为任何应用创建一个轻量级的、可移植的、自给自足的容器。开发者在笔记本上编译测试通过的容器可以批量地在生产环境中部署,包括VMs(虚拟机)、 bare metal 、OpenStack 集群和其他的基础应用平台。 使用Docker我们可以很方便的部署Spring Boot应用。 首先构建一个简单的 Spring Boot 项目,然后给项目添加 Docker 支持,最后对项目进行部署 Spring Boot 项目 在pom.xml文件中添加web和测试依赖 < dependencies > < dependency > < groupId > org.springframework.boot </ groupId > < artifactId > spring-boot-starter-web </ artifactId > </ dependency > < dependency > < groupId > org.springframework.boot </ groupId > < artifactId > spring-boot-starter-test </ artifactId > < scope > test </ scope > </ dependency > </ dependencies >