lvs负载均衡

集群

集群:采用多台服务器提供同一种服务称为集群

集群分为三种:1: 负载均衡集群(LB)[Load Balancer ]

						2:高可用集群(HA)[ High  Available ]

​ 3:高性能集群

  # 负载均衡服务器:  
      用户通过域名访问网页,dns将域名解析成对应的IP地址访问负载均衡服务器,然后负载均衡服务器通过算法将用户访问流量分发到内部服务器集群中具体的某一台服务器,服务器集群中的服务器将用户访问的内容读取出来后返还给负载均衡服务器,负载均衡服务器再将内容转发到用户
 # 高可用集群    
    由于用户访问都是由负载均衡服务器进行转发,负载均衡服务起一旦宕机,用户访问就会失败。所以通常会有两台负载均衡服务器做冗余,主服务器宕机备选服务器就会顶替主服务器的工作,从而保证服务可以正常运行,
    但是一个域名只能对应一个IP地址,两台负载均衡服务器就有两个IP地址,所以高可用集群就会生成一个虚拟ip(VIP),域名解析后的IP地址对应vip。vip对应着负载均衡主服务器,此时访问流量正常转发,当负载均衡主服务器意外宕机后vip通过高可用会自动对应负载均衡备选服务器,从而保证服务正常运行。(平时两台负载均衡服务器只有一台向外提供服务,另一台备选服务器处于空闲状态)
 #:高性能集群
    一般企业用不到,一般在国家层面,提供地震预测,天气预报,安全加密算法研究等对于服务器要求极高的应用场景

负载均衡集群(LB)[Load Balancer ]实现的方式

#:软件级  (层次指osi七层模型)
lvs       4层(传输层)负载均衡
haproxy   4层(传输层)/7层(应用层)负载
nginx     7层(应用层)负载
SLB       云资源负载,可同时实现高可用,需购买
#:硬件级
F5        硬件负载设备,需购买

LVS

lvs是什么:lvs是 Linx Virtual Server (linux虚拟服务器)

作用:根据4层报文的目标ip 和 port(端口)将流量通过挑选算法转发到后端集群中的某一台主机

lvs中的工具

ipvsadm :用户空间的命令行工具,用于管理集群服务

ipvs : 工作与内核中的netfilter (流量过滤器) INPUT钩子上

通过 grep -i -A 2 ‘ipvs’ /boot/config-4.18.0-193.el8.x86_64 过滤出系统支持的算法

lvs架构

缩写全拼含义
DRDirector Server负载均衡服务器
RsReal Server真实服务器
CIPClient ip用户电脑ip
DIPDirector ip负载均衡服务器内网ip
RIPReal Server ip真实服务器ip
VIPVirtual IP虚拟ip

lvs类型

lvs类型总共有4种

  1. lvs-nat模式:

        客户端通过域名访问网址,域名通过dns解析成对应的IP地址(vip),调度器接收到请求将vip替换成rip(真实服务器ip)通过算法交给内网真实服务器解析请求,真实服务器再将解析后的内容交还给负载均衡的dip(负载均衡内网ip),负载均衡服务器再将内容中的rip替换成vip后再转发至客户端,如下图
       因为所有包都要经过调度器,在极高负载的场景中,调度器可能成为系统性能瓶颈
       在配置中RS(真实服务器)ip和dip(负载均衡内网ip)应该在同一网段,并且RS的网关要指向dip
    

    在这里插入图片描述

  2. lvs-dr模式:网关模式,lvs的默认模式

           客户端通过域名访问网址,域名通过dns解析成对应的IP地址(vip),调度器接收到请求将vip中的目的mac地址替换成rip的mac地址通过算法交给内网对应mac地址的真实服务器解析请求,真实服务器再将解析后的内容直接和客户机进行通信,如下图
    

    在这里插入图片描述

  3. lvs-tun模式(隧道模式)

          客户端通过域名访问网址,域名通过dns解析成对应的IP地址(vip),调度器接收到请求后将接收到的包再次封装一层含有DIP和RIP信息的包,在通过互联网隧道将包转发到后端服务器,后端服务器接收到包后使用本地环回网卡的vip地址跟客户端通信(环回网卡能发不能收)
    

    在这里插入图片描述

  4. lvs-fullnat (复合nat模式)

