Jenkins automatically deploys the MAVEN +tomcat+linux Environment Java project and automatically deploys to the extranet __centos

Source: Internet
Author: User
Tags aliyun
Jenkins automatically deploys MAVEN +tomcat+linux environment Java project and automatically deploys to extranet Front

Some of the problem logs that Jenkins encountered on the CentOS system of Aliyun 1. Question one: Maven JVM terminated unexpectedly with exit code 137

When this problem occurs, indicating that the memory is not enough, start 2 Tomcat has taken up fast 1G memory, Aliyun 1G1 core is not enough, or add memory, or kill the process
The following figure is the memory I started with 2 tomcat:
2. Question two: When executing the shell script restart Tomcat, prompt "Neither the java_home nor the JRE_HOME environment variable is defined"

Encountered "Neither the java_home nor the JRE_HOME environment variable is defined" because Tomcat did not find the Java_home path when the script was started, the Java_ The home environment variable is added to Tomcat.
Note that it is not added to the catalina.sh, there is no suggestion to add the environment variable here, catalina.sh explicitly said "Do not set the variables in this script." Instead put them into a script
Setenv.sh in Catalina_base/bin to keep your customizations separate. "
So
Create a setenv.sh script file in the bin directory
You can add the following statement
java_home=/usr/java/jdk1.8.0_151
Java_jre=/usr/java/jdk1.8.0_151/jre

To solve these 2 problems, we can successfully start Jenkins.
question three: Modify the password of the Jenkins user

Enter the "/root/.jenkins/users/admin" directory, this is the Jenkins installation directory, users store Jenkins users, where you choose to modify the admin password.
Open the Forgotten Password User folder, which is a file config.xml. Open Config.xml found the PasswordHash node
Replace the contents of the PasswordHash node with

 

Save, restart Tomcat, log in
Name:admin
pwd:111111
Select this machine to save login status
We can get into the Jenkins interface.

The following is a command-line way to specify that the port starts Jenkins:
Java-jar jenkins.war–ajp13port=-1–httpport=8089

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.