8.21-部署eleme项目

1.设置主从从mysql57服务器

(1)配置主数据库

  [root@msater_5 ~]# systemctl stop firewalld[root@msater_5 ~]# setenforce 0[root@msater_5 ~]# systemctl disable firewalldRemoved symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.[root@msater_5 ~]# lsanaconda-ks.cfg  mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz[root@msater_5 ~]# tar -xf mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz [root@msater_5 ~]# lsanaconda-ks.cfg                      mysql-5.7.44-linux-glibc2.12-x86_64.tar.gzmysql-5.7.44-linux-glibc2.12-x86_64[root@msater_5 ~]# cp -r mysql-5.7.44-linux-glibc2.12-x86_64 /usr/local/mysql[root@msater_5 ~]# rm -rf /etc/my.cnf[root@msater_5 ~]# mkdir /usr/local/mysql/mysql-files[root@msater_5 ~]# useradd -r -s /sbin/nologin mysql[root@msater_5 ~]# chown mysql:mysql /usr/local/mysql/mysql-files/[root@msater_5 ~]# chown 750 /usr/local/mysql/mysql-files/[root@msater_5 ~]# /usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql2024-08-21T09:39:14.991434Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2024-08-21T09:39:15.126969Z 0 [Warning] InnoDB: New log files created, LSN=457902024-08-21T09:39:15.150963Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.2024-08-21T09:39:15.214887Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 3ac52ccc-5fa1-11ef-98a1-000c29374e2c.2024-08-21T09:39:15.215926Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2024-08-21T09:39:16.034519Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.2024-08-21T09:39:16.034537Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.2024-08-21T09:39:16.036321Z 0 [Warning] CA certificate ca.pem is self signed.2024-08-21T09:39:16.384066Z 1 [Note] A temporary password is generated for root@localhost: RV3DtuxCi;A-[root@msater_5 ~]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql57[root@msater_5 ~]# vim /usr/local/mysql/my.cnf​[mysqld]basedir=/usr/local/mysqldatadir=/usr/local/mysql/datasocket=/tmp/mysql.sockport=3306log-error=/usr/local/mysql/data/db01-master.errlog-bin=/usr/local/mysql/data/binlogserver-id=10character_set_server=utf8mb4​​[root@msater_5 ~]# service mysql57 startStarting MySQL.Logging to '/usr/local/mysql/data/db01-master.err'.SUCCESS! ​[root@msater_5 ~]# /usr/local/mysql/bin/mysql -pEnter password: ​mysql> alter user 'root'@'localhost' identified by 'root';Query OK, 0 rows affected (0.00 sec)​mysql> create user 'zzz'@'%' identified by 'zzz';Query OK, 0 rows affected (0.00 sec)​mysql> grant all on *.* to 'zzz'@'%';Query OK, 0 rows affected (0.01 sec)​​mysql> flush privileges;Query OK, 0 rows affected (0.01 sec)​mysql> create user 'slave'@'%' identified by 'slave';Query OK, 0 rows affected (0.00 sec)​mysql> grant replication slave on *.* to 'slave'@'%';Query OK, 0 rows affected (0.00 sec)​mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)​

(2)配置slave01数据库

  [root@slave01_5 ~]# lsanaconda-ks.cfg  mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz[root@slave01_5 ~]# systemctl stop firewalld[root@slave01_5 ~]# systemctl disable firewalldRemoved symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.[root@slave01_5 ~]# setenforce 0[root@slave01_5 ~]# tar -xf mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz [root@slave01_5 ~]# cp -r mysql-5.7.44-linux-glibc2.12-x86_64 /usr/local/mysql[root@slave01_5 ~]# rm -rf /etc/my.cnf[root@slave01_5 ~]# mkdir /usr/local/mysql/mysql-files[root@slave01_5 ~]# useradd -r -s /sbin/nologin mysql[root@slave01_5 ~]# chown mysql:mysql /usr/local/mysql/mysql-files/[root@slave01_5 ~]# chown 750 /usr/local/mysql/mysql-files/[root@slave01_5 ~]# yum -y install rsync