用户访问数据进出每次都要nat地址装换,效率低

特点:
1:vip是公网地址,rip和dip是私网地址,rip与dip不需要再同一网络中
2:RS接收到的请求报文的源地址为Dip,因此要响应Dip
3:请求报文和响应报文都要经由调度器(director)
4:支持端口映射机制,后端真实服务器(RS)可以是任意os

lvs-dr的特点:
保证前端路由器将目标IP为VIP的请求报文发送给director,解决方案有以下三种:
1: 静态绑定
arptables
2:修改RS主机内核的2个参数:
arp_announce:是否接收并记录别人的通告以及是否通告自己的mac地址给别人。
arp_announce有三个可选值,其意义如下:

可选值含义
0默认值,通告自己所拥有的所有地址
1尽量不通告与自己不在同一个网段的地址,但还是有可能会通告
2总是不通告与自己不在同一个网段的地址,

3: arp_ignore:是否响应arp请求
arp_ignore有9个可选值,0,1,2,3,4,5,6,7,8,其意义如下:

可选值含义
0默认值,回应任何网络接口上对任何本地IP地址的arp查询请求
1请求报文从哪个接口进入的且请求的目标地址就是此接口配置的地址才予以响应,否则不响应只回答目标IP地址是来访网络接口本地地址的ARP查询请求
2只回答目标IP地址是来访网络接口本地地址的ARP查询请求,且来访IP必须在该网络接口的子网段内
3不回应该网络接口的arp请求,而只对设置的唯一和连接地址做出回应
4-7保留未使用
8不回应所有(本地地址)的arp查询
#:注
1:RS(真实服务器)的RIP可以使用私有地址,也可以使用公网地址
2:RS(真实服务器)跟Director(调度器)必须在同一物理网络中,中间不能有路由器相隔
3: 请求报文经经过Director(调度器器)调度,但响应报文一定不能经由Director(如果回应时经过就是net模式),  不支持端口映射
4: RS(真实服务器)可以是大多数OS(系统)并且RS的网关不能指向DIP(调度器内网ip)
5:

lvs-tun的特点

1:RIP,DIP,VIP必须是公网地址

2:RS的网关不能指向DIP

3:请求报文必须经由director调度,但响应报文必须不能经由director(调度器)并且不支持端口映射

4: RS(真实服务器)的OS系统必须支持隧道功能

lvs scheduler :lvs调度器算法

静态方法:仅根据算法本身进行调度

调度含义
RRround robin 论调、轮询
WRRweighted RR 加权轮询,根据一定的比例进行调度,例如当某一个RS给到两个请求之后才 给另外一个RS1个请求
SHsource hash 原地址hash,实现session(会话)保持机制,将来自于同一个ip的请求始终调度至同一个RS(真实服务器),每个服务单独调度
DHdestination hash,目标地址hash、将对同一个目标(资源)的请求始终分发给同一台RS

动态方法:根据算法及个RS的当前负载状态进行调度,根据指定的算法算出RS负载,最终挑选出负载值最小的进行选中

调度含义
LCleast Connection,最少连接数,Active*256+lnactiove(活动的连接数 x 256 +不活跃的连接数)
WLCWeighted LC ,加权的LC(Active*256+lnactiove) / weight (活动的连接数 x 256 +不活跃的连接数 )/ 权重)
SEDShortest Expection Delay,最短期望延迟( )Active +1)*256/weight(活动的连接数+1)x256/权重)
NQNevel Queue,是SED算法的改进,经过SED算法每台主机第一次至少要被分配一次,然后再按SED算法来挑选
LBLCLocality-Based LC,基于本都最少连接数,即动态的DH算法
LBLCRLocality-Based Least-Connection with Replication 带复制功能的lblc算法

搭建IPVS集群

IPVS特点:

1:一个IPVS主机可以同时定义多个cluster service(集群服务)

2:支持多种协议【TCP、UDP 、AH EST 、AH-EST 、SCTP】

3:定义时指明lvs-type(lvs模式)以及调度器

4:一个cluster service(集群服务)上至少要有两个real server(真实服务器)

ipvsadm命令

管理集群服务

语法: ipvsadm -A|E -t|u|f service-address [-s scheduler] [-s scheduler] [-p (timeout)] [-M netmask]

