Open Platform README.MD

FAQ:
 1. Swagger page access path
http: // localhost:8080/swagger-ui.html 
2. Mapping file automatically generated by Mybatis
      When querying field information of text type, use the primary key query, or use the withBlobs query alone
      Both inserts and updates contain
3. Start the test environment service: nohup java -jar openplatform-0.0.1-SNAPSHOT.jar & 
              nohup // The output of running the command without hanging up is generally redirected to the nohup.out file in the current directory 
              $ // Run the command in the background 
4. The script starts the service
. /server.sh stop| start
 5. redis- cli connection test environment redis service
Go to cmd in the command directory and execute the command to connect to the redis service of the test environment redis -cli -h 10.0.0.112 -p 6379 -a crs-pf25dj24:Jt3d#%^ 5Ed
redis-cli> config set notify-keyspace-events Egx
After the redis service configuration is completed, you need to add the automatic configuration information of spring session to redis in the code NO_OP
Otherwise, the service will still report an error when it starts.
6. Login address of the background management system page
http: // 10.0.0.222:8284/#/ 
7. Use the log file of the log framework to remove the log output of nohup
nohup java -jar openplatform-back-0.0.1-SNAPSHOT.jar >> /dev/null  &
8. Log related configuration information
If your terminal supports ANSI, setting colored output will make the log more readable. Supported by setting the spring.output.ansi.enabled parameter in application.properties.
NEVER: disable ANSI - colored output (default)
DETECT: Will check whether the terminal supports ANSI, and if so, use color output (recommended)
ALWAYS: Always use ANSI - colored format for output. If the terminal does not support it, there will be a lot of interference information. It is not recommended to use
 9. Start nginx in the test environment
           cd   /usr/local/nginx/ conf
            /usr/local/nginx/sbin/nginx -start service
            /usr/local/nginx/sbin/nginx -s stop -stop service
            /usr/local/nginx/sbin/nginx -h Command help
            /usr/local/nginx/sbin/nginx -t verify config file
            vim /usr/local/nginx/conf/ nginx.conf nginx configuration file
 10 , log file printing modification, adjust to the logs directory, the original log file does not record log information
  The standard output of the nohup command is directed to /dev/ null , which is not saved.
     The maximum size of a single log file is 10Mb, after which the file name will be automatically switched    
11, du - sh to view the log file size
 12 , nginx log
log_format format variable:
    $remote_addr #Record the client address that accesses the website
    $remote_user #remote client username
    $time_local #Record access time and time zone
    $request #User's http request start line information
    $status #http status code, record the status code returned by the request, for example: 200, 301 , 404, etc.
    $body_bytes_sent #Number of response body bytes sent by the server to the client
    $http_referer #Record the connection from which this request is accessed, and you can set the anti-leech setting according to this parameter.
    $http_user_agent #Record client access information, such as browsers, mobile clients, etc.
    $http_x_forwarded_for #When there is a proxy server at the front end, set the configuration of the web node to record the client address. The premise of this parameter taking effect is that the proxy server also needs to perform related x_forwarded_for settings
13. Add virtual machine startup parameters-- Simple introduction
 - Djava.awt.headless= true 
When using Java to process graphics applications, it is often recommended to set -Djava.awt.headless= true , the specific meaning and effect have been checked and recorded in Sharing the Headless mode here is a configuration mode of the system. In this mode, the system lacks a display device, keyboard or mouse. Although the headless mode is not what we want to see, in fact we often need to work in this mode, especially for server-side program developers. Because servers (such as hosts that provide Web services) may often lack the aforementioned devices, but they need to use the functions they provide to generate corresponding data to provide to clients (such as browsers equipped with relevant display devices, keyboards and host of the mouse). Generally, the headless mode is activated at the beginning of the program, telling the program that now you want to work in Headless mo...
 -Djava.net.preferIPv4Stack= true
Let the program only support the use of IPv4