(3)配置slave02数据库

  [root@slave02_5 ~]# lsanaconda-ks.cfg  mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz[root@slave02_5 ~]# scp mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz 192.168.2.57:/rootThe authenticity of host '192.168.2.57 (192.168.2.57)' can't be established.ECDSA key fingerprint is SHA256:E2ARFFif/HyOpjlCgDRoPqYSl2OL4PwdcX1h9cPRJiY.ECDSA key fingerprint is MD5:35:b0:cd:3b:e0:fa:10:4a:22:5e:94:aa:b7:5c:e2:79.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '192.168.2.57' (ECDSA) to the list of known hosts.root@192.168.2.57's password: mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz          100%  663MB  85.5MB/s   00:07    [root@slave02_5 ~]# scp mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz 192.168.2.58:/rootThe authenticity of host '192.168.2.58 (192.168.2.58)' can't be established.ECDSA key fingerprint is SHA256:E2ARFFif/HyOpjlCgDRoPqYSl2OL4PwdcX1h9cPRJiY.ECDSA key fingerprint is MD5:35:b0:cd:3b:e0:fa:10:4a:22:5e:94:aa:b7:5c:e2:79.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '192.168.2.58' (ECDSA) to the list of known hosts.root@192.168.2.58's password: mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz          100%  663MB  83.1MB/s   00:07    [root@slave02_5 ~]# systemctl stop firewalld[root@slave02_5 ~]# systemctl disable firewalld​[root@slave02_5 ~]# setenforce 0[root@slave02_5 ~]# tar -xf mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz [root@slave02_5 ~]# cp -r mysql-5.7.44-linux-glibc2.12-x86_64 /usr/local/mysql[root@slave02_5 ~]# rm -rf /etc/my.cnf[root@slave02_5 ~]# mkdir /usr/local/mysql/mysql-files[root@slave02_5 ~]# useradd -r -s /sbin/nologin mysql[root@slave02_5 ~]# chown mysql:mysql /usr/local/mysql/mysql-files/[root@slave02_5 ~]# chown 750 /usr/local/mysql/mysql-files/[root@slave02_5 ~]# yum -y install rsync​

(4)同步data

  [root@msater_5 ~]# service mysql57 stopShutting down MySQL.... SUCCESS! [root@msater_5 ~]# rm -rf /usr/local/mysql/data/auto.cnf[root@msater_5 ~]# yum -y install rsync​[root@msater_5 ~]# rsync -av /usr/local/mysql/data root@192.168.2.58:/usr/local/mysql/​[root@msater_5 ~]# rsync -av /usr/local/mysql/data root@192.168.2.59:/usr/local/mysql/

(5)修改slave01配置文件

  [root@slave01_5 ~]# ls /usr/local/mysql/bin   docs     lib      man          README  support-filesdata  include  LICENSE  mysql-files  share[root@slave01_5 ~]# vim /usr/local/mysql/my.cnf​[mysqld]basedir=/usr/local/mysqldatadir=/usr/local/mysql/datasocket=/tmp/mysql.sockport=3306log-error=/usr/local/mysql/data/err.logrelay-log=/usr/local/mysql/data/relaylogcharacter_set_server=utf8mb4server-id=11​[root@slave01_5 ~]# cp /usr/local/mysql/support-files/mysql.server  /etc/init.d/mysql57[root@slave01_5 ~]# sed -i '$aexport PATH=$PATH:/usr/local/mysql/bin' /etc/profile[root@slave01_5 ~]# source /etc/profile​

(6)修改slave02配置文件

  [root@slave02_5 ~]# ls /usr/local/mysqlbin   docs     lib      man          README  support-filesdata  include  LICENSE  mysql-files  share[root@slave02_5 ~]# vim /usr/local/mysql/my.cnf​[mysqld]basedir=/usr/local/mysqldatadir=/usr/local/mysql/datasocket=/tmp/mysql.sockport=3306log-error=/usr/local/mysql/data/err.logrelay-log=/usr/local/mysql/data/relaylogcharacter_set_server=utf8mb4server-id=12[root@slave02_5 ~]# cp /usr/local/mysql/support-files/mysql.server  /etc/init.d/mysql57[root@slave02_5 ~]# sed -i '$aexport PATH=$PATH:/usr/local/mysql/bin' /etc/profile[root@slave02_5 ~]# source /etc/profile​

