#!/bin/bash
# 设定需要删除的文件夹
RM_DIR=’/data/files’
cd $RM_DIR
for I in `ls`
do
rm -f $I
done
#!/bin/bash
# 设定需要删除的文件夹
RM_DIR=’/data/files’
cd $RM_DIR
for I in `ls`
do
rm -f $I
done
1.页面里的COOKIE不能是浏览器进程的COOKIE(包括验证票和不设置超时时间的COOKIE),否则跨域会取不到.这点做跨域COOKIE的人比较少提到.不过实际上留意下几家大学做的方案,有细微的提到他们的验证模块里的COOKIE是有设置超时时间的.
2.当利用IFRAME时,记得要在相应的动态页的页头添加一下P3P的信息,否则IE会自觉的把IFRAME框里的COOKIE给阻止掉,产生问题.本身不保存自然就取不到了.这个其实是FRAMESET和COOKIE的问题,用FRAME或者IFRAME都会遇到.
3.测试时输出TRACE,会减少很多测试的工作量.
只需要设置 P3P HTTP Header,在隐含 iframe 里面跨域设置 cookie 就可以成功。他们所用的内容是:
P3P: CP=’CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR’
ASP直接在头部加了头部申明,测试有效。
<%Response.AddHeader "P3P", "CP=CAO PSA OUR"%>
php的话,应该是如下写法:
-PHP
header('P3P: CP=CAO PSA OUR');
ASP.NET的话
通过在代码上加
-C#
Response.AddHeader("P3P", "CP=CAO PSA OUR");
或者在Window服务中将ASP.NET State Service 启动。
JSP:
response.setHeader("P3P","CP=CAO PSA OUR")
英语原文解析
You can add a P3P compact policy header to your child content, and you can declare that no malicious actions are performed with the data of the user. If Internet Explorer detects a satisfactory policy, then Internet Explorer permits the cookie to be set.
Visit the following MSDN Web site for a complete list of satisfactory and unsatisfactory policy codes:
Privacy in Internet Explorer 6
http://msdn.microsoft.com/workshop/security/privacy/overview/privacyie6.asp
A simple compact policy that fulfills this criteria follows:
P3P: CP=”CAO PSA OUR”
This code sample shows that your site provides you access to your own contact information (CAO), that any analyzed data is only “pseudo-analyzed”, which means that the data is connected to your online persona and not to your physical identity (PSA), and that your data is not supplied to any outside agencies for those agencies to use (OUR).
You can set this header if you use the Response.AddHeader method in an ASP page. In ASP.NET, you can use the Response.AppendHeader method. You can use the IIS Management Snap-In (inetmgr) to add to a static file.
Follow these steps to add this header to a static file:
1. Click Start, click Run, and then type inetmgr.
2. In the left navigation page, click the appropriate file or directory in your Web site to which you want to add the header, right-click the file, and then click Properties.
3. Click the HTTP Headers tab.
4. In the Custom HTTP Headers group box, click Add.
5. Type P3P for the header name, and then for the compact policy string, type CP=…, where “…” is the appropriate code for your compact policy.
Alternatively, Internet Explorer users can modify their privacy settings so that they are prompted to accept third party content. The following steps show how to modify the privacy settings:
1. Run Internet Explorer.
2. Click Tools, and then click Internet Options.
3. Click the Privacy tab, and then click Advanced.
4. Click to select the Override automatic cookie handling check box.
5. To allow ASP and ASP.NET session cookies to be set, click to select the Always allow session cookies check box.
6. To receive a prompt for any type of third party cookie, click Prompt in the Third-party Cookies list.
其它软件包的检查:
[root@mail doc]# rpm -qa|grep gd
gd-1.8.4-4
gd-devel-1.8.4-4
[root@mail doc]# rpm -qa|grep perl
perl-5.6.0-17
mod_perl-1.24_01-3
[root@mail doc]# rpm -qa|grep libp
libpng-1.0.12-2
libpng-devel-1.0.12-2
[root@mail doc]# rpm -qa|grep zlib
zlib-1.1.3-24
zlib-devel-1.1.3-24
[root@mail doc]# rpm -qa|grep gcc
gcc-2.96-98
gcc-g77-2.96-98
gcc-c++-2.96-98
目前mrtg的最新版本为mrtg-2.16.1:
wget ftp://ftp.idilis.ro/mirrors/mrtg/mrtg-2.16.1.tar.gz
[root@mail src]# tar xvfz mrtg-2.16.1.tar.gz
[root@mail src]# cd mrtg-2.16.1
[root@mail mrtg-2.16.1]# ./configure –prefix=/data/mrtg
[root@mail mrtg-2.16.1]# make
[root@mail mrtg-2.16.1]# make install
到现在我们就已经正确地安装了MRTG系统。
配置SNMP服务
对于不同的设备,配置SNMP支持的方法是不一致的,具体请参考设备的随机文档,一般里 面都有详细的介绍。这里我们讨论在Linux环境下配置SNMP服务器,以实现对本机流出流入数据的分析和报表(我的应用环境是使用Linux带动一个小型局域网上网,监控本机进出 流量)。
在linux环境下安装snmp软件包是很容易的,只需要安装相应的软件包即可:
[root@mail doc]# rpm -qa|grep snmp
net-snmp-libs-5.3.1-14.el5
net-snmp-libs-5.3.1-14.el5
net-snmp-5.3.1-14.el5
[root@mail doc]# /etc/rc.d/init.d/snmpd start
Starting snmpd: [ OK ]
如果命令输出如上所示,就表示snmp服务器启动正常。
为了配合mrtg使用,还要修改snmpd的配置,以使其允许mrtg读取其interface(网络接口) 流量数据。
vi /etc/snmp/snmpd.conf
装下面这个的#注
view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
然后将
access notConfigGroup “” any noauth exact systemview none none
修改为:
access notConfigGroup “” any noauth exact mib2 none none
在55行左右加入:
view systemview included .1.3.6.1.2.1.2
然后再重新启动snmpd:
/etc/rc.d/init.d/snmpd restart
生成MRTG配置文件
# mkdir /data/mrtg/cfg/
配置文件:/data/mrtg/cfg/mrtg.cfg
# cd /data/mrtg/bin
# ./cfgmaker –global ‘WorkDir: /data/apache2/htdocs/mrtg’ –global ‘Options[_]: bits,growright’ –output /data/mrtg/cfg/mrtg.cfg public@192.168.3.9
更新信息.
env LANG=C /data/mrtg/bin/mrtg /data/mrtg/cfg/mrtg.cfg
# mkdir /data/apache2/htdocs/mrtg
生成mrtg的index文件
# ./indexmaker –output /data/apache2/htdocs/mrtg/index.html /data/mrtg/cfg/mrtg.cfg
<VirtualHost mrgt.yourdomanin.com>
servername mrgt.yourdomanin.com
documentroot /data/apache2/htdocs/mrtg
customlog logs/mrgt.yourdomanin.com common
</VirtualHost>
<directory “/data/apache2/htdocs/mrtg/”>
options followsymlinks includes
allowoverride none
order allow,deny
allow from all
authname “MRTG流量察看”
authtype basic
authuserfile /data/apache2/passdir/mrtgpass
require user 4ujk
</directory>
生成密码:
mkdir /data/apache2/passdir/
/data/apache2/bin/htpasswd -bc /data/apache2/passdir/mrtgpass username userpass
让系统每隔5分钟执行一次mrtg,生成新的MRTG流量图
# crontab –e
*/5 * * * * env LANG=C /data/mrtg/bin/mrtg /data/mrtg/cfg/mrtg.cfg
=============================================
2008-08-08 ->1178845140
update 表名 set l字段名=UNIX_TIMESTAMP(字段名)
1178845140 ->2008-08-08
update 表名 set l字段名=FROM_UNIXTIME(字段名)
vi编辑器黛色
echo "syntax enable" >> ~/.vimrc
网络连接状态
netstat -nat |awk '{print $6}'|sort|uniq -c|sort -rn
squid缓存状态
squidclient -h 211.154.255.103 -p 80 mgr:info
从日志文件中找出若干匹配的行
tail -n 22000 122.225.115.199.log |grep -E 'CST 2011|Total space in arena|StoreEntries with MemObjects' | more
Debian 管理服务 需要先安装个rcconf,然后直接用:
rcconf
cpu信息
cat /proc/cpuinfo
硬件信息
ls+tab,会出一堆命令,基本是这些
MySQL的mysqldump工具的基本用法
几个常用用例:
1.导出整个数据库
mysqldump -u 用户名 -p 数据库名 > 导出的文件名 mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
2.导出一个表
mysqldump -u 用户名 -p 数据库名 表名> 导出的文件名 mysqldump -u wcnc -p smgp_apps_wcnc users> wcnc_users.sql
3.导出一个数据库结构
mysqldump -u wcnc -p -d --add-drop-table smgp_apps_wcnc >d:\wcnc_db.sql -d 没有数据 --add-drop-table 在每个create语句之前增加一个drop table
4.导入数据库 常用source 命令
进入mysql数据库控制台, 如mysql -u root -p mysql>use 数据库 然后使用source命令,后面参数为脚本文件(如这里用到的.sql) mysql>source d:\wcnc_db.sql
sysctl是一个允许您改变正在运行中的Linux系统的接口。它包含一些 TCP/IP 堆栈和虚拟内存系统的高级选项, 这可以让有经验的管理员提高引人注目的系统性能。用sysctl可以读取设置超过五百个系统变量。基于这点,sysctl(8)提供两个功能:读取和修改系统设置。
查看所有可读变量:
%sysctl -a
读一个指定的变量,例如kern.maxproc
:
%sysctl kern.maxprockern.maxproc: 1044
要设置一个指定的变量,直接用variable=value这样的语法:
#sysctl kern.maxfiles=5000
kern.maxfiles: 2088 -> 5000
您可以使用sysctl修改系统变量,也可以通过编辑sysctl.conf文件来修改系统变量。sysctl.conf 看起来很像rc.conf。它用variable=value的形式来设定值。指定的值在系统进入多用户模式之后被设定。并不是所有的变量都可以在这个模式下设定。
sysctl 变量的设置通常是字符串、数字或者布尔型。 (布尔型用1来表示’yes’,用0来表示’no’)。
sysctl -w kernel.sysrq=0
sysctl -w kernel.core_uses_pid=1
sysctl -w net.ipv4.conf.default.accept_redirects=0
sysctl -w net.ipv4.conf.default.accept_source_route=0
sysctl -w net.ipv4.conf.default.rp_filter=1
sysctl -w net.ipv4.tcp_syncookies=1
sysctl -w net.ipv4.tcp_max_syn_backlog=2048
sysctl -w net.ipv4.tcp_fin_timeout=30
sysctl -w net.ipv4.tcp_synack_retries=2
sysctl -w net.ipv4.tcp_keepalive_time=3600
sysctl -w net.ipv4.tcp_window_scaling=1
sysctl -w net.ipv4.tcp_sack=1
配置sysctl
编辑此文件:
vi /etc/sysctl.conf
如果该文件为空,则输入以下内容,否则请根据情况自己做调整:
# Controls source route verification
# Default should work for all interfaces
net.ipv4.conf.default.rp_filter = 1
# net.ipv4.conf.all.rp_filter = 1
# net.ipv4.conf.lo.rp_filter = 1
# net.ipv4.conf.eth0.rp_filter = 1
# Disables IP source routing
# Default should work for all interfaces
net.ipv4.conf.default.accept_source_route = 0
# net.ipv4.conf.all.accept_source_route = 0
# net.ipv4.conf.lo.accept_source_route = 0
# net.ipv4.conf.eth0.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
# Increase maximum amount of memory allocated to shm
# Only uncomment if needed!
# kernel.shmmax = 67108864
# Disable ICMP Redirect Acceptance
# Default should work for all interfaces
net.ipv4.conf.default.accept_redirects = 0
# net.ipv4.conf.all.accept_redirects = 0
# net.ipv4.conf.lo.accept_redirects = 0
# net.ipv4.conf.eth0.accept_redirects = 0
# Enable Log Spoofed Packets, Source Routed Packets, Redirect Packets
# Default should work for all interfaces
net.ipv4.conf.default.log_martians = 1
# net.ipv4.conf.all.log_martians = 1
# net.ipv4.conf.lo.log_martians = 1
# net.ipv4.conf.eth0.log_martians = 1
# Decrease the time default value for tcp_fin_timeout connection
net.ipv4.tcp_fin_timeout = 25
# Decrease the time default value for tcp_keepalive_time connection
net.ipv4.tcp_keepalive_time = 1200
# Turn on the tcp_window_scaling
net.ipv4.tcp_window_scaling = 1
# Turn on the tcp_sack
net.ipv4.tcp_sack = 1
# tcp_fack should be on because of sack
net.ipv4.tcp_fack = 1
# Turn on the tcp_timestamps
net.ipv4.tcp_timestamps = 1
# Enable TCP SYN Cookie Protection
net.ipv4.tcp_syncookies = 1
# Enable ignoring broadcasts request
net.ipv4.icmp_echo_ignore_broadcasts = 1
# Enable bad error message Protection
net.ipv4.icmp_ignore_bogus_error_responses = 1
# Make more local ports available
# net.ipv4.ip_local_port_range = 1024 65000
# Set TCP Re-Ordering value in kernel to ‘5′
net.ipv4.tcp_reordering = 5
# Lower syn retry rates
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 3
# Set Max SYN Backlog to ‘2048′
net.ipv4.tcp_max_syn_backlog = 2048
# Various Settings
net.core.netdev_max_backlog = 1024
# Increase the maximum number of skb-heads to be cached
net.core.hot_list_length = 256
# Increase the tcp-time-wait buckets pool size
net.ipv4.tcp_max_tw_buckets = 360000
# This will increase the amount of memory available for socket input/output queues
net.core.rmem_default = 65535
net.core.rmem_max = 8388608
net.ipv4.tcp_rmem = 4096 87380 8388608
net.core.wmem_default = 65535
net.core.wmem_max = 8388608
net.ipv4.tcp_wmem = 4096 65535 8388608
net.ipv4.tcp_mem = 8388608 8388608 8388608
net.core.optmem_max = 40960
如果希望屏蔽别人 ping 你的主机,则加入以下代码:
# Disable ping requests
net.ipv4.icmp_echo_ignore_all = 1
编辑完成后,请执行以下命令使变动立即生效:
/sbin/sysctl -p
/sbin/sysctl -w net.ipv4.route.flush=1
我们常常在 Linux 的 /proc/sys 目录下,手动设定一些 kernel 的参数或是直接 echo 特定的值给一个 proc下的虚拟档案,俾利某些档案之开启,常见的例如设定开机时自动启动 IP Forwarding:
echo “1” > /proc/sys/net/ipv4/ip_forward
其实,在 Linux 我们还可以用 sysctl command 便可以简易的去检视、设定或自动配置 特定的 kernel 设定。我们可以在系统提示符号下输入「sysctl -a」,摘要如后:abi.defhandler_coff = 117440515
dev.raid.speed_limit_max = 100000
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.default.secure_redirects = 1
net.ipv4.conf.default.accept_redirects = 1
net.ipv4.conf.default.mc_forwarding = 0
net.ipv4.neigh.lo.delay_first_probe_time = 5
net.ipv4.neigh.lo.base_reachable_time = 30
net.ipv4.icmp_ratelimit = 100
net.ipv4.inet_peer_gc_mintime = 10
net.ipv4.igmp_max_memberships = 20
net.ipv4.ip_no_pmtu_disc = 0
net.core.no_cong_thresh = 20
net.core.netdev_max_backlog = 300
net.core.rmem_default = 65535
net.core.wmem_max = 65535
vm.kswapd = 512 32 8
vm.overcommit_memory = 0
vm.bdflush = 30 64 64 256 500 3000 60 0 0
vm.freepages = 351 702 1053
kernel.sem = 250 32000 32 128
kernel.panic = 0
kernel.domainname = (none)
kernel.hostname = pc02.shinewave.com.tw
kernel.version = #1 Tue Oct 30 20:11:04 EST 2001
kernel.osrelease = 2.4.9-13
kernel.ostype = Linux
fs.dentry-state = 1611 969 45 0 0 0
fs.file-nr = 1121 73 8192
fs.inode-state = 1333 523 0 0 0 0 0
从上述的语法我们大概可看出 sysctl 的表示法乃把目录结构的「/」以「.」表示,一层一层的连结下去。当然以echo 特定的值给一个 proc下的虚拟档案也是可以用 sysctl加以表示,例如:
#sysctl –w net.ipv4.ip_forward =”1”
或是直接在 /etc/sysctl.conf 增删修改特定档案的 0,1值亦可:
# Enables packet forwarding
net.ipv4.ip_forward = 1
# Enables source route verification
net.ipv4.conf.default.rp_filter = 1
# Disables the magic-sysrq key
kernel.sysrq = 0
当然如果考虑 reboot 后仍有效, 直接在 /etc/sysctl.conf 增删修改特定档案的 0,1值才可使之保留设定(以RedHat 为例,每次开机系统启动后, init 会执行 /etc/rc.d/rc.sysinit,便会使用 /etc/sysctl.conf 的预设值去执行 sysctl)。
相关参考档案:
/sbin/sysctl
/etc/sysctl.conf
sysctl 及sysctl.conf manpage
/usr/src/linux-x.y.z/Documentation/sysctl/*
/usr/share/doc/kernel-doc-x.y.z/sysctl/* (RedHat)
切换多个 br 成为一个br preg_replace(“/(<br\s*\/?>\s*)+/”, “<br/>”, $c)
GRANT ALL PRIVILEGES ON *.* TO admin@”8.8.8.8″ IDENTIFIED BY ‘111111’ WITH GRANT OPTION;
mysqldump -u 用户名 -p 数据库名 > 导出的文件名mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
mysqldump -u 用户名 -p 数据库名 表名> 导出的文件名mysqldump -u wcnc -p smgp_apps_wcnc users> wcnc_users.sql
mysqldump -u wcnc -p -d –add-drop-table smgp_apps_wcnc >d:\wcnc_db.sql-d 没有数据 –add-drop-table 在每个create语句之前增加一个drop table
进入mysql数据库控制台,如mysql -u root -pmysql>use 数据库然后使用source命令,后面参数为脚本文件(如这里用到的.sql)mysql>source d:\wcnc_db.sql
CHANGE MASTER TOmaster_def[,master_def] …
master_def:
MASTER_HOST = 'host_name'
| MASTER_USER = 'user_name'
| MASTER_PASSWORD = 'password'
| MASTER_PORT =port_num
| MASTER_CONNECT_RETRY =count
| MASTER_LOG_FILE = 'master_log_name'
| MASTER_LOG_POS =master_log_pos
| RELAY_LOG_FILE = 'relay_log_name'
| RELAY_LOG_POS =relay_log_pos
| MASTER_SSL = {0|1}
| MASTER_SSL_CA = 'ca_file_name'
| MASTER_SSL_CAPATH = 'ca_directory_name'
| MASTER_SSL_CERT = 'cert_file_name'
| MASTER_SSL_KEY = 'key_file_name'
| MASTER_SSL_CIPHER = 'cipher_list'
可以更改从属服务器用于与主服务器进行连接和通讯的参数。
MASTER_USER,MASTER_PASSWORD,MASTER_SSL,MASTER_SSL_CA,MASTER_SSL_CAPATH,MASTER_SSL_CERT,MASTER_SSL_KEY和MASTER_SSL_CIPHER用于向从属服务器提供有关如何与主服务器连接的信息。
即使对于在编译时没有SSL支持的从属服务器,SSL选项(MASTER_SSL,MASTER_SSL_CA,MASTER_SSL_CAPATH,MASTER_SSL_CERT,MASTER_SSL_KEY和MASTER_SSL_CIPHER)也可以被更改。它们被保存到master.info文件中,但是会被忽略,直到您使用一个SSL支持已启用的服务器。
如果您不指定一个给定的参数,则它会保持其原有的值。例外情况在后面的讨论中进行了说明。举例说明,如果用于连接到您的MySQL主服务器的 密码被更改了,您只需发布这些语句,就可以告知从属服务器新的密码:
mysql>STOP SLAVE; -- if replication was running
mysql>CHANGE MASTER TO MASTER_PASSWORD='new3cret';
mysql>START SLAVE; -- if you want to restart replication
没有必要指定没有改变的参数(主机、接口、用户等)。
MASTER_HOST和MASTER_PORT是主服务器主机和其TCP/IP接口的主机名(或IP地址)。注意,如果MASTER_HOST与localhost相等,那么,和MySQL的其它部分一样,接口可以被忽略(例如,如果可以使用Unix插槽文件)。
如果您指定了MASTER_HOST或MASTER_PORT,则从属服务器会假定主服务器与以前不一样(即使您指定的主机或接口值与当前值是一样的。)在此情况下,主服务器二进制日志的名称和位置的原有值不再适用,因此,如果您不指定语句中的MASTER_LOG_FILE和MASTER_LOG_POS,MASTER_LOG_FILE=”和MASTER_LOG_POS=4会被静默地添加。
在MASTER_LOG_FILE和MASTER_LOG_POS坐标点,从属服务器I/O线程在启动之后从主服务器读取。如果您只指定了其中一个,则从属服务器不能指定RELAY_LOG_FILE或RELAY_LOG_POS。如果MSATER_LOG_FILE和MASTER_LOG_POS都没有被指定,则从属服务器会使用在CHANGE MASTER被发布前的最后一个slave SQL thread坐标。当您只想改变要使用的 密码时,这可以确保复制的连续性。即使从属服务器SQL线程落后于从属服务器I/O线程,也可以确保复制的连续性。
CHANGE MASTER会删除所有的中继日志文件并启动一个新的日志,除非您指定了RELAY_LOG_FILE或RELAY_LOG_POS。在此情况下,中继日志被保持;relay_log_purge全局变量被静默地设置为0。
CHANGE MASTER TO可以更新master.info和relay-log.info文件的内容。
当您拥有主服务器快照并拥有日志和对应的偏移量时,CHANGE MASTER对于设置从属服务器是有用的。在把快照载入从属服务器之后,您可以在从属服务器上运行CHANGE MASTER TO MASTER_LOG_FILE=’log_name_on_master‘, MASTER_LOG_POS=log_offset_on_master。
举例说明:
mysql>CHANGE MASTER TO
-> MASTER_HOST='master2.mycompany.com',
-> MASTER_USER='replication',
-> MASTER_PASSWORD='bigs3cret',
-> MASTER_PORT=3306,
-> MASTER_LOG_FILE='master2-bin.001',
-> MASTER_LOG_POS=4,
-> MASTER_CONNECT_RETRY=10;
mysql>CHANGE MASTER TO
-> RELAY_LOG_FILE='slave-relay-bin.006',
-> RELAY_LOG_POS=4025;
第一个例子可以更改主服务器及其二进制日志坐标。当想要设置从属服务器来复制主服务器时使用。
第二个例子显示了较少被使用的一个操作。当从属服务器含有中继日志,并且您出于某种原因想要执行此日志时使用。要这么做时,不需要连接主服务器。您只需要使用CHANGE MASTER TO并启动SQL线程(START SLAVE SQL_THREAD)。
您甚至可以在一个用于独立非从属服务器的非复制型设置中使用第二种操作,在崩溃之后进行复原。假设您的服务器已崩溃,同时您已恢复了备份。您想要重新播放服务器自己的二进制日志(不是中继日志,而是正规的二进制文件),例如名为myhost-bin.*。首先,应在安全的地方制作这些二进制日志的备份,以防您没有完全遵守以下步骤,意外地让服务器清理了二进制文件。使用SET GLOBAL relay_log_purge=0,进一步增加安全性。然后启动不含–log-bin选项的服务器。使用–replicate-same-server-id,–relay-log=myhost-bin(让服务器相信,这些正规的二进制日志是中继日志)和–skip-slave-startoptions选项。当服务器启动后,发布以下语句:
mysql>CHANGE MASTER TO
-> RELAY_LOG_FILE='myhost-bin.153',
-> RELAY_LOG_POS=410,
-> MASTER_HOST='some_dummy_string';
mysql>START SLAVE SQL_THREAD;
服务器会读取并执行自己的二进制日志,完成崩溃复原。当复原完成后,运行STOP SLAVE,关闭服务器,删除master.info和relay-log.info,并使用原来的选项重新启动服务器。
要让服务器认为它是一个从属服务器,需要指定MASTER_HOST(甚至使用假值)。