springboot deploys linux server

1. Install jdk and configure environment variables
2. Install mysql
3. Modify the ip, database name, database name, and database password in the yml file
4. Clean first, then click package

5. Put the jar package into linux, such as /usr/
Insert image description here
Insert image description here
6. Run under local

nohup java -jar xx.jar > logName.log 2>&1 &

Insert image description here
Related explanations:
1. nohup: run commands without hanging up

2. logName.log: nohup redirects the command output to the specified "log file name.log" file in the current directory, that is, the output content is not printed to the screen, but output to "log file name.log" in the file. Not specifying a file name will create nohup.out in the current directory. If the nohup.out file in the current directory is not writable, the output is redirected to the $HOME/nohup.out file. The command specified by the Command parameter cannot be called if no file can be created or opened for appending.

3. 2>&1: 2 is standard error and 1 is standard output. Is this command equivalent to redirecting standard error to standard output? Here & is equivalent to standard error and standard output, that is, output standard error and standard output to the specified "log file name.log" file at the same time.

7. Close the operation
. Reference: https://editor.csdn.net/md/?articleId=111769008

8. The database link
Insert image description here
password is the password of the Linux database. After changing the password for the first time, you will be asked to change the password. Please refer to the method: https://blog.csdn.net/weixin_45875049/article/details/111769316

Guess you like

Origin blog.csdn.net/weixin_45875049/article/details/111769175