ipvsadm -D -t|u|f service-address

参数作用
-A|EA:添加 E:编辑
-t|u|ft:tcp u:udp f:防火墙流量标记
tcp-t ip(IP地址地址):port(端口)
udp-u ip(IP地址):port(端口)
fwn-f mark(防火墙标记名称)
-s指定调度器的算法
-D删除

-s scheduler: 默认为WLC(加权最少连接数)

-p (timeout):定义持久连接时间,默认为300秒

管理集群服务中的RS

语法: ipvsadm -a|e -t|u|f service-address -r server-address [-g|im] [-w weight] [-x upper] [-y lower]

ipvsadm -d -t|u|f service-address -r server-address

ipvsadm -L|I:列出规则

参数作用
-g|i|m-g :dr模式 -i:隧道模式 -m:nat模式
-w weight设定权重 0为正无穷 设定为0则不调度,默认为1,权重值越大代表性能越强
-x
-S保存
-C清除配置
-R重载配置

配置

#:DR调度器
1:关闭防火墙和selinux
[root@localhost ~]# systemctl disable --now firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# vi /etc/selinux/config
将  SELINUX=enforcing
改为
SELINUX=disabled
[root@localhost ~]# reboot
[root@localhost ~]# getenforce 
Disabled
#:更改一下主机名使主机具有辨识度
[root@localhost ~]# hostnamectl set-hostname Dr
[root@localhost ~]# bash
[root@Dr ~]# 

