liquibase

Spring Boot : 微服务应用监控 Spring Boot Actuator 详解

China☆狼群 提交于 2020-07-27 10:59:56
引言 在当前的微服务架构方式下,我们会有很多的服务部署在不同的机器上,相互是通过服务调用的方式进行交互,一个完整的业务流程中间会经过很多个微服务的处理和传递,那么,如何能知道每个服务的健康状况就显得尤为重要。 万幸的是 Spring Boot 为我们提供了监控模块 Spring Boot Actuator ,本篇文章将和大家一起探讨一些 Spring Boot Actuator 一些常见用法方便我们在日常的使用中对我们的微服务进行监控治理。 Spring Boot Actuator 帮我们实现了对程序内部运行情况监控,比如监控状况、Bean加载情况、环境变量、日志信息、线程信息等。 Actuator 的使用 2.1 工程依赖 使用 Spring Boot Actuator 需要加入如下依赖: org.springframework.boot spring-boot-starter-actuator COPY 注意: 因 Spring Boot Actuator 会暴露我们服务的详细信息,为了保障安全性,建议添加安全控制的相关依赖 spring-boot-starter-security ,这样,在访问应用监控端点时,都需要输入验证信息。所需依赖如下: org.springframework.boot spring-boot-starter-security COPY 2.2

Using liquibase to create triggers in mysql

北城余情 提交于 2020-07-10 09:09:31
问题 I want to create a simple trigger in mysql using liquibase. The following script works directly from mysql: delimiter $$ CREATE TRIGGER myTrigger BEFORE INSERT ON myTable FOR EACH ROW BEGIN IF(NEW.my_timestamp IS NULL) THEN SET NEW.my_timestamp = now(); END IF; END$$ delimiter ; So, I want to create a changeset for liquibase to use that can apply this trigger using the update command, and will also create a suitable sql script when using the updateSQL command. I have tried a variety of

Using liquibase to create triggers in mysql

冷暖自知 提交于 2020-07-10 09:03:53
问题 I want to create a simple trigger in mysql using liquibase. The following script works directly from mysql: delimiter $$ CREATE TRIGGER myTrigger BEFORE INSERT ON myTable FOR EACH ROW BEGIN IF(NEW.my_timestamp IS NULL) THEN SET NEW.my_timestamp = now(); END IF; END$$ delimiter ; So, I want to create a changeset for liquibase to use that can apply this trigger using the update command, and will also create a suitable sql script when using the updateSQL command. I have tried a variety of

Pass liquibase parameters to gradle liquibase 'update' task

我与影子孤独终老i 提交于 2020-06-27 10:33:50
问题 I want to pass username, password and url liquibase parameters as a command line parameters to gradle's liquibase update task. I have followed liquibase-gradle-plugin to configure the plugin. What I actually want to achieve is, pass these database parameters at runtime instead of hardcoding them in liquibase.properties file. I can do this by exporting these three values as environment variables and access them in build.gradle. But I want to achieve this using commandline parameters. I tried

Liquibase: How to disable FILENAME column check?

一个人想着一个人 提交于 2020-06-27 07:28:32
问题 For our application we liquibase and may have a need to run DB migrations both from command line (manually on production) AND automatically as the application starts up (test environment etc). The problem is that Liquibase considers the whole filename as a portion of a changeSet's identity, therefore it tries to reapply the changesets if the path is different. For example, in case of "fully qualified path" VS "relative path" to to the db-changelog file. How to disable FILENAME column check?

Java code changeset in liquibase

泄露秘密 提交于 2020-06-09 07:47:12
问题 Is there a way in liquibase to create java code change set (i.e. provide a java class, which will receive a JDBC connection and will perform some changes in the database) ? (I know that flyway has such feature) 回答1: Yes, there is such feature. You can create a customChange: <customChange class="my.java.Class"> <param name="id" value="2" /> </customChange> The class must implements the liquibase.change.custom.CustomTaskChange interface. @Override public void execute(final Database arg0) throws

Understanding the behaviour of logicalFilePath in liquibase

删除回忆录丶 提交于 2020-06-08 20:07:50
问题 One of my changesets had a logicalFilePath which was incorrect(two changesets accidentally had the same logicalFilePath) and upon editing the logicalFilePath in an existing changeset, liquibase update failed with an error of duplicate column, which would mean that liquibase thought the changeset to be not executed and re-ran it. Does liquibase identify if a changeset has already been executed based on the 'EXECUTED' flag or the combination of 'id','author' and 'logicalFilePath'? Also, how do

Understanding the behaviour of logicalFilePath in liquibase

瘦欲@ 提交于 2020-06-08 20:07:06
问题 One of my changesets had a logicalFilePath which was incorrect(two changesets accidentally had the same logicalFilePath) and upon editing the logicalFilePath in an existing changeset, liquibase update failed with an error of duplicate column, which would mean that liquibase thought the changeset to be not executed and re-ran it. Does liquibase identify if a changeset has already been executed based on the 'EXECUTED' flag or the combination of 'id','author' and 'logicalFilePath'? Also, how do

Liquibase update error

六月ゝ 毕业季﹏ 提交于 2020-05-14 17:47:03
问题 I am trying to create a few tables in a DB using Liquibase. Some background: I executed the same changelog.xml file on a local h2 database and it worked succussfully. And I tested the below oracle database, username, password and driver with squirrel and it connected successfully. So I'm fairly certain that I am facing a liquibase problem. I did extensive google-ing and did not find anything on SO or anywhere else that could helped me. I entered the following into the command prompt: C:\>java

Cant run liquibase with command line

大兔子大兔子 提交于 2020-05-14 14:41:10
问题 I want to use liquibase but when I want to let it run with command line this happens: PS C:\Users\Ferid\Downloads\liquibase-3.6.0-bin> .\liquibase Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/filter/Filter at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.privateGetMethodRecursive(Unknown Source) at