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