2:配置DIP(静态ip)vip 和yum源并安装依赖
 [root@Dr ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2495  100  2495    0     0  26263      0 --:--:-- --:--:-- --:--:-- 26263
[root@Dr ~]#  sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
[root@Dr ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens160
 BOOTPROTO="static"
IPADDR=192.168.62.133
NETMASK=255.255.255.0
GATEWAY=192.168.62.2
DNS1=114.114.114.114
DNS2=8.8.8.8

[root@Dr ~]# yum -y install net-tools
[root@Dr ~]#  ifconfig ens160:0 192.168.62.200/32 broadcast 192.168.62.200 up
[root@Dr ~]# ip a
----------省略-----------
inet 192.168.62.200/0 brd 192.168.62.200 scope global ens160:0
---------省略--------------

 
3:配置路由
[root@Dr ~]# route add -host 192.168.62.200 dev ens160:0
[root@Dr ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.62.2    0.0.0.0         UG    100    0        0 ens160
192.168.62.0    0.0.0.0         255.255.255.0   U     100    0        0 ens160
192.168.62.200  0.0.0.0         255.255.255.255 UH    0      0        0 ens160


4:添加规则
[root@Dr ~]# yum -y install ipvsadm 
[root@Dr ~]# ipvsadm -A -t 192.168.62.200:80 -s wrr
[root@Dr ~]# ipvsadm -a -t 192.168.62.200:80 -r 192.168.62.144:80 -g
[root@Dr ~]# ipvsadm -a -t 192.168.62.200:80 -r 192.168.62.130:80 -g
[root@Dr ~]# ipvsadm -Ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.62.200:80 wrr
  -> 192.168.62.130:80            Route   1      0          0         
  -> 192.168.62.144:80            Route   1      0          0 


真实服务器rs1操作:

#1:关闭放火墙和selinux
[root@localhost ~]# systemctl disable --now firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# vi /etc/selinux/config
将  SELINUX=enforcing
改为
SELINUX=disabled
[root@localhost ~]# reboot
[root@localhost ~]# getenforce 
Disabled
#: 更改一下主机名使主机具有辨识度
[root@localhost ~]# hostnamectl set-hostname rs1
[root@localhost ~]# bash
[root@rs1 ~]# 

#2:配置yum源将IP地址改为静态并安装一个网站服务httpd
[root@rs1 ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2495  100  2495    0     0  15691      0 --:--:-- --:--:-- --:--:-- 15691
[root@rs1 ~]#  sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
[root@rs1 ~]# yum -y install httpd
------省略------
Complete!
[root@rs1 ~]#  vim /etc/sysconfig/network-scripts/ifcfg-ens160
 BOOTPROTO="static"
IPADDR=192.168.62.144
NETMASK=255.255.255.0
GATEWAY=192.168.62.1
DNS1=114.114.114.114
DNS2=8.8.8.8

#3:更改内核参数
[root@rs1 ~]# vim /etc/sysctl.conf
#在最后添加:
net.ipv4.conf.all.arp_ignore =1
net.ipv4.conf.all.arp_announce = 2
[root@rs1 ~]# sysctl -p   //读取配置
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2

#4:配置RIP(静态)改配置文件
[root@rs2 ~]# yum -y install net-tools
[root@rs1 ~]# ifconfig lo:0 192.168.62.200/32 broadcast 192.168.62.200 up
[root@rs1 ~]# ip a
----------省略-----------
 inet 192.168.62.200/0 brd 192.168.62.200 scope global lo:0
-----------省略------------

#5:配置路由
[root@rs1 ~]# route add -host 192.168.62.200 dev lo:0
[root@rs1 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.62.2    0.0.0.0         UG    100    0        0 ens160
192.168.62.0    0.0.0.0         255.255.255.0   U     100    0        0 ens160
192.168.62.200  0.0.0.0         255.255.255.255 UH    0      0        0 lo

真实服务器rs2操作

#1:关闭防火墙和selinux
[root@localhost ~]# systemctl disable --now firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# vi /etc/selinux/config
将  SELINUX=enforcing
改为
SELINUX=disabled
[root@localhost ~]# reboot
[root@localhost ~]# getenforce 
Disabled
#: 更改一下主机名使主机具有辨识度
[root@localhost ~]# hostnamectl set-hostname rs1
[root@localhost ~]# bash
[root@rs2 ~]# 

#2:配置一个yum源jiangip地址改为静态并安装一个网站服务httpd
 
[root@rs2 ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2495  100  2495    0     0   9415      0 --:--:-- --:--:-- --:--:--  9379
[root@rs2 ~]#  sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
[root@rs2 ~]# yum -y install httpd
--------省略---------
    Complete!
[root@rs1 ~]#  vim /etc/sysconfig/network-scripts/ifcfg-ens160
 BOOTPROTO="static"
IPADDR=192.168.62.130
NETEMASK=255.255.255.0
GATEWAY=192.168.62.2
DNS1=114.114.114.114
DNS2=8.8.8.8

 
#3:为测试效果将网站内容更改与rs2有区别将网站内容改为不一样
 [root@rs2 ~]# echo "rs2" > /var/www/html/index.html


#4:更改内核参数
[root@rs2 ~]# vim /etc/sysctl.conf
#:在最后一行添加
net.ipv4.conf.all.arp_ignore =1
net.ipv4.conf.all.arp_announce = 2
保存后
sysctl -p
#5:配置RIP(静态)
[root@rs2 ~]# yum -y install net-tools
[root@rs2 ~]# ifconfig lo:0 192.168.62.200/32 broadcast 192.168.62.200 up

#6:配置路由
[root@rs2 ~]# route add -host 192.168.62.200 dev lo:0
[root@rs2 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.62.2    0.0.0.0         UG    100    0        0 ens160
192.168.62.0    0.0.0.0         255.255.255.0   U     100    0        0 ens160
192.168.62.200  0.0.0.0         255.255.255.255 UH    0      0        0 lo

使用windows上的cmd进行测试访问

C:\Users\liuhongsheng>curl 192.168.62.200
tui1

C:\Users\liuhongsheng>curl 192.168.62.200
rs2

生成证书

[root@Dr ~]# mkdir -p  /etc/pki/CA
[root@Dr ~]# cd /etc/pki/CA
[root@Dr CA]# mkdir private

生成key文件
[root@Dr CA]#  (umask 077;openssl genrsa -out private/cakey.pem 2048)
Generating RSA private key, 2048 bit long modulus (2 primes)
........................................+++++
.......................................................................+++++
e is 65537 (0x010001)

生成证书
[root@Dr CA]# openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days 365
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:cn #:国家
State or Province Name (full name) []:hb #:省
Locality Name (eg, city) [Default City]:wh #:城市
Organization Name (eg, company) [Default Company Ltd]:192.168.62.200 #:组织名称
Organizational Unit Name (eg, section) []:192.168.62.200  
#:组织单位名称
Common Name (eg, your name or your server's hostname) []:192.168.62.200 #:普通名称
Email Address []: #:电子邮箱
#:创建目录和文件
[root@rs1 ~]# mkdir certs newcerts crl
[root@rs1 ~]# touch index.txt && echo 01 > serial 

#:以下操作在真实服务器操作

#:进入httpd目录创建ssl目录并进入ssl目录
[root@rs1 ~]# cd /etc/httpd && mkdir ssl && cd ssl
#:生成秘钥文件
[root@rs1 ssl]# (umask 077;openssl genrsa -out httpd.key 2048)
Generating RSA private key, 2048 bit long modulus (2 primes)
............+++++
....+++++
e is 65537 (0x010001)

#:客户端生成证书签署请求
[root@rs1 ssl]# openssl req -new -key httpd.key -days 365 -out httpd.csr
Ignoring -days; not generating a certificate
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:cn
State or Province Name (full name) []:hb
Locality Name (eg, city) [Default City]:wh
Organization Name (eg, company) [Default Company Ltd]:192.168.62,200
Organizational Unit Name (eg, section) []:192.168.62.200
Common Name (eg, your name or your server's hostname) []:192.168.62.200
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
第一个输出: CN
第二个: HB
第三个:WH
第四个: 域名
第五个: 组织名称 (域名)
第六个: (域名)
第七个:不填
第八个:不填
第九个:不填

#:将客户端生成的证书签署请求发送给CA
[root@rs1 ssl]# scp httpd.csr root@192.168.62.133:/root
root@192.168.62.133's password: 
httpd.csr                             100% 1017     1.4MB/s   00:00 

#:以下在CA端操作
[root@rs2 ~]# mkdir certs newcerts crl
[root@rs2 ~]# touch index.txt && echo 01 > serial 
#:CA签署用户提交的证书
[root@Dr CA]# openssl ca -in /root/httpd.csr -out httpd.crt -days 365
Using configuration from /etc/pki/tls/openssl.cnf
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 1 (0x1)
        Validity
            Not Before: Oct 10 15:00:46 2023 GMT
            Not After : Oct  9 15:00:46 2024 GMT
        Subject:
            countryName               = cn
            stateOrProvinceName       = hb
            organizationName          = 192.168.62.200
            organizationalUnitName    = 192.168.62.200
            commonName                = 192.168.62.200
        X509v3 extensions:
            X509v3 Basic Constraints: 
                CA:FALSE
            Netscape Comment: 
                OpenSSL Generated Certificate
            X509v3 Subject Key Identifier: 
                83:90:72:A7:C3:93:AC:AC:C4:EA:8F:29:E3:42:06:D5:5E:65:36:25
            X509v3 Authority Key Identifier: 
                keyid:60:DE:A1:85:D6:68:03:6C:03:0D:D4:51:B8:2D:67:4F:E1:CF:68:B9

Certificate is to be certified until Oct  9 15:00:46 2024 GMT (365 days)
Sign the certificate? [y/n]:y 


1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

#:以下操作在真实主机上做
删除csr文件
[root@rs1 ssl]# rm -rf httpd.csr 

安装软件包
[root@rs1 ssl]# yum -y install httpd-devel mod_ssl


编辑配置文件
[root@rs1 ssl]# vim /etc/httpd/conf.d/ssl.conf

将VirtualHost _dafault_:443下的#ServerName www.example.com:443取消注释,并将域名进行更改


SSLCertificatefile /etc/httpd/ssl/httpd.crt #:证书位置
SSLCertificateKeyfile /etc/httpd/httpd.key #:秘钥位置

重启网站



15:00:46 2024 GMT (365 days)
Sign the certificate? [y/n]:y

1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

#:以下操作在真实主机上做
删除csr文件
[root@rs1 ssl]# rm -rf httpd.csr

安装软件包
[root@rs1 ssl]# yum -y install httpd-devel mod_ssl

编辑配置文件
[root@rs1 ssl]# vim /etc/httpd/conf.d/ssl.conf

将VirtualHost dafault:443下的#ServerName www.example.com:443取消注释,并将域名进行更改

SSLCertificatefile /etc/httpd/ssl/httpd.crt #:证书位置
SSLCertificateKeyfile /etc/httpd/httpd.key #:秘钥位置

重启网站
















  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值