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-DR模式

(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.rhkb.cn/news/409136.html

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

相关文章

PV、UV、IP:网站流量分析的关键指标

原文&#xff1a;PV、UV、IP&#xff1a;网站流量分析的关键指标 - 孔乙己大叔 (rebootvip.com) 摘要&#xff1a; 在浩瀚的互联网海洋中&#xff0c;PV&#xff08;Page View&#xff0c;页面浏览量&#xff09;、UV&#xff08;Unique Visitor&#xff0c;独立访客数…

基于改进YOLOv8的景区行人检测算法

贵向泉, 刘世清, 李立, 秦庆松, 李唐艳. 基于改进YOLOv8的景区行人检测算法[J]. 计算机工程, 2024, 50(7): 342-351. DOI: 10.19678/j.issn.10 原文链接如下&#xff1a;基于改进YOLOv8的景区行人检测算法https://www.ecice06.com/CN/rich_html/10.19678/j.issn.1000-3428.006…

墨者学院 手工注入题解(oracle数据库)

简介 Oracle 数据库系统&#xff0c;是美国ORACLE公司&#xff08;甲⻣⽂&#xff09;提供的以分布式数据库为核⼼的⼀组软件 产品。是⽬前世界上使⽤最为⼴泛的&#xff0c;数据库管理系统。 以下是手工注入的流程&#xff1a; 1、判断注入点 使用 and 11 进行拼接 2、确定…

Unity实现棋盘方格

本文参考&#xff1a;p1_哔哩哔哩_bilibili 一、精要提炼 1、Button自带的白色底图是圆角的&#xff0c;Image组件自带的白色底图是方角的。 2、2D中Instantiate指定的位置为屏幕坐标系的位置&#xff0c;左下角为(0,0) 3、求某个组件的位置&#xff1a;xx.transform.posi…

【数据结构4】树的实例-模拟文件系统、二叉树的遍历(先序遍历、中序遍历、后序遍历、层次遍历)

1 树和二叉树 2 树的实例-模拟文件系统 3 二叉树 3.1 二叉树的遍历 二叉树的先序遍历 二叉树的中序遍历 二叉树的后序遍历 二叉树的层次遍历 1 树 树是一种数据结构 比如:目录结构 树是一种可以递归定义的数据结构树是由n个节点组成的集合:如果n0&#xff0c;那这是一棵空树;如…

[C++]一、C++基础编程

G:\Cpp\2023版C教程 C语言程序设计 第一部分 基础篇 一、什么是C 1.1 C 简介 C 是一门非常经典的高级编程语言。顾名思义&#xff0c;C可以看做是C语言的增强版&#xff0c;在C的基础上扩展了更多的功能&#xff1b;最主要的扩展&#xff0c;就是面向对象和泛型编程。 因…

buuctf [MRCTF2020]hello_world_go

前言 学习笔记 这题签到&#xff01; 64IDA打开。 查找字符串发现什么都没有。。。 没事 搜索main()【不知道go语言有没有&#xff0c;先搜索再说】 随便点开一个。 有flag格式&#xff0c;提交看看呗。 成了&#xff0c;签到。 flag{hello_world_gogogo} 题外话&#xff0c;…

Day18_Netty

文章目录 NettyIO 模型Java有哪些数据类型零拷贝深拷贝和浅拷贝的区别是什么?BIO、NIO、AIO的区别是什么?Netty 是什么?Netty 基于 NIO,那为啥不直接用 NIO 呢? / 为什么要用 Netty?Netty 应用场景了解么?那些开源项目用到了 Netty?Netty的核心组件是什么?请解释Netty…

Golang | Leetcode Golang题解之第371题两整数之和

题目&#xff1a; 题解&#xff1a; func getSum(a, b int) int {for b ! 0 {carry : uint(a&b) << 1a ^ bb int(carry)}return a }

汇编知识MOV,MRS,MSR,PUSH和POP指令

处理器做得最多的事情就是在处理器内部来回的进行数据传递 1) 将数据从一个寄存器传递到另一个寄存器中 2) 将数据从一个寄存器传递到特殊寄存器&#xff0c;例如CPSR,SPSR寄存器 3) 将立即数传递到寄存器。 数据传输常用的三个指令&#xff1a;MOV,MRS,MSR指令 常用的…

清华计算几何-线段求交与BO算法