##debug mode start
- XDebug enables debugging.
- Xnoagent disables the default sun.tools.debug debugger.
-Djava.compiler= NONE Suppresses the loading of the JIT compiler.
- Xrunjdwp loads the JPDA reference execution instance of JDWP
dt_socket socket transport.
dt_shmem Shared memory transfer, Windows only.
server =y/ n Whether the VM needs to execute as a debug server.
address = 3999           The port number of the debug server, the port number that the client uses to connect to the server.
suspend =y/ n Whether to start the VM after the debug client has established a connection.


##jmx mode start
-Dcom.sun.management.jmxremote.port=1099 open port
 -Dcom.sun.management.jmxremote.ssl= false  
JMX SSL connection open
-Dcom.sun.management.jmxremote.authenticate=false
No permission verification

Whole heap size = young generation + old generation + persistent generation
normal management parameters
- server 
 -Xmx2g --Maximum available memory
 -Xms2g --Initialize heap size
 -Xmn256m --newSize
The persistent generation is generally fixed at 64m, so after increasing the young generation, the size of the old generation will be reduced. This value has a great impact on system performance, and Sun officially recommends configuring it as 3/8 of the entire heap.
-XX:PermSize=128m 
-Xss256k 
Sets the stack size for each thread. After JDK5.0, the stack size of each thread is 1M, and the previous stack size of each thread is 256K. Adjust the memory size required by the threads of the application. In the same physical memory, reducing this value can generate more threads. However, the operating system still has a limit on the number of threads in a process, which cannot be generated indefinitely, and the experience value is around 3000 to 5000.
-XX:+ DisableExplicitGC prohibits calling System.gc(); but the gc of the jvm is still valid
 -XX:+ UseConcMarkSweepGC uses the concurrent mark-swap algorithm for GC for the old generation
 -XX:+ CMSParallelRemarkEnabled whether to enable parallelism
 -XX:+ UseCMSCompactAtFullCollection to open the pair Old generation compression. May affect performance, but can eliminate fragmentation
 -XX:LargePageSizeInBytes= 128m Set large page size for Java heap
 -XX:+ UseFastAccessorMethods Optimize getter method performance for primitive types
 -XX:+ UseCMSInitiatingOccupancyOnly
CMS has a dynamic checking mechanism.
Based on historical records, CMS predicts how long it will take for the old age to fill up and how long it will take to recycle.
CMS can automatically perform garbage collection based on its own predictions before the old generation space runs out.
This feature can be turned off with the parameter UseCMSInitiatingOccupancyOnly.

-XX:CMSInitiatingOccupancyFraction=70   CMS generation occupancy percentage to start CMS collection cycle

- is a standard parameter, all vm implementations must be functions that implement these parameters, and backwards
 - X is a non-standard parameter, all JVMs implement these parameters by default, but not all JVM implementations are guaranteed to be satisfied, and backwards are not guaranteed Compatible
 - XX non-Stable parameters, such parameters will be different for each jvm implementation and may be canceled at any time in the future

14. Copy files across servers
                                                                          Move-in server address Move-in server file placement path
scp -r reinsure-apache-tomcat-7.0.64 [email protected]:/app/java/reinsure-apache-tomcat
                       Move out the service name and move in the server user name (preferably not root)
                       
strong
10.100.8.227 jboss kmtA5OrSgij76fw
scp -r back [email protected]:/app/java/

15. Add activation parameters for local environment startupWhen running the project in the main class of the project, you need to add spring-boot:run -Drun.profiles= test 
to the runtime configuration information -run configurations

Maven starts the specified Profile via -P, such as mvn spring-boot:run -Ptest, but this is Maven's Profile.
If you want to specify spring.profiles.active for spring-boot, you have to use mvn spring-boot:run -Drun.profiles= test
If using the command line to run the jar file directly, use java -jar -Dspring.profiles.active=test demo-0.0.1- SNAPSHOT.jar
If you use development tools and run the Application.java file to start, add the parameter --spring.profiles.active=test

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324767916&siteId=291194637