In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to deploy a SpringBoot project to a cloud server". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to deploy a SpringBoot project to a cloud server".
1. Set the type of Maven packaging
This is set to the jar mode.
In my experience, packaging into war is a pit, you need to follow Tomcat, and you will encounter a lot of problems when you deploy for the first time.
Packaged as jar, there is no need to install Tomcat, a command java-jar codergroup-1.0.0-SNAPSHOT.jar can start the project.
2. Package SpringBoot project
I am using IntelliJ IDEA here, directly in the Maven plug-in, click package to package.
Then you can see it in the target of the project.
Upload the jar file to the server
Third, install MySQL and JDK
In order to facilitate the management of project files and maintenance pressure, I choose to install pagoda panels here.
MySQL5.5 is installed directly in the pagoda panel.
Then import the database
So the process of installing MySQL is not described here.
About the use of pagoda panels: see here
The installation of JDK requires only one command and there is no need to configure environment variables
Yum-y install java-1.8.0-openjdk*
IV. Start the project
We know that the start jar project command is the file name of java-jar jar
But this startup is the foreground startup, that is, when the command line window is closed, the project is closed.
So we need to start in the background, and the command is
Nohup java-jar codergroup-1.0.0-SNAPSHOT.jar > temp.txt &
Explain:
Nohup runs without hanging up.
> temp.txt writes the output from the command line to temp.text
& automatic operation
Let's look at the content in temp.txt, the project.
Thank you for your reading. The above is the content of "how to deploy the SpringBoot project to the CVM". After the study of this article, I believe you have a deeper understanding of how to deploy the SpringBoot project to the CVM, and the specific usage needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.