单轴线段求交 给定单边轴下, N定线段&#xff0c;检查出相交的线段. 解法一: 暴力求解 遍历所有线段对&#xff0c;进行相交判断, 算法复杂度为O(n2) 解法二: LR扫描 把每条线段的头尾认定为L和R。对所有点进行排序&#xff0c;如果每两个点满足LL或者RR&#xff0c;则对应…

嵌入式UI开发-lvgl+wsl2+vscode系列:11、SSD202移植运行评估demo程序

一、前言 接下来我们根据开发板的LVGL指南移植lvgl的demo程序到开发板上&#xff0c;以及将一个评估的项目移植到开发板上&#xff0c;你将会发现移植lvgl到ssd2xx的板子上似乎很简单&#xff0c;但通过评估程序你将更加方便了解lvgl是否可以满足你的开发需求&#xff0c;除了…

使用了LSTM的数据预测

记录一下&#xff0c;这个是在national university of singapore,黄教授给我们布置的任务&#xff0c;做了一个北京的已知十年的打印量&#xff0c;预测100天的打印机大作业&#xff0c;我们使用了lstm模型&#xff0c;就是两层神经网络&#xff0c;同时dropout的加入为了防止过…

k8s跨节点后pod无法访问

场景 k8s在node1节点部署nginx后&#xff0c; 除node1外&#xff0c;主节点以及node2节点都无法正常访问nginx 并且主节点以及node2节点都无法ping通node1节点上的pod 网络插件为calico 并且也没有相关路由信息 解决方案 启动tunl0接口&#xff0c;因为calico需要使用tunl0网…

【解析几何笔记】8.向量的投影与内积

8. 向量的投影与内积 复习前面的知识&#xff1a;&#xff0c;若BCE三点共线&#xff0c;则 A E ⃗ ( 1 − s ) A B ⃗ s A C ⃗ , ( B , C , E ) μ ⇒ s μ 1 μ , 1 − s 1 1 μ \vec{AE}(1-s)\vec{AB}s\vec{AC},(B,C,E)\mu\Rightarrow s\frac{\mu}{1\mu},1-s\frac…

【学习笔记】时间序列模型(ARIMA)

文章目录 前言一、时间序列时间序列数据 二、ARIMA 模型大纲模型前提平稳性检验 差分整合移动平均自回归模型 ARIMA(p,q,d)自回归模型 (AR( p ))移动平均模型 (MA( q ))自回归移动平均模型(ARMA(p,q))差分自回归移动平均模型 ARIMA(p,d,q) 确定 p&#xff0c;q结果分析和模型检…

EVE-NG安装部署使用

EVE-NG安装部署使用 一、EVE的虚拟化安装1、下载EVE-NG(社区版)2、导入虚拟机-配置-登录二、EVE中设备的连接sercureCRT连接wireshark连接一、EVE的虚拟化安装 1、下载EVE-NG(社区版) 官网下载地址(科学上网): https://www.eve-ng.net/index.php/download/ 中文网下载…

运用Archimate为 智慧文旅搭建 数字化架构体系【系统架构】

ArchiMate是一种用于企业架构建模的开放、独立且详细的语言&#xff0c;它提供了一套丰富的概念和关系来描述、分析和可视化企业架构的不同领域。以下是ArchiMate建模的一些关键功能&#xff1a; 多视图建模&#xff1a;ArchiMate定义了23个示例视图&#xff0c;分为四类&#…

VMware-Ubuntu共享文件找不到

正常的流程我们实现设置共享目录 然后安装vmware-tool工具 我们先看一下vmware-tool的获取方式&#xff0c;系统安装好了以后&#xff0c;关闭系统将虚拟机设置改成图中配置&#xff0c;然后重启 鼠标右键会看到重新安装vmware-tool不再是灰色&#xff0c;点击重新安装 以1…

OpenCV几何图像变换(5)旋转和缩放计算函数getRotationMatrix2D()的使用

操作系统&#xff1a;ubuntu22.04 OpenCV版本&#xff1a;OpenCV4.9 IDE:Visual Studio Code 编程语言&#xff1a;C11 算法描述 计算二维旋转的仿射矩阵。 该函数计算以下矩阵&#xff1a; [ α β ( 1 − α ) ⋅ center.x − β ⋅ center.y − β α β ⋅ center.x ( …