Using Docker to build ZooKeeper cluster in CentOS 7
1. First, Docker should be installed in CentOS 7, Docker installation reference
2. Pull the docker image of ZooKeeper and go to https://hub.docker.com/ Search relevant zoomkeeper images on
docker pull zookeeper:3.4.14
3. Create three folders corresponding to three containers on the host computer
/root/zookeeper01/conf
/root/zookeeper01/d ...
Posted by mcollyns on Fri, 20 Mar 2020 07:59:17 -0700
Share some best practices of PHP coding
For starters, it may be difficult to understand why some practices are safer.
However, some of the following tips may be beyond the scope of PHP.
Always use braces
Let's look at the following code:
if (isset($condition) && true === $condition)
echo 'this is a success';
//It's true, but look at the code below
if (isset($condi ...
Posted by Boerboel649 on Fri, 20 Mar 2020 01:47:57 -0700
Three Uses and Source Interpretation of Spring Import
_Recent reviews of Spring Cloud-related sources have added enable s to each new starter, such as: @EnableDiscoveryClient, which registers applications with Eureka Server and pulls services owned by Eureka Server into a micro-service system.Click on the EnableDiscoveryClient source code and you will find the @import annotation inside.The ...
Posted by thomashw on Thu, 19 Mar 2020 17:55:50 -0700
[Spring Security + OAuth2 + JWT introduction to actual combat] 22. Transformation of social login
brief introduction
SDK is generally provided for APP social login. There are two situations for SDK
First kind
SDK provider returns openId and logs in to our interface system with openId to apply for token
Create the OpenIdAuthenticationToken class:
/**
*
*/
package com.spring.security.social.openid;
import java.util.Collection ...
Posted by pinhead on Thu, 19 Mar 2020 11:07:48 -0700
SpringBoot learning notes-009
4.7 error handling mechanism
4.7.1. Default error handling mechanism of SpringBoot
1. Default effect:
1) Return to an error page
Request headers sent by browser:
2) If it is another client, it will respond to a json data by default.
{
"timestamp":"2020-03-14T15:56:48.897+0000",
"status":404,
"error":"Not Found",
"message":"No ...
Posted by spaceknop on Thu, 19 Mar 2020 06:26:40 -0700
Several ways to create threads in java
brief introduction
Creating threads is the most basic operation in multithreaded programming
1. Inherit Thread class and override run() method
public class CreatingThread01 extends Thread {
@Override
public void run() {
System.out.println(getName() + " is running");
}
public static void main(String[] args) {
new ...
Posted by SN1P3R_85 on Thu, 19 Mar 2020 02:02:52 -0700
nginx request line reading process
In the previous article, we explained how nginx establishes a connection and reads data when a request arrives.After reading the data, nginx sets the callback method for reading events to ngx_http_process_request_line(), which has the following main functions:
Read the data requested by the client, and continue to listen for client read events ...
Posted by rharter on Wed, 18 Mar 2020 21:14:36 -0700
[Spring Security + OAuth2 + JWT entry to actual combat] 20. Password modification login returns standard oauth2 message
brief introduction
Before modification, password login returns standard OAuth2 login success message
Technological process
Refer to this process to generate a token in the login success processor HkAuthenticationSuccessHandler and return:
This is a successful processor copied from the previous browser project. We need to install the abov ...
Posted by Maknis on Wed, 18 Mar 2020 09:05:42 -0700
Introduction to java object-oriented 2 (31) reflection
Introduction to reflection
1, Introduction & overview
In order to have more flexible access to all the contents of the class (including private), we need reflection technology
Reflection: the act or characteristic of mapping a complete thing (the super power of any content in a single operation class)
Get member methods / memb ...
Posted by justindublin on Wed, 18 Mar 2020 08:53:12 -0700
Prometheusf installation and use
Reference resources https://blog.51cto.com/14157628/2473866?source=dra
Before deploying Prometheus, due to the low configuration of the experimental environment, the original dashboard and Scope were deleted!
Before you actually deploy Prometheus, you should understand the relationships and functions among the components of Prometheus: 1) ...
Posted by [JayZ] on Wed, 18 Mar 2020 08:22:06 -0700