not in 效率太低
所以用left join来处理
SELECT id FROM `fa_user` AS A LEFT JOIN
(SELECT user_id as i FROM `fa_third`) AS B ON A.id=B.i
WHERE B.i IS NULL
not in 效率太低
所以用left join来处理
SELECT id FROM `fa_user` AS A LEFT JOIN
(SELECT user_id as i FROM `fa_third`) AS B ON A.id=B.i
WHERE B.i IS NULL
早上到公司同时说数据库的表丢了,上去一看确实丢了,由于断过一次电,怀疑断电导致的,但是一想想断电出现的问题就不止只丢失一个表的事啊,先看一下日志和同时反馈的问题。
同时直接给我发了这样的一条消息:
Table './we7_71yunduan_to/ims_mc_members' is marked as crashed and should be repaired
那就检查一下这个表具体的问题!
mysql> use we7_71yunduan_to
Database changed
mysql> check table ims_mc_members
-> ;
+---------------------------------+-------+----------+----------------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+---------------------------------+-------+----------+----------------------------------------------------------------+
| we7_71yunduan_to.ims_mc_members | check | warning | Table is marked as crashed |
| we7_71yunduan_to.ims_mc_members | check | warning | 1 client is using or hasn't closed the table properly |
| we7_71yunduan_to.ims_mc_members | check | error | Found key at page 26624 that points to record outside datafile |
| we7_71yunduan_to.ims_mc_members | check | error | Corrupt |
+---------------------------------+-------+----------+----------------------------------------------------------------+
4 rows in set (0.04 sec)
mysql> repair table ims_mc_members
-> ;
+---------------------------------+--------+----------+----------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+---------------------------------+--------+----------+----------------------------------------------+
| we7_71yunduan_to.ims_mc_members | repair | info | Wrong bytesec: 0- 0- 0 at 70372; Skipped |
| we7_71yunduan_to.ims_mc_members | repair | warning | Number of rows changed from 243 to 242 |
| we7_71yunduan_to.ims_mc_members | repair | status | OK |
+---------------------------------+--------+----------+----------------------------------------------+
3 rows in set (0.11 sec)
mysql> check table ims_mc_members;
+---------------------------------+-------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+---------------------------------+-------+----------+----------+
| we7_71yunduan_to.ims_mc_members | check | status | OK |
+---------------------------------+-------+----------+----------+
1 row in set (0.00 sec)
mysql>
在处理过程发现表有两个警告和两个错误:表崩了,表被占着或关的姿势不对。。。。
处理方法就是repair table ims_mc_members
最后再检查一下问题结局
df -h
fdisk -l
对比Disk /dev/vda,vda下面有一个Device /dev/vda1,vdb少了一个Device。
说明数据盘是有的,只不过现在没有分区,还无法使用,所以接下来我们就要对它进行分区。
mkfs.ext4 /dev/vdb
mkdir -p /datab
echo '/dev/vdb /datab ext4 barrier=0 0 0' >> /etc/fstab
cat /etc/fstab #查看是否写入成功
mount -a
df -h
使用这个脚本,可以一键测试搬瓦工 VPS 各种性能,包括 VPS 基本信息,硬盘读写速度,到国内各个地区的下载速度等。与 bench.sh 相比,这个脚本主要是在测速方面做了改动。
使用方法:
wget -qO- http://tool.bug-maker.com/superbench/superbench_git.sh | bash
或者线上的版本
wget -qO- sb.oldking.net | bash
测试结果如下所示:
政府就是政府,网络安全要做到第一位,分配的服务器都要在堡垒机之下才能访问,所以得想招给代理出来,也给自己方便不是。
既然要反代理,就选的FRP,开源。。。。(不花钱)
下载对应版本的frp(包括服务端和客户端):大型同性交友网站
window客户端+服务端 | Linux客户端+服务端 | arm客户端+服务端 | |
---|---|---|---|
0.51.3 | frp_0.51.3_windows_amd64.zip | frp_0.51.3_linux_amd64.tar.gz | frp_0.51.3_linux_arm64.tar.gz |
0.38.0 | frp_0.38.0_windows_amd64.zip | frp_0.38.0_linux_arm64.tar.gz |
具体服务端配置文件信息frps.ini:
[common]
bind_port = 7000
#dashboard 用户名
dashboard_user = user1
#dashboard 密码
dashboard_pwd = user1
#dashboard 端口,启动成功后可通过浏览器访问如http://ip:7500
dashboard_port = 7500
token = 8d262f2b-6dba-4a8d-857e-8a53d1d439e2
运行服务端至后台
[root@w7 frp_0.33.0_linux_amd64]# nohup /root/frp/frp_0.33.0_linux_amd64/frps -c frps.ini &
2020/06/09 22:28:59 [I] [service.go:178] frps tcp listen on 0.0.0.0:7000
2020/06/09 22:28:59 [I] [service.go:277] Dashboard listen on 0.0.0.0:7500
2020/06/09 22:28:59 [I] [root.go:209] start frps success
运行之后可访问http://IP:7500
具体的客户端配置文件信息:
[common]
# 配置服务端对外的ip地址
server_addr = xxx.xxx.xxx.xxx
#配置服务端监听的端口
server_port = 7088
#如果服务端配置token,将服务端配置的token复制到此处
token = 8d262f2b-6dba-4a8d-857e-8a53d1d439e2
pool_count = 5
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 7122
[ftp]
type = tcp
local_ip = 127.0.0.1
local_port = 21
remote_port = 7121
运行客户端端至后台
[root@localhost frp_0.33.0_linux_amd64]# nohup /root/frp/frp_0.33.0_linux_amd64/frpc -c frpc.ini &
[1] 26153
[root@localhost frp_0.33.0_linux_amd64]# nohup: 忽略输入并把输出追加到'nohup.out'
[root@localhost frp_0.33.0_linux_amd64]# ls
frpc frpc_full.ini frpc.ini frps frps_full.ini frps.ini LICENSE nohup.out systemd
[root@localhost frp_0.33.0_linux_amd64]# cat nohup.out
2020/06/09 10:55:56 [I] [service.go:282] [0d80fe0bb829cc87] login to server success, get run id [0d80fe0bb829cc87], server udp port [0]
2020/06/09 10:55:56 [I] [proxy_manager.go:144] [0d80fe0bb829cc87] proxy added: [ssh ftp]
2020/06/09 10:55:56 [I] [control.go:179] [0d80fe0bb829cc87] [ssh] start proxy success
2020/06/09 10:55:56 [I] [control.go:179] [0d80fe0bb829cc87] [ftp] start proxy success
在/etc/systemd/system
下新建frpc.service
文件,内容如下:
[Unit]
Description=Frp client
After=network.target
[Service]
Type=simple
User=root
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/frp/frpc -c /usr/local/frp/frpc.ini
[Install]
WantedBy=multi-user.target
具体的客户端配置文件信息:
[common]
# 配置服务端对外的ip地址
server_addr = xxx.xxx.xxx.xxx
#配置服务端监听的端口
server_port = 7088
#如果服务端配置token,将服务端配置的token复制到此处
token = 8d262f2b-6dba-4a8d-857e-8a53d1d439e2
pool_count = 5
[mstsc]
type = tcp
local_ip = 127.0.0.1
local_port = 3389
remote_port = 7133
创建一个文件run.vbs
Set ws = CreateObject("Wscript.Shell")
ws.run "cmd /c C:\frp_0.33.0_windows_amd64\frpc.exe -c C:\frp_0.33.0_windows_amd64\frpc.ini",vbhide (这里注意要改为你的文件位置)
运行以下vbs文件就可以了
这样就大功告成,访问服务端的7122就相当于访问内网被隔离的机器22端口