MySQL部署
[root@Services ~]
...
Total packages: 8,265
[root@Services ~]
...
Complete!
[root@Services ~]
[root@Services ~]
[root@Services ~]
[root@Services ~]
tcp LISTEN 0 70 *:33060 *:* users:(("mysqld",pid=6875,fd=22))
tcp LISTEN 0 128 *:3306 *:* users:(("mysqld",pid=6875,fd=25))
[root@Services ~]
[root@Services ~]
mysql> ALTER USER root@'localhost' IDENTIFIED BY 'Tarena';
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[root@Services ~]
mysql: [Warning] Using a password on the command line interface can be insecure.
--------------
mysql Ver 8.0.26 for Linux on x86_64 (Source distribution)
Connection id: 9
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.26 Source distribution
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4
UNIX socket: /var/lib/mysql/mysql.sock
Binary data as: Hexadecimal
Uptime: 2 min 0 sec
Threads: 2 Questions: 9 Slow queries: 0 Opens: 130 Flush tables: 3 Open tables: 46 Queries per second avg: 0.075
--------------
[root@Services ~]
[root@Services ~]
mysql> CREATE DATABASE his;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'his'@'192.168.88.60' IDENTIFIED BY 'hisadmin';
Query OK, 0 rows affected (0.01 sec)
mysql> GRANT ALL ON his.* TO 'his'@'192.168.88.60';
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW GRANTS FOR 'his'@'192.168.88.60';
+----------------------------------------------------------+
| Grants for [email protected] |
+----------------------------------------------------------+
| GRANT USAGE ON *.* TO `his`@`192.168.88.60` |
| GRANT ALL PRIVILEGES ON `his`.* TO `his`@`192.168.88.60` |
+----------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> exit
Bye
[root@Services ~]
[root@Services ~]
his.sql
[root@Services ~]
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@Services ~]
mysql: [Warning] Using a password on the command line interface can be insecure.
+----------------------------------+
| Tables_in_his |
+----------------------------------+
| bms_bills_record |
| bms_invoice_exp |
| bms_invoice_record |
| bms_operator_settle_record |
| bms_settlement_cat |
| dms_case_history |
| dms_case_model |
| dms_case_model_catalog |
| dms_dise |
| dms_dise_catalog |
| dms_dosage |
| dms_drug |
| dms_drug_model |
| dms_drug_refund_item_record |
| dms_herbal_item_record |
| dms_herbal_model_item |
| dms_herbal_prescription_record |
| dms_medicine_item_record |
| dms_medicine_model_item |
| dms_medicine_prescription_record |
| dms_non_drug |
| dms_non_drug_item_record |
| dms_non_drug_model |
| dms_registration |
| pms_patient |
| sms_dept |
| sms_description |
| sms_frequent_used |
| sms_login_log |
| sms_permission |
| sms_registration_rank |
| sms_role |
| sms_role_permission_relation |
| sms_skd |
| sms_skd_rule |
| sms_skd_rule_item |
| sms_staff |
| sms_workload_record |
+----------------------------------+
Redis部署
[root@Services ~]
[root@Services ~]
[root@Services ~]
bind 0.0.0.0
protected-mode no
requirepass hisadmin
[root@Services ~]
[root@Services ~]
[root@Services ~]
tcp LISTEN 0 128 0.0.0.0:6379 0.0.0.0:* users:(("redis-server",pid=7839,fd=6))
[root@Services ~]
Jenkins全局工具配置
配置JDK
配置Git
配置Maven工具
[root@Jenkins ~]
apache-maven-3.6.3-bin.tar.gz
[root@Jenkins ~]
[root@Jenkins ~]
[root@Jenkins ~]
bin boot conf lib LICENSE NOTICE README.txt
[root@Jenkins ~]
[root@Jenkins ~]
[root@Jenkins ~]
export MAVEN_HOME="/usr/local/maven/"
export PATH=${MAVEN_HOME}/bin/:$PATH
[root@Jenkins ~]
[root@Jenkins ~]
/usr/local/maven/
[root@Jenkins ~]
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/maven
Java version: 11.0.15, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.15.0.9-2.el8_5.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.18.0-372.9.1.el8.x86_64", arch: "amd64", family: "unix"
[root@Jenkins ~]
[root@Jenkins ~]
repository.tar.gz
[root@Jenkins ~]
[root@Jenkins ~]
repository
[root@Jenkins ~]
aopalliance classworlds commons-beanutils commons-io de joda-time net
backport-util-concurrent cn commons-codec commons-lang io junit org
ch com commons-collections commons-logging javax mysql
配置邮件工具
[root@Jenkins ~]
[root@Jenkins ~]
[root@Jenkins ~]
tcp LISTEN 0 100 127.0.0.1:25 0.0.0.0:* users:(("master",pid=1203,fd=13))
tcp LISTEN 0 100 [::1]:25 [::]:* users:(("master",pid=1203,fd=14))
[root@Jenkins ~]
Complete!
[root@Jenkins ~]
Heirloom Mail version 12.5 7/5/10. Type ? for help.
"/var/mail/root": 1 message 1 new
>N 1 没有配置邮箱地址 Fri Feb 24 12:04 18/640 "Test email #4"
& 1
Message 1:
From nobody@nowhere Fri Feb 24 12:04:20 2023
Return-Path: <nobody@nowhere>
X-Original-To: root
Delivered-To: [email protected]
Date: Fri, 24 Feb 2023 12:04:20 +0800 (CST)
From: 没有配置邮箱地址 <nobody@nowhere>
To: [email protected]
Subject: Test email
Content-Type: text/plain; charset=UTF-8
Status: R
This is test email
& quit
Held 1 message in /var/mail/root
Jenkins后端工程构建
clean package -Dmaven.test.skip=true
[root@Jenkins ~]
HIS-BACKEND HIS-FONTEND
[root@Jenkins ~]
HIS-api HIS-common HIS-demo HIS-mbg HIS-service pom.xml
[root@Jenkins ~]
mvnw mvnw.cmd pom.xml src target
[root@Jenkins ~]
classes generated-sources HIS-api-1.0-SNAPSHOT.jar HIS-api-1.0-SNAPSHOT.jar.original maven-archiver maven-status
[root@Jenkins ~]
[root@Jenkins ~]
Jenkins后端自动发布
HIS-BACKEND工程配置自动发布
Backend主机部署
部署OpenJDK环境
[root@Backend ~]
...
Total packages: 8,265
[root@Backend ~]
[root@Backend ~]
[root@Backend ~]
[root@Backend ~]
export JAVA_HOME="/usr/lib/jvm/jdk/"
export PATH=${JAVA_HOME}/bin/:$PATH
export CLASSPATH=.
[root@Backend ~]
[root@Backend ~]
/usr/lib/jvm/jdk/
[root@Backend ~]
openjdk version "1.8.0_332"
OpenJDK Runtime Environment (build 1.8.0_332-b09)
OpenJDK 64-Bit Server VM (build 25.332-b09, mixed mode)
[root@Backend ~]
部署jar包运行配置文件
[root@Backend ~]
[root@Backend ~]
application-prod.yml 100% 2690 912.9KB/s 00:00
application.yml 100% 257 374.1KB/s 00:00
[root@Backend ~]
application-prod.yml application.yml
HIS-BACKEND工程自动发布测试
[root@Jenkins ~]
/var/lib/jenkins/workspace/HIS-BACKEND/HIS-api/target/HIS-api-1.0-SNAPSHOT.jar
[root@Jenkins ~]
[root@Backend ~]
application-prod.yml application.yml HIS-api-1.0-SNAPSHOT.jar
[root@Backend ~]
[root@Backend his]
/opt/his/.
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.3.RELEASE)
...
2023-02-24 13:00:24.881 INFO 9629 --- [ main] com.neu.his.HisApiApplication : Started HisApiApplication in 13.82 seconds (JVM running for 14.352)
[root@Backend ~]
tcp LISTEN 0 100 *:8888 *:* users:(("java",pid=9629,fd=63))
[root@Backend ~]
[root@Backend ~]
<!DOCTYPE html>
<html lang="cn">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h1>HIS</h1>
</body>
</html>[root@Backend ~]
{"status":"UP","details":{"rabbit":{"status":"UP","details":{"version":"3.11.5"}},"diskSpace":{"status":"UP","details":{"total":10725883904,"free":8431407104,"threshold":10485760}},"db":{"status":"UP","details":{"database":"MySQL","hello":1}},"elasticsearch":{"status":"UP","details":{"clusterName":"elasticsearch","numberOfNodes":1,"numberOfDataNodes":1,"activePrimaryShards":22,"activeShards":22,"relocatingShards":0,"initializingShards":0,"unassignedShards":20}},"elasticsearchRest":{"status":"UP","details":{"cluster_name":"elasticsearch","status":"yellow","timed_out":false,"number_of_nodes":1,"number_of_data_nodes":1,"active_primary_shards":22,"active_shards":22,"relocating_shards":0,"initializing_shards":0,"unassigned_shards":20,"delayed_unassigned_shards":0,"number_of_pending_tasks":0,"number_of_in_flight_fetch":0,"task_max_waiting_in_queue_millis":0,"active_shards_percent_as_number":52.38095238095239}},"redis":{"status":"UP","details":{"version":"5.0.3"}}}}
HIS项目展示
[root@Fontend ~]
[root@Fontend ~]
server {
listen 80 default_server;
server_name __;
location / {
root "/opt/his/web/";
index index.html index.htm;
}
location /prod-api/ {
proxy_pass http://192.168.88.60:8888/;
}
}
[root@Fontend ~]
[root@Fontend ~]
tcp LISTEN 0 128 0.0.0.0:80 0.0.0.0:* users:(("nginx",pid=952,fd=6),("nginx",pid=951,fd=6),("nginx",pid=950,fd=6))