Tag Archives: java

[Solved] hadoop Error: 9000 failed on connection exception java.net.ConnectException Denied to Access

To view the files on haddop, enter:

hadoop fs -ls /

The following occurred:

ls: Call From yx/127.0.1.1 to 0.0.0.0:9000 failed on connection exception: 
java.net.ConnectException: Denied to Access 
For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

Display 9000 port access denied
from the configuration file, you can know that Hadoop needs to access the machine through 9000 port, but now 9000 port access is denied
Input:

telnet localhost 9000

Display:

Trying 127.0.0.1…
telnet: Unable to connect to remote host: Connection refused

Input:

nmap -p 9000 localhost

Display:

Starting Nmap 7.80 ( https://nmap.org ) at 2020-04-25 14:57 CST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000051s latency).
PORT STATE SERVICE
9000/tcp closed cslistener
Nmap done: 1 IP address (1 host up) scanned in 0.03 seconds

 

Use the command:

 lsof -i :9000

See which app is using the port. If the result is empty (return value 1), it is not opened
the above is just to check the status and will not change anything.

Because hadoop connects to the local port in core-site.xml
Open $HADOOP_HOME/etc/hadoop/core-site.xml

<configuration>
<property>
    <name>hadoop.tmp.dir</name>
    <value>/data/tmp/hadoop/tmp</value>
</property>
<property>
    <name>fs.defaultFS</name>
    <value>hdfs://0.0.0.0:9000</value>
</property>
</configuration>

It is found that I have not configured the port number, which is modified to:
hdfs://localhost:9000
It still not work.
I tried many methods, and finally found that the most commonly used method on the Internet is to use this method, which is really OK:

cd $HADOOP_HOME/bin
hdfs namenode -format

But I still couldn’t run it. I tried many times and all the results were the same. Later, then I found an error:

WARN common.Util: Path /data/tmp/hadoop/hdfs/name should be specified as a URI in configuration files. Please update hdfs configuration.

This is due to the non-standard path. The file describing the path is in:

$HADOOP_HOMW/etc/hadoop/hdfs-site.xml

Place in the file:

 <property>  
     <name>dfs.datanode.data.dir</name>  
     <value>/data/tmp/hadoop/hdfs/data</value>  
 </property>

Amend to read:

  <property>  
     <name>dfs.datanode.data.dir</name>  
     <value>file:///data/tmp/hadoop/hdfs/data</value>  
 </property>

The warning disappears
but this does not play a decisive role. My reason is that the security mode is turned on. Just turn off the security mode

cd $HADOOP_HOME/bin
hadoop dfsadmin -safemode leave

Users can

hadoop dfsadmin -safemode value

Operation security mode
value value:
enter: enter security mode
leave: force to leave security mode
get: return to security mode status
wait: until the end of security mode
now:

root@yx:/apps/hadoop/bin# hadoop fs -ls /
20/04/25 19:24:24 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 1 items
drwxr-xr-x   - root supergroup          0 2020-04-25 17:13 /test

[Solved] ClickHouse Error: Code: 62. DB::Exception: Syntax error (Multi-statements are not allowed): fai

1. Preparation

First, I need to create a table and write the corresponding fields in it:

create table t_order_mt(
 id UInt32,
 sku_id String,
 total_amount Decimal(16,2),
 create_time Datetime
) engine =MergeTree
 partition by toYYYYMMDD(create_time)
 primary key (id)
 order by (id,sku_id);

Next, you need to insert the corresponding data into it:

insert into t_order_mt values
(101,'sku_001',1000.00,'2020-06-01 12:00:00') ,
(102,'sku_002',2000.00,'2020-06-01 11:00:00'),
(102,'sku_004',2500.00,'2020-06-01 12:00:00'),
(102,'sku_002',2000.00,'2020-06-01 13:00:00'),
(102,'sku_002',12000.00,'2020-06-01 13:00:00'),
(102,'sku_002',600.00,'2020-06-02 12:00:00');

2. Error display

When I execute select * from table_name, the following problems may occur:

Code: 62. DB::Exception: Syntax error (Multi-statements are not allowed): failed at position 54 (end of query) (line 1, col 54): ;


 FORMAT JSON . . (SYNTAX_ERROR) (version 21.11.6.7 (official build))

3. Solution

You only need to end the sentence after the corresponding sentence; Change to:

select * from t_order_mt;;

Results

 

How to Solve Error-SpringCloud-Feign and Sentinel integrate error

Feign integrate Sentinel error:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 03-31 10:45:01:182 ERROR 21840 --- [ main] o.s.boot.SpringApplication : Application run failed
03-31 10:45:01:182 ERROR 21840 — [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘orderService’: Unsatisfied dependency expressed through field ‘userClient’; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name ‘cn.itcast.feign.clients.UserClient’: Requested bean is currently in creation: Is there an unresolvable circular reference?
at org.springframework.beans.factory.annotation)

1SpringCloud-Feign integrate Sentinel error:

03-31 10:44:59:906  INFO 21840 --- [           main] cn.itcast.order.OrderApplication         : No active profile set, falling back to default profiles: default
03-31 10:45:00:320  INFO 21840 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=15e39e82-ae83-372c-bf12-c9f1083aeff7
03-31 10:45:00:441  INFO 21840 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.cloud.sentinel-com.alibaba.cloud.sentinel.SentinelProperties' of type [com.alibaba.cloud.sentinel.SentinelProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
03-31 10:45:00:442  INFO 21840 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.cloud.sentinel.custom.SentinelAutoConfiguration' of type [com.alibaba.cloud.sentinel.custom.SentinelAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
03-31 10:45:00:596  INFO 21840 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8088 (http)
03-31 10:45:00:604  INFO 21840 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
03-31 10:45:00:604  INFO 21840 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.43]
03-31 10:45:00:605  INFO 21840 --- [           main] o.a.catalina.core.AprLifecycleListener   : Loaded Apache Tomcat Native library [1.2.31] using APR version [1.7.0].
03-31 10:45:00:605  INFO 21840 --- [           main] o.a.catalina.core.AprLifecycleListener   : APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
03-31 10:45:00:606  INFO 21840 --- [           main] o.a.catalina.core.AprLifecycleListener   : APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
03-31 10:45:00:608  INFO 21840 --- [           main] o.a.catalina.core.AprLifecycleListener   : OpenSSL successfully initialized [OpenSSL 1.1.1l  24 Aug 2021]
03-31 10:45:00:691  INFO 21840 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
03-31 10:45:00:691  INFO 21840 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 769 ms
03-31 10:45:01:122  WARN 21840 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderService': Unsatisfied dependency expressed through field 'userClient'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'cn.itcast.feign.clients.UserClient': Requested bean is currently in creation: Is there an unresolvable circular reference?
03-31 10:45:01:124  INFO 21840 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
03-31 10:45:01:132  INFO 21840 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
03-31 10:45:01:182 ERROR 21840 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderService': Unsatisfied dependency expressed through field 'userClient'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'cn.itcast.feign.clients.UserClient': Requested bean is currently in creation: Is there an unresolvable circular reference?
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1425) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) [spring-boot-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at cn.itcast.order.OrderApplication.main(OrderApplication.java:26) [classes/:na]
Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'cn.itcast.feign.clients.UserClient': Requested bean is currently in creation: Is there an unresolvable circular reference?
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:355) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:227) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109) ~[spring-context-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at com.alibaba.cloud.sentinel.feign.SentinelFeign$Builder$1.create(SentinelFeign.java:84) ~[spring-cloud-starter-alibaba-sentinel-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at feign.ReflectiveFeign.newInstance(ReflectiveFeign.java:64) ~[feign-core-10.10.1.jar:na]
	at feign.Feign$Builder.target(Feign.java:269) ~[feign-core-10.10.1.jar:na]
	at org.springframework.cloud.openfeign.HystrixTargeter.target(HystrixTargeter.java:38) ~[spring-cloud-openfeign-core-2.2.7.RELEASE.jar:2.2.7.RELEASE]
	at org.springframework.cloud.openfeign.FeignClientFactoryBean.loadBalance(FeignClientFactoryBean.java:338) ~[spring-cloud-openfeign-core-2.2.7.RELEASE.jar:2.2.7.RELEASE]
	at org.springframework.cloud.openfeign.FeignClientFactoryBean.getTarget(FeignClientFactoryBean.java:369) ~[spring-cloud-openfeign-core-2.2.7.RELEASE.jar:2.2.7.RELEASE]
	at org.springframework.cloud.openfeign.FeignClientFactoryBean.getObject(FeignClientFactoryBean.java:347) ~[spring-cloud-openfeign-core-2.2.7.RELEASE.jar:2.2.7.RELEASE]
	at org.springframework.cloud.openfeign.FeignClientsRegistrar.lambda$registerFeignClient$0(FeignClientsRegistrar.java:240) ~[spring-cloud-openfeign-core-2.2.7.RELEASE.jar:2.2.7.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1235) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-5.2.13.RELEASE.jar:5.2.13.RELEASE]
	... 21 common frames omitted

Solution:

Go to the parent pom file and modify the version of springcloud, change Hoxton.SR10 to Hoxton.SR9, and re-import the pom file

Errorjava Compilation failed internal java compiler error [How to Solve]

Solution:
1. Check the JDK of project(Ctrl+Alt+shift+S)
File ->Project Structure->Project Settings ->Project

2. Check the JDK of project(Ctrl+Alt+shift+S)
File ->Project Structure->Project Settings -> Modules -> (the name you need to modify) -> Sources ->

3. Check the configuration of Java
File ->Setting ->Build,Execution,Deployment -> Compiler -> Java Compiler

If the above three steps still fail
Clear IDEA cache Restart IDEA
File->Invalidate Caches/Restart

[Solved] java.security.AccessControlException: Access Denied Error

Error Messages:

The following error occurs from an application client or in the server.log:
java.security.AccessControlException: access denied
(java.util.PropertyPermission name write…
There is a permissions issue in the policy files. Either the client.policy for the application client or the server.policy for server side components does not have permission to set the property.

 

Solution:
Add the permission in client.policy (for the application client), or in server.policy (for EJB/web modules) for the application that needs to set the property. By default, applications only have “read” permission for properties.
For example, to grant read/write permission for all the files in the codebase directory, add or append the following to client.policy or server.policy:

grant codeBase "file:/.../build/sparc_SunOS/sec/-" {
   permission java.util.PropertyPermission "*", "read,write";
 };

Reference Resources: https://docs.oracle.com/cd/E19830-01/819-4726/fxxzk/index.html

Go to the running $JAVA_HOME and look for the xx.policy file, and then make changes in the contents

find . -type f -name "*.policy"

Note: local operation does not have such a problem and the production has, then you can consider the production of the corresponding file was modified to affect the original program (consider restoring the configuration to determine what configuration is affected)

[Solved] Syntax Error: Error: ENOENT: no such file or directory, scandir ‘D:\LeStoreD

Syntax Error: Error: ENOENT: no such file or directory, scandir ‘D:\LeStoreD

Solution: execute the following command

npm rebuild node-sass

PS D:\LeStoreDownload\CinemaBookingSystem-master\panda-user> npm install
up to date in 21.517s

62 packages are looking for funding
  run `npm fund` for details

PS D:\LeStoreDownload\CinemaBookingSystem-master\panda-user> npm rebuild node-sass

> [email protected] install D:\LeStoreDownload\CinemaBookingSystem-master\panda-user\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Users\29395\AppData\Roaming\npm-cache\node-sass\4.14.1\win32-x64-83_binding.node

> [email protected] postinstall D:\LeStoreDownload\CinemaBookingSystem-master\panda-user\node_modules\node-sass
> node scripts/build.js

Binary found at D:\LeStoreDownload\CinemaBookingSystem-master\panda-user\node_modules\node-sass\vendor\win32-x64-83\binding.node
Testing binary
Binary is fine
[email protected] D:\LeStoreDownload\CinemaBookingSystem-master\panda-user\node_modules\node-sass

[Solved] Error: Blocked mirror for repositories maven intellij Mac

Error: Blocked mirror for repositories maven intellij

Error

the following errors appear when building a project:


Solution:

First case

Change settings: preference -> Build, Execution, Deployment -> Build Tools -> Maven

Find Maven home path and change the default checked version to use Maven wrapper


build succeefully

The second case

Maven is not installed. It is recommended to reinstall Maven

brew install maven

How to Solve zuul Forwarding error (No Retrayable)

Text

Service A restarts, zuul without adding a retry mechanism, and A service error exception will be reported

Solution: Modify gateway profile

hystrix:
    command:
        default:
            execution:
                isolation:
                    thread:
                        timeout-in-milliseconds: 20000
zuul:
  host:
    connect-timeout-millis: 20000
    socket-timeout-millis: 20000
  routes:
    #userMicroservices
    userService:
      #All requests with /user as the header are forwarded to user
      path: /user/**
      serviceId: user
      #url: http://localhost:8091
    pickupService:
      #All requests with /pickup as the header are forwarded to pickup
      path: /pickup/**
      serviceId: pickup
    orderService:
      #All requests with /order as the header are forwarded to order
      path: /order/**
      serviceId: order
  #Whether retryable is enabled
  retryable: true
ribbon:
  #resolve the timeout problem caused by zuul forwarding requests
  ReadTimeout: 60000 
  SocketTimeout: 60000
  # of retries for the current service
  MaxAutoRetries: 2
  # of times to switch the same Server
  MaxAutoRetriesNextServer: 0

How to Solve Hbase JAVA import Package Error

Elsipe connects to Hbase
When programming with the hbase API, importing many packages may cause errors
Since it is too tedious to add dependencies manually, we finally chose to create a new maven project, which makes it possible to add the dependencies we need automatically.

Create a new maven project
I’m using the latest version of eclipse 2021-12, so I skipped this step.

Create a new project





Modify pom.xml
In the new maven project, find the pom.xml and modify it

Add the following, and make sure that the version is consistent with your own hbase version.
Check your own hbase version with “hbase version” command

<dependency>
    	<groupId>org.apache.hbase</groupId>
    	<artifactId>hbase-client</artifactId>
    	<version>2.4.10</version>
</dependency>

Wait for automatic compilation to complete

The imported packages will not report errors

ES Error: Elasticsearch health check failed [How to Solve]

Original error report:

2020-11-30 18:39:08.019  WARN 17664 --- [-192.168.113.22] s.b.a.e.ElasticsearchRestHealthIndicator : Elasticsearch health check failed

java.net.ConnectException: Timeout connecting to [localhost/127.0.0.1:9200]
	at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:943) ~[elasticsearch-rest-client-6.4.3.jar:6.4.3]
	at org.elasticsearch.client.RestClient.performRequest(RestClient.java:227) ~[elasticsearch-rest-client-6.4.3.jar:6.4.3]
	at org.springframework.boot.actuate.elasticsearch.ElasticsearchRestHealthIndicator.doHealthCheck(ElasticsearchRestHealthIndicator.java:60) ~[spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:82) ~[spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at org.springframework.boot.actuate.health.CompositeHealthIndicator.health(CompositeHealthIndicator.java:95) [spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at org.springframework.boot.actuate.health.HealthEndpoint.health(HealthEndpoint.java:50) [spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
	at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) [spring-core-5.1.9.RELEASE.jar:5.1.9.RELEASE]
	at org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker.invoke(ReflectiveOperationInvoker.java:76) [spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at org.springframework.boot.actuate.endpoint.annotation.AbstractDiscoveredOperation.invoke(AbstractDiscoveredOperation.java:60) [spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at org.springframework.boot.actuate.endpoint.jmx.EndpointMBean.invoke(EndpointMBean.java:121) [spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at org.springframework.boot.actuate.endpoint.jmx.EndpointMBean.invoke(EndpointMBean.java:96) [spring-boot-actuator-2.1.7.RELEASE.jar:2.1.7.RELEASE]
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) [na:1.8.0_161]
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) [na:1.8.0_161]
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) [na:1.8.0_161]
	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) [na:1.8.0_161]
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) [na:1.8.0_161]
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) [na:1.8.0_161]
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) [na:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:361) [na:1.8.0_161]
	at sun.rmi.transport.Transport$1.run(Transport.java:200) [na:1.8.0_161]
	at sun.rmi.transport.Transport$1.run(Transport.java:197) [na:1.8.0_161]
	at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_161]
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196) [na:1.8.0_161]
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) [na:1.8.0_161]
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) [na:1.8.0_161]
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) [na:1.8.0_161]
	at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_161]
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) [na:1.8.0_161]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_161]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_161]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_161]
Caused by: java.net.ConnectException: Timeout connecting to [localhost/127.0.0.1:9200]
	at org.apache.http.nio.pool.RouteSpecificPool.timeout(RouteSpecificPool.java:169) ~[httpcore-nio-4.4.11.jar:4.4.11]
	at org.apache.http.nio.pool.AbstractNIOConnPool.requestTimeout(AbstractNIOConnPool.java:628) ~[httpcore-nio-4.4.11.jar:4.4.11]
	at org.apache.http.nio.pool.AbstractNIOConnPool$InternalSessionRequestCallback.timeout(AbstractNIOConnPool.java:894) ~[httpcore-nio-4.4.11.jar:4.4.11]
	at org.apache.http.impl.nio.reactor.SessionRequestImpl.timeout(SessionRequestImpl.java:183) ~[httpcore-nio-4.4.11.jar:4.4.11]
	at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processTimeouts(DefaultConnectingIOReactor.java:210) ~[httpcore-nio-4.4.11.jar:4.4.11]
	at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:155) ~[httpcore-nio-4.4.11.jar:4.4.11]
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:351) ~[httpcore-nio-4.4.11.jar:4.4.11]
	at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221) ~[httpasyncclient-4.1.4.jar:4.1.4]
	at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64) ~[httpasyncclient-4.1.4.jar:4.1.4]
	... 1 common frames omitted

Solution: add the following configuration to solve the problem successfully

  data:
    elasticsearch:
      repositories:
        enabled: true
      cluster-nodes: 192.168.136.137:9300
      cluster-name: docker-cluster
  #      Add the following configuration to pass the health check
  elasticsearch:
    rest:
      uris: ["http://192.168.136.137:9200"]

[Solved] Mybatis Batch Modify Error: multi-statement not allow

Error message:

Solution:
1. First add: &allowMultiQueries=true after the database connection string

jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true

2. If there is still error, add a file

@Configuration
public class DruidConfig {   
     
     @Bean
     @ConfigurationProperties(prefix="spring.datasource")
     public DataSource druidPrimary(){
          DruidDataSource druidDataSource = new  DruidDataSource();
          List<Filter> filterList = new ArrayList<>();
          filterList.add(wallFilter());
          druidDataSource.setProxyFilters(filterList);
          return new DruidDataSource();     
     }    
     
     @Bean
    public WallFilter wallFilter(){
        WallFilter wallFilter = new WallFilter();
        wallFilter.setConfig(wallConfig());
        return wallFilter;
    }
     
     @Bean
    public WallConfig wallConfig() {
        WallConfig config = new WallConfig();
        config.setMultiStatementAllow(true);//允许一次执行多条语句
        config.setNoneBaseStatementAllow(true);//允许一次执行多条语句
        return config;
    }
}