(7)主服务器锁表

  [root@msater_5 ~]# mysql -prootmysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 3Server version: 5.7.44-log MySQL Community Server (GPL)​Copyright (c) 2000, 2023, Oracle and/or its affiliates.​Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.​Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.​mysql> select user,host from mysql.user;+---------------+-----------+| user          | host      |+---------------+-----------+| slave         | %         || zzz           | %         || mysql.session | localhost || mysql.sys     | localhost || root          | localhost |+---------------+-----------+5 rows in set (0.00 sec)​mysql> flush tables with read lock;Query OK, 0 rows affected (0.00 sec)​mysql> show master status;+---------------+----------+--------------+------------------+-------------------+| File          | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |+---------------+----------+--------------+------------------+-------------------+| binlog.000002 |      154 |              |                  |                   |+---------------+----------+--------------+------------------+-------------------+1 row in set (0.00 sec)

(8)配置主从服务

  [root@slave01_5 ~]# mysql -uroot -prootmysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.7.44 MySQL Community Server (GPL)​Copyright (c) 2000, 2023, Oracle and/or its affiliates.​Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.​Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.​mysql>  change master to master_host="192.168.2.57",master_user="slave",master_password="slave",master_log_file="binlog.000002",master_log_pos=154;Query OK, 0 rows affected, 2 warnings (0.01 sec)​mysql> start slave;Query OK, 0 rows affected (0.01 sec)​mysql> show slave status\G;*************************** 1. row ***************************Slave_IO_State: Waiting for master to send eventMaster_Host: 192.168.2.57Master_User: slaveMaster_Port: 3306Connect_Retry: 60Master_Log_File: binlog.000002Read_Master_Log_Pos: 154Relay_Log_File: relaylog.000002Relay_Log_Pos: 317Relay_Master_Log_File: binlog.000002Slave_IO_Running: YesSlave_SQL_Running: Yes​

(9)配置主从从服务

  [root@slave02_5 ~]# mysql -proot​mysql> change master to master_host="192.168.2.57",master_user="slave",master_password="slave",master_log_file="binlog.000002",master_log_pos=154;Query OK, 0 rows affected, 2 warnings (0.01 sec)​mysql> start slave;Query OK, 0 rows affected (0.01 sec)​mysql> show slave status\G;*************************** 1. row ***************************Slave_IO_State: Waiting for master to send eventMaster_Host: 192.168.2.57Master_User: slaveMaster_Port: 3306Connect_Retry: 60Master_Log_File: binlog.000002Read_Master_Log_Pos: 154Relay_Log_File: relaylog.000002Relay_Log_Pos: 317Relay_Master_Log_File: binlog.000002Slave_IO_Running: YesSlave_SQL_Running: Yes​

2.在mysql中添加eleme数据库设置为utf8mb4

  [root@msater_5 ~]# mysql -proot​mysql> unlock tables;Query OK, 0 rows affected (0.00 sec)​mysql> create database if not exists eleme charset utf8mb4;Query OK, 1 row affected (0.00 sec)​mysql> show databases;+--------------------+| Database           |+--------------------+| information_schema || eleme              || mysql              || performance_schema || sys                || test               |+--------------------+6 rows in set (0.00 sec)

3.添加表t_user(master)

  mysql> use eleme;Database changed​mysql> create table t_user(-> id int primary key auto_increment,-> name varchar(45) not null,-> username varchar(45) not null,-> password varchar(45) not null,-> remark varchar(45)-> );Query OK, 0 rows affected (0.01 sec)​mysql> show tables;+-----------------+| Tables_in_eleme |+-----------------+| t_user          |+-----------------+1 row in set (0.00 sec)

