当前位置:网站首页>JT-day10

JT-day10

2020-11-09 19:11:00 LLL333

1、 Linux Project deployment instructions

1.1 Deployment flowchart

image.png

1.2 Linux install Mysql database

yum install mariadb-server install mariadb database
yum clean all Empty the installation file
Data activation :
Start command systemctl start mariadb
Restart command systemctl restart mariadb
The shutdown command systemctl stop mariadb
Database initialization operation
command : `mysql_secure_installation’
image.png
Linux visit Mysql database
image.png
Instructions for linking databases
explain :

  1. If you need to remotely link to the database, you have to go through the firewall
  2. If you link the database remotely , Remote access must be enabled in the database , Otherwise, reject the link .

Configuration database permissions configuration instructions
image.png
To configure Linux Database permissions
image.png
Switch Mysql database
image.png
Modify the database table
1). Check the data sheet
image.png
2). Inquire about user In the table host/root/password
image.png
3). take host=“localhost” Change it to "%"
image.png
4). Refresh database permissions
image.png
Check firewall status
command : firewall-cmd --state
image.png
Manually turn off the firewall
explain : Manually shut down the firewall by command
command :

1. systemctl stop firewalld.service   # close 
2. systemctl start firewalld.service  # Turn on 

service iptables restart

firewall-cmd --reload

1.3 modify jt-manage Configuration of

1.3.1 Modify the upload address of the picture

explain : stay Linux Directory specifies a directory where images are stored
image.png

1.3.2 Project packaging and release

image.png

1.3.3 Upload war Package file

image.png
Start the server
java -jar 8081.war
image.png
adopt IP You can visit the address
image.png

1.4 tomcat Cluster deployment

1、 You can use & operator Continue to execute commands

java -jar 8031.war & java -jar 8032.war & java -jar 8033.war &

1.4.1 How to shut down the server

ps -ef |grep java        see java Keyword process 
kill -9  Port number            Kill process 
JSP                      Retrieve only java service 

image.png

1、"|" The Conduit   The result of the previous query of the pipeline , As a parameter after the pipe ( Conditions ) To operate 
2、kill  Kill process 
   kill PID Number   Normal shutdown process ( Weak closing )
   kill -15 PID Number   Must close , But you can do the following 
   kill -9  PID Number   closed   No time for follow-up tasks 

image.png

1.4.2 About Linux Background start

explain : adopt java -jar 8033.war Way to start , It can only be performed at the front desk , If you close the linked terminal , Then the program will close with it , So it needs to be turned on Linux Background operation
command :

nohup java -jar 8031.war =>8031.log &
nohup java -jar 8032.war =>8032.log &
nohup java -jar 8033.war =>8033.log &

1.4.3 About view command learning

cat  Output all the contents of the file 
more  Output all the contents of the document , Paging output , Space for the next screen ,q sign out 
less  Usage and more identical , Only by PgUp、PgOn Key to control 
tail  Used to display the number after the file , Frequently used 
tail -10 nginx.conf  see nginx.conf Last 10 That's ok 
tail –f nginx.conf  Dynamic view log , It is convenient to view the new information in the log 
ctrl+c  End of view 

1.5 The script to start tomcat The server

explain :Linux The script in is generally used in shell Script
step :

1、 edit start.sh Script file for 
    vim start.sh         create a file 
    

2、 Specify the header of the script
image.png

3、 The content of the specified script
image.png

4、 Execute the script
image.png

版权声明
本文为[LLL333]所创,转载请带上原文链接,感谢