4.添加2行记录(master)

  mysql> insert into t_user (id,name,username,password,remark)values(1,"超级管理员","adm"in","admin","超级管理员");Query OK, 1 row affected (0.01 sec)​mysql> insert into t_user (id,name,username,password,remark)values(2,"普通用户","guest,","guest","普通用户");Query OK, 1 row affected (0.00 sec)​mysql> select * from t_user;+----+-----------------+----------+----------+-----------------+| id | name            | username | password | remark          |+----+-----------------+----------+----------+-----------------+|  1 | 超级管理员      | admin    | admin    | 超级管理员      ||  2 | 普通用户        | guest    | guest    | 普通用户        |+----+-----------------+----------+----------+-----------------+2 rows in set (0.00 sec)​

5.远程登录工具查看表数据:

6.使用mycat为三台数据库设置负载均衡(读写分离)

(1)前期环境部署

  [root@mycat ~]# lsanaconda-ks.cfg             Mycat-server-1.6.5-release-20180122220033-linux.tar.gzjdk-8u192-linux-x64.tar.gz[root@mycat ~]# tar -xf jdk-8u192-linux-x64.tar.gz [root@mycat ~]# tar -xf Mycat-server-1.6.5-release-20180122220033-linux.tar.gz [root@mycat ~]# cp -r jdk1.8.0_192/ /usr/local/jdk[root@mycat ~]# cp -r mycat/ /usr/local/mycat[root@mycat ~]# sed -i '$aexport JAVA_HOME=/usr/local/jdk' /etc/profile[root@mycat ~]# source /etc/profile[root@mycat ~]# sed -i '$aexport PATH=$PATH:$JAVA_HOME/bin' /etc/profile[root@mycat ~]# source /etc/profile[root@mycat ~]# javac -versionjavac 1.8.0_192[root@mycat ~]#  /usr/local/mycat/bin/mycat console

(2)修改server.xml配置文件

  [root@mycat ~]# vim /usr/local/mycat/conf/server.xml​93         <user name="haha" defaultAccount="true">94                 <property name="password">haha</property>95                 <property name="schemas">eleme</property>​# 注释​107 <!--108         <user name="user">109                 <property name="password">user</property>110                 <property name="schemas">TESTDB</property>111                 <property name="readOnly">true</property>112         </user>113 -->​

(3)修改schema.xml 配置文件

1.设置schema标签 添加dataNode="xxx" name=eleme

2.修改dataHost标签

  [root@mycat ~]# vim /usr/local/mycat/conf/schema.xml 1 <?xml version="1.0"?>2 <!DOCTYPE mycat:schema SYSTEM "schema.dtd">3 <mycat:schema xmlns:mycat="http://io.mycat/">4 5         <schema name="eleme" dataNode="dn1" checkSQLschema="false" sqlMaxLimit="10    0"> 6         </schema>7         <!-- <dataNode name="dn1$0-743" dataHost="localhost1" database="db$0-743"8                 /> -->9         <dataNode name="dn1" dataHost="localhost1" database="eleme" />10 <!--    <dataNode name="dn2" dataHost="localhost1" database="db2" />11         <dataNode name="dn3" dataHost="localhost1" database="db3" />-->12         <!--<dataNode name="dn4" dataHost="sequoiadb1" database="SAMPLE" />13          <dataNode name="jdbc_dn1" dataHost="jdbchost" database="db1" />14         <dataNode       name="jdbc_dn2" dataHost="jdbchost" database="db2" />15         <dataNode name="jdbc_dn3"       dataHost="jdbchost" database="db3" /> -->16         <dataHost name="localhost1" maxCon="1000" minCon="10" balance="0" 17                           writeType="0" dbType="mysql" dbDriver="native" switchTyp    e="1"  slaveThreshold="100">18                 <heartbeat>select user()</heartbeat>19                 <!-- can have multi write hosts -->20                 <writeHost host="hostM1" url="192.168.2.57:3306" user="haha"21                                    password="haha">22                         <!-- can have multi read hosts --> 23                         <readHost host="hostS2" url="192.168.2.58:3306" user="haha    " password="haha" /> 24                         <readHost host="hostS3" url="192.168.2.59:3306" user="haha    " password="haha" />25                 </writeHost>26 <!--27                 <writeHost host="hostS1" url="localhost:3316" user="root"28                                    password="123456" />29 -->          30                 <!-- <writeHost host="hostM2" url="localhost:3316" user="root" pas    sword="123456"/> -->31         </dataHost>​

(4)启动服务

  [root@mycat ~]# /usr/local/mycat/bin/mycat startStarting Mycat-server...[root@mycat ~]# netstat -lntup | grep 8066tcp6       0      0 :::8066                 :::*                    LISTEN      1916/j

7.客户端测试mycat

  [root@client ~]# cd /usr/local/mysql/bin[root@client bin]# ./mysql -h192.168.2.19 -P8066 -uhaha -phahamysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 83Server version: 5.6.29-mycat-1.6.5-release-20180122220033 MyCat Server (OpenCloundDB)​Copyright (c) 2000, 2023, Oracle and/or its affiliates.​Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.​Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.​mysql> show databases;+----------+| DATABASE |+----------+| eleme    |+----------+1 row in set (0.01 sec)​mysql> use eleme;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -A​Database changedmysql> show tables;+-----------------+| Tables_in_eleme |+-----------------+| t_user          |+-----------------+1 row in set (0.01 sec)​mysql> select * from t_user;+----+-----------------+----------+----------+-----------------+| id | name            | username | password | remark          |+----+-----------------+----------+----------+-----------------+|  1 | 超级管理员      | admin    | admin    | 超级管理员      ||  2 | 普通用户        | guest    | guest    | 普通用户        |+----+-----------------+----------+----------+-----------------+2 rows in set (0.01 sec)​mysql> ​

8.部署java17环境

(1)java01

  [root@java01 ~]# lsanaconda-ks.cfg  jdk-17_linux-x64_bin.tar.gz [root@java01 ~]# tar -xf jdk-17_linux-x64_bin.tar.gz [root@java01 ~]# lsanaconda-ks.cfg  jdk-17.0.12  jdk-17_linux-x64_bin.tar.gz [root@java01 ~]# cp -r jdk-17.0.12/ /usr/local/jdk[root@java01 ~]# vim /etc/profileexport JAVA_HOME=/usr/local/jdkexport PATH=$PATH:$JAVA_HOME/bin[root@java01 ~]# source /etc/profile​[root@java01 ~]# javac --versionjavac 17.0.12​[root@java01 ~]# firewall-cmd --add-port=8080/tcp --permanentsuccess[root@java01 ~]# firewall-cmd --reloadsuccess​[root@java01 ~]# lsanaconda-ks.cfg  application_(1).yml  eleme_server-0.0.1-SNAPSHOT.jar  jdk-17.0.12  jdk-17_linux-x64_bin.tar.gz​[root@java01 ~]# mv application_\(1\).yml application.yml [root@java01 ~]# lsanaconda-ks.cfg  application.yml  eleme_server-0.0.1-SNAPSHOT.jar  jdk-17.0.12  jdk-17_linux-x64_bin.tar.gz​​[root@java01 ~]# vim application.yml ​server:port: 8080spring:datasource:driver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://192.168.2.19:8066/elemeusername: hahapassword: haha​[root@java01 ~]# java -jar eleme_server-0.0.1-SNAPSHOT.jar ​

(2)浏览器访问:192.168.2.11:8080

(3)java02

  [root@java02 ~]# lsanaconda-ks.cfg  eleme_server-0.0.1-SNAPSHOT.jar  jdk-17_linux-x64_bin.tar.gzapplication.yml  ​[root@java02 ~]# tar -xf jdk-17_linux-x64_bin.tar.gz ​[root@java02 ~]# cp -r jdk-17.0.12/ /usr/local/jdk[root@java02 ~]# vim /etc/profile[root@java02 ~]# source /etc/profile[root@java02 ~]# javac -versionjavac 17.0.12​[root@java02 ~]# vim application.yml ​server:port: 8080spring:datasource:driver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://192.168.2.19:8066/elemeusername: hahapassword: haha​[root@java02 ~]# java -jar eleme_server-0.0.1-SNAPSHOT.jar ​

(4)浏览器访问:192.168.2.12:8080

9.部署LVS-nat模式

(1)lvs

  [root@lvs ~]# ifconfig ens33:0 192.168.2.150 broadcast 192.168.2.121 netmask 255.255.255.255 up[root@lvs ~]# route add -host 192.168.2.150 dev ens33:0[root@lvs ~]# yum -y install ipvsadm[root@lvs ~]# ipvsadm -C[root@lvs ~]# ipvsadm -A -t 192.168.2.150:8080 -s rr[root@lvs ~]# ipvsadm -a -t 192.168.2.150:8080 -r 192.168.2.11 -g[root@lvs ~]# ipvsadm -a -t 192.168.2.150:8080 -r 192.168.2.12 -g[root@lvs ~]# systemctl stop firewalld[root@lvs ~]# systemctl disable firewalldRemoved symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.[root@lvs ~]# setenforce 0[root@lvs ~]# systemctl stop firewalld[root@lvs ~]# ipvsadm -LnIP Virtual Server version 1.2.1 (size=4096)Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port           Forward Weight ActiveConn InActConnTCP  192.168.2.150:8080 rr-> 192.168.2.11:8080            Route   1      0          1         -> 192.168.2.12:8080            Route   1      0          1         

(2)java01

  [root@java01 ~]# ifconfig lo:0 192.168.2.150 broadcast 192.168.2.150 netmask 255.255.255.255 up[root@java01 ~]# route add -host 192.168.2.150 dev lo:0[root@java01 ~]# vim arp.sh[root@java01 ~]# source arp.sh​

(3)java02

  [root@java02 ~]# ifconfig lo:0 192.168.2.150 broadcast 192.168.2.150 netmask 255.255.255.255 up[root@java02 ~]# route add -host 192.168.2.150 dev lo:0[root@java02 ~]# vim arp.sh[root@java02 ~]# source arp.sh​

(4)浏览器访问:192.168.2.150:8080(外网地址)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/52169.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

使用 Fyne 构建 GUI 应用:设置标签文本和自增计数器

引言 Fyne 是一个用 Go 语言编写的跨平台 GUI 框架&#xff0c;它提供了一套丰富的组件来帮助开发者快速构建出漂亮的用户界面。在本文中&#xff0c;我们将通过一个简单的案例来演示如何使用 Fyne 创建 GUI 应用程序&#xff0c;该程序包含设置标签文本和自增计数器的功能。 …

「字符串」前缀函数|KMP匹配:规范化next数组 / LeetCode 28(C++)

目录 概述 思路 核心概念&#xff1a;前缀函数 1.前缀函数 2.next数组 1.考研版本 2.竞赛版本 算法过程 构建next数组 匹配过程 复杂度 Code 概述 为什么大家总觉得KMP难&#xff1f;难的根本就不是这个算法本身。 在互联网上你可以见到八十种KMP算法的next数组…

项目1 物流仓库管理系统

一、项目概述 本项目旨在开发一个功能全面的物流仓库管理系统&#xff0c;以数字化手段优化仓库作业流程&#xff0c;提高管理效率。系统集成了前端用户交互界面与后端数据处理逻辑&#xff0c;涵盖了从用户注册登录、订单管理、货单跟踪到用户信息维护等多个核心业务模块。通…

基于django的学生作业提交与管理系统,有管理后台,可作为课设使用

在本项目中&#xff0c;我们设计并实现了一个基于Django框架的学生作业提交与管理系统&#xff0c;旨在为教师和学生提供一个高效、便捷的作业管理平台。Django作为一个高效的Web框架&#xff0c;因其强大的功能和灵活的架构&#xff0c;使得本系统能够快速开发并扩展。 系统功…

Maven的简单使用

Maven使用 Maven的作用1. 自动构建标准化的java项目结构(1) 项目结构① 约定目录结构的意义② 约定大于配置 (2)项目创建坐标坐标的命名方法&#xff08;约定&#xff09; 2. 帮助管理java中jar包的依赖(1) 配置使用依赖引入属性配置 (2) maven指令(3) 依赖的范围(4) 依赖传递(…

【密码学】密钥管理:②密钥分配

一、密钥分配的定义 密钥分配是密钥管理生命周期中最重要的部分&#xff0c;密钥分配方案研究的是密码系统中密钥的分发和传送问题。从本质上讲&#xff0c;密钥分配为通信双方建立用于信息加密、解密签名等操作的密钥&#xff0c;以实现保密通信或认证签名等。 &#xff08;1…

win10蓝牙只能发送,无法接收

给win10升了级&#xff0c;到22H2&#xff0c;蓝牙出了问题 以前接收&#xff0c;就是默认直接就可以接收。现在只能发送&#xff0c;无法接收。 在网上找了很多办法都没奏效&#xff0c;目前的方法是&#xff0c; 每次接收&#xff0c;都要操作一次&#xff0c;而不是自动接…

leetcode-538. 把二叉搜索树转换为累加树

题目描述 给出二叉 搜索 树的根节点&#xff0c;该树的节点值各不相同&#xff0c;请你将其转换为累加树&#xff08;Greater Sum Tree&#xff09;&#xff0c;使每个节点 node 的新值等于原树中大于或等于 node.val 的值之和。 提醒一下&#xff0c;二叉搜索树满足下列约束…

计量自动化终端上行通信规约

物理层 TCP 和 UDP 的传输接口 该类接口的登录链接和心跳检测采用链路测试服务&#xff0c;链路测试周期可设定。 参见 TCP/IP 协议规范。 串行通信传输接口 字节传输按异步方式进行&#xff0c;它包含 8 个数据位、1 个起始位“0”、1 个偶校验位 P 和 1 个停止位“1”。 …

Android Studio 动态表格显示效果

最终效果 一、先定义明细的样式 table_row.xml <?xml version"1.0" encoding"utf-8"?> <RelativeLayout xmlns:android"http://schemas.android.com/apk/res/android"android:layout_width"match_parent"android:layout_h…

集团数字化转型方案(四)

集团数字化转型方案通过全面部署人工智能&#xff08;AI&#xff09;、大数据分析、云计算和物联网&#xff08;IoT&#xff09;技术&#xff0c;创建了一个智能化的企业运营平台&#xff0c;涵盖从业务流程自动化、实时数据监控、精准决策支持&#xff0c;到个性化客户服务和高…

实验七:独立按键实验

硬件电路图和题目; LED1-LD8是 P2口8个管脚 mian.c #include<reg52.h>sbit But1=P3^1 ; sbit But2=P3^0 ; sbit But3=P3^2 ; sbit But4=P3^3 ;sbit LED1 =P2^0 ; sbit LED2 =P2^1 ; sbit LED3 =P2^2 ; sbit LED4 =P2^3 ;#define PRESS_1 1 #define PRESS_…

CUTLASS 中的 47_ampere_gemm_universal_streamk 示例

前一篇文章介绍了 Stream-K: Work-centric Parallel Decomposition for Dense Matrix-Matrix Multiplication on the GPU 论文&#xff0c;下面对其代码实现进行分析。 cutlass 的 examples/47_ampere_gemm_universal_streamk 展示了 GEMM Stream-K 算法在 Ampere 架构上的使用…

JNPF 5.0升级钜惠,感恩回馈永远在路上

尊敬的JNPF用户们&#xff1a; 经过引迈团队数月的辛勤努力和不断的技术创新&#xff0c;JNPF快速开发平台迎来全新升级——5.0版本&#xff01;此次5.0版本的迭代革新&#xff0c;不仅代表着我们技术实力的进一步提升&#xff0c;是我们对用户需求的深度理解和积极回应。为了…

基于C# winform部署图像动漫化AnimeGANv2部署onnx模型

【界面截图】 【效果演示】 【部分实现代码】 using System; using System.Diagnostics; using System.Windows.Forms; using OpenCvSharp;namespace FIRC {public partial class Form1 : Form{Mat src null;public Form1(){InitializeComponent();}private void button1_Cli…

html+css+js网页设计 天猫首页

htmlcssjs网页设计 天猫首页 网页作品代码简单&#xff0c;可使用任意HTML编辑软件&#xff08;如&#xff1a;Dreamweaver、HBuilder、Vscode 、Sublime 、Webstorm、Text 、Notepad 等任意html编辑软件进行运行及修改编辑等操作&#xff09;。 获取源码 1&#xff0c;访问…

git本地仓库同步到远程仓库

整个过程分为如下几步&#xff1a; 1、本地仓库的创建 2、远程仓库的创建 3、远程仓库添加key 4、同步本地仓库到远程仓库 1、本地仓库的创建&#xff1a; 使用如下代码创建本地仓库&#xff1a; echo "# test" >> README.md git init git add README.md …

用户增长:策略与实践,驱动SaaS企业持续繁荣

在当今这个数字化时代&#xff0c;用户增长已成为所有行业&#xff0c;尤其是SaaS&#xff08;Software as a Service&#xff0c;软件即服务&#xff09;企业生存与发展的核心驱动力。用户增长不仅关乎市场份额的扩大&#xff0c;更是企业价值实现和持续盈利的基石。那么&…

【计算机网络】网络版本计算器

此前我们关于TCP协议一直写的都是直接recv或者read&#xff0c;有了字节流的概念后&#xff0c;我们知道这样直接读可能会出错&#xff0c;所以我们如何进行分割完整报文&#xff1f;这就需要报头来解决了&#xff01; 但当前我们先不谈这个话题&#xff0c;先从头开始。 将会…

【秋招笔试】8.18大疆秋招(第一套)-后端岗

🍭 大家好这里是 春秋招笔试突围,一起备战大厂笔试 💻 ACM金牌团队🏅️ | 多次AK大厂笔试 | 编程一对一辅导 ✨ 本系列打算持续跟新 春秋招笔试题 👏 感谢大家的订阅➕ 和 喜欢💗 和 手里的小花花🌸 ✨ 笔试合集传送们 -> 🧷春秋招笔试合集 🍒 本专栏已收…