@dooy
2017-06-28T05:31:33.000000Z
字数 20741
阅读 215
文档
Nginx
PHP
yum install -y gcc-c++ cmake make freetype-devel libpng-devel libjpeg-devel curl-devel libxml2-devel libmcrypt-devel ncurses-devel mhash-devel pcre-devel openssl-devel openldap-devel openldap-devel libtool-ltdl-devel neon-devel wget vim* subversion-svn2cl
##安装虚拟机器:
yum groupinstall -y "X Window System" "Desktop" "KDE Desktop"&& yum install -y nc expect freenx
./configure --prefix=/usr/local/mysql/ --with-extra-charsets=complex --with-charset=utf8 --enable-thread-safe-client
./configure --prefix=/usr/local/mysql/ --with-extra-charsets=complex --with-charset=utf8 --enable-thread-safe-client --with-plugins=sphinx
make && make install
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
chown mysql:mysql /usr/local/mysql/ -R
mkdir -p /mysql_data/
chown mysql:mysql /mysql_data/ -R
#编辑 my.cnf
vim /etc/my.cnf
/usr/local/mysql/bin/mysql_install_db --basedir=/usr/local/mysql --datadir=/mysql_data/ --user=mysql
#启动[启动前要确认3306是否被占用,被占用请修改my.cnf]
/usr/local/mysql/share/mysql/mysql.server start
Brkley
#========== mysql5.5+ 高版本==============
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DSYSCONFDIR=/etc \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_BERKLEY_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/mysql_data/data \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_USER=mysql \
-DENABLE_DTRACE=OFF
#========handlersocket安装配置 =========== -DMYSQL_UNIX_ADDR=/mysql_data/mysql.sock \
#参考 http://wangxiang0794.blog.163.com/blog/static/6390800520117145574699/
tar zxvf php-5.2.14.tar.gz
gzip -cd php-5.2.14-fpm-0.5.14.diff.gz | patch -d php-5.2.14 -p1
cd php-5.2.14/
./configure --prefix=/usr/local/php5.2 --with-config-file-path=/usr/local/php5.2/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --with-pspell=/usr
./configure --enable-fpm --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --with-pspell=/usr
./configure --enable-fpm --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --with-pspell=/usr --without-pear
./configure --enable-fpm --prefix=/usr/local/php54 --with-config-file-path=/usr/local/php54/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --with-pspell=/usr
--without-pear
make && make install
cp php.ini-dist /usr/local/php/etc/php.ini
配置 /usr/local/php/etc/php-fpm.conf
tar xf nginx-0.7.67.tar.gz
配置 /usr/local/nginx/conf/nginx.conf
配置 /usr/local/nginx/conf/fastcgi_judian
配置 /usr/local/nginx/conf/vhost/default
启动脚步 /etc/init.d/nginx
/usr/local/php54/bin/phpize
./configure --with-php-config=/usr/local/php54/bin/php-config
注意:备份的时候 pigai_org pigai_spss web1t 要重新copy
/etc/security/limits.conf
* soft nofile 210000
* hard nofile 210000
vi /etc/security/limits.d/90-nproc.conf
#修改为:
* soft nproc 10240
#<h2>Can't create a new thread (errno 11); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug</h2><p>Host: </p>
rsync -avzP -e ssh trp_also.tgz cikuu@db.pigai.org:/home/cikuu/
命令:mount -t tmpfs -o size=20m tmpfs 目录
参考网址: http://www.linuxidc.com/Linux/2013-12/93747.htm
http://solr1.pigai.org:8091/
线上管理界面
CB3.0 的 Administrator 的密码请设置为: rLGsGdr7bfYN56PHn41C091fCWuQ7xhH
tracert dignslookup
dig 命令的基本用法(用dig代替 nslookup)2009-05-14 16:08dig最基本的用法
>dig sina.com.cn //查询A记录
# 从根服务器开始追踪一个域名的解析过程
>dig www.pigai.org +trace
#增加用户
/usr/local/apache/bin/htpasswd /usr/local/svn/passwd yourename
#修改权限
vim /usr/local/svn/authz
echo "export JAVA_HOME=/usr/local/jdk1.7.0_04/" >/etc/profile.d/java_env.sh
echo "export JRE_HOME=/usr/local/jdk1.7.0_04/jre" >>/etc/profile.d/java_env.sh
echo "export CLASSPATH=.:\$JAVA_HOME/lib:\$JRE_HOME/lib:$CLASSPATH" >>/etc/profile.d/java_env.sh
echo "export PATH=.:\$JAVA_HOME/bin:\$JRE_HOME/bin:$PATH" >>/etc/profile.d/java_env.sh
chmod +x /etc/profile.d/java_env.sh
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin yangdaorong@cikuu.com
DocumentRoot "D:/wamp/pigai"
ServerName pigai.ntu.edu.cn
<IfModule mod_proxy.c>
ProxyRequests off
ProxyPreserveHost on
<Proxy />
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://www.pigai.org/
ProxyPassReverse / http://www.pigai.org/
</IfModule>
</VirtualHost>
./configure --prefix=/usr/local/apache \
--with-apr=/usr/local/apr/bin/apr-1-config \
--with-apr-util=/usr/local/apr-util/bin/apu-1-config \
--enable-rewrite --with-mpm=prefork
tar xf mpm-itk-VERSION.tar.gz
cd mpm-itk-VERSION
./configure --prefix=/usr/local/mpt-itk --with-apxs=/usr/local/apache/bin/apxs
make && make install
LoadModule mpm_itk_module modules/mpm_itk.so
<VirtualHost *:8080>
ServerAdmin webmaster@baidu.com
DocumentRoot "/home/qiang/"
ServerName 95.211.111.66
<IfModule mpm_itk_module>
AssignUserId qiang qiang
</IfModule>
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error_log"
CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>
./configure --prefix=/usr/local/http --enable-so --enable-ssl --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-modules=most --enable-mods-shared=most --enable-mpms-shared=all --with-mpm=event
tail access_log.log -n50000|grep "a=pEnd" |awk '{print $1}' | sort | uniq -c | sort -n -k 1 -r | head -n 10
wget https://github.com/openresty/set-misc-nginx-module/archive/v0.29.tar.gz
wget https://github.com/simpl/ngx_devel_kit/archive/v0.2.19.tar.gz
wget --no-check-certificate https://github.com/openresty/redis2-nginx-module/archive/v0.12.tar.gz
./configure --prefix=/usr/local/nginx/ --add-module=/root/pigai_local/redis2-nginx-module-0.12 --add-module=/root/pigai_local/ngx_devel_kit-0.2.19 --add-module=/root/pigai_local/set-misc-nginx-module-0.29
#GET /rget?key=some_key
location = /rget {
set_unescape_uri $key $arg_key; # this requires ngx_set_misc
redis2_query get $key;
redis2_pass 127.0.0.1:6379;
default_type text/plain;
}
# GET /rset?key=one&val=first%20value
location = /rset {
set_unescape_uri $key $arg_key; # this requires ngx_set_misc
set_unescape_uri $val $arg_val; # this requires ngx_set_misc
redis2_query set $key $val;
redis2_query EXPIRE $key 86400; # set TTL
redis2_pass 127.0.0.1:6379;
default_type text/plain;
}
wget https://github.com/alibaba/nginx-http-concat/archive/master.zip -O nginx-http-concat-master.zip
unzip nginx-http-concat-master.zip
--prefix=/usr/local/nginx --with-http_ssl_module --add-module=../nginx-http-concat-master
2013-9-30
192.168.1.22 117.79.131.115
php /home/cikuu/bin/cmd/essay_delta_index.php http://so.pigai.org:8983/solr/pigai 303560
php /home/cikuu/bin/cmd/essay_delta_index.php http://so.pigai.org:8983/solr/pigai 303320
303560,303320
删除 rid=285852 的所有记录
http://so.pigai.org:8983/solr/pigai/update?stream.body=<delete><query>rid:285852</query></delete>&commit=true
curl "http://192.168.1.17:7080/dsk?p=snt&q=10053184"
http://debug.pigai.org:7093/feedback?q=[%22It%20is%20ok%20.%22,%20%22I%20learn%20English%20knowledges.%22]
修改密码
/usr/local/rabbitmq/sbin/rabbitmqctl change_password root mima
关闭
/usr/local/rabbitmq/sbin/rabbitmqctl stop
启动
/usr/local/rabbitmq/sbin/rabbitmq-server -detached
日志管理 基本不可行他会复制log 而且队列停止工作
/usr/local/rabbitmq/sbin/rabbitmqctl rotate_logs .201512.log
cd home/cikuu/xijinling/status/server
sh consume.sh stop
sh consume.sh start
/usr/local/php/bin/php -f /data/app/fxphp/apps/pigai.com/crontab/mq_test.php error 10
#清空
/usr/local/php/bin/php -f /data/app/fxphp/apps/pigai.com/crontab/mq_test.php error
查看sql错误日志 55或者20
tail /data/app/fxphp/lib/sql.error
全德 在55或者20执行
http://www.pigai.org/index.php?c=teacher&a=viewStudent&viewbyclass=&ex=excel&info=1&rid=620013
http://qq.pigai.org/index.php?c=naew&a=pmHowMany&frid=611108
http://qq.pigai.org/index.php?c=naew&a=pmSchool&frid=611108
http://qq.pigai.org/index.php?c=naew&a=pmScore&frid=611108&limit=20
http://www.pigai.org/?c=bwtt&a=ying&frid=10086&rid=10087&uid=17
/sbin/iptables -I INPUT -s 166.111.106.203 -p TCP --dport 80 -j DROP
/sbin/iptables -I INPUT -s 58.23.129.212 -p TCP -j DROP
/sbin/iptables -I INPUT -s 198.148.93.0/24 -p TCP -j DROP
/sbin/iptables -A INPUT -p ALL -s 222.171.12.70 -j DROP
/sbin/iptables -A output -p ALL -d 222.171.12.70 -j DROP
/sbin/iptables -A OUTPUT -p ALL -d 222.171.12.70 -j DROP
/sbin/iptables -A INPUT -p ALL -s 202.89.233.70 -j DROP
/sbin/iptables -A INPUT -p ALL -s 202.89.233.70 -j DROP
tc qdisc add dev eth0 root handle 1: cbq bandwidth 5Mbit avpkt 1000 cell 8 mpu 64
tc qdisc add dev eth0 root handle 1: htb r2q 1
tc class add dev eth0 parent 1: classid 1:1 htb rate 2Mbit ceil 5Mbit
tc filter add dev eth0 parent 1: protocol ip prio 16 u32 match ip src 117.79.131.116 flowid 1:1
http://blog.csdn.net/windex2000/article/details/8745046
/proc/sys/net/ipv4/ip_conntrack_max
echo "65536" >/proc/sys/net/ipv4/ip_conntrack_max
2.6内核
cat /proc/sys/net/ipv4/netfilter/ip_conntrack_max
flush hosts;
find ./ -type f -name ".php" -user www | xargs grep "eval("
find ./ -type f -name ".php" | xargs grep -E "eval"
vi /etc/sysctl.conf
sysctl -p
/sbin/sysctl -a | grep _syn
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_max_syn_backlog = 65535
net.core.netdev_max_backlog = 32768
net.core.somaxconn = 32768
http://zbszone.iteye.com/blog/826199
netstat -anp |awk '{print $6}'|sort|uniq -c |sort -rn
查看 SYN_* 数字
netstat -anp|grep "TIME_WAIT"|awk '{print $5}'|sort|uniq -c |sort -rn|more
netstat -anp|grep "FIN_WAIT2"|awk '{print $5}'|sort|uniq -c |sort -rn|more
查看time wait 资源损耗在哪些地方
tcp_max_syn_backlog 相对重要
sysctl 调优 相关书面
http://www.cnblogs.com/sunxucool/p/3449068.html
TIME_WAIT 太多调整
http://kerry.blog.51cto.com/172631/105233/
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 3600
#查看 fpm 是否是 预先设定的值
netstat -anpo | grep "php-fpm" | wc -l
firewall-cmd --permanent --add-port=80/tcp
service firewalld restart
2013-11-5
ALTER TABLE `member_info` ADD `hidden_tj` TINYINT( 1 ) NOT NULL DEFAULT '0' COMMENT '0不隐藏,1隐藏',
ADD `hidden_doc` TINYINT( 1 ) NOT NULL DEFAULT '0' COMMENT '0不文档,1隐藏',
ADD `term_end_time` INT( 10 ) NOT NULL DEFAULT '0' COMMENT '学期结束时间'
/usr/local/mysql/bin/myisamchk -of /home/mysql/pigai_org/essay_kp_2012_12.MYI
File: mysql-bin.000011
Position: 107
Binlog_Do_DB: pigai_org,pigai_spss,mem,web1t
Binlog_Ignore_DB: mysql,pigai_tmp,test,catti
change master to master_host='192.168.1.54',master_user='rep',master_password='rep123', master_log_file='mysql-bin.000011', master_log_pos=107;
show processlist;
SELECT id,user, host, time, command, state,info FROM information_schema.processlist WHERE state ='Waiting for table level lock';
SELECT id,user, host, time, command, state,info FROM information_schema.processlist WHERE state ='Sending data';
#救命用的当发现登录不进来的时候 修改连接数
gdb -p $(pidof mysqld) -ex "set max_connections=1500" -batch
show variables like 'max_connections';
show status like 'Max_used_connections';
set global max_connections=1000;
show variables like 'wait_timeout';
set global wait_timeout=10000;
1.挂公告
将主web 切换 修改nginx conf/null.pigai.org 修改 root /data/app/default (【22】117.79.131.106、【55】117.79.131.105)
公共信息在 批改网的 notice.html 里面2.找另外一台 从db当主DB
执行 show master status\G
将信息copy出来
如 *********************** 1. row ***********************
File: mysql-bin.001990
Position: 1707
Binlog_Do_DB: pigai_org,pigai_spss,mem,web1t
Binlog_Ignore_DB: mysql,pigai_tmp,test,catti
------------------------------
3.修改php 主DB信息(变更 新DB信息)主要在 conf目录下 并更新到svn下4.测试:在103先测试下 测试通过后
5.修改web nginx的配置切换回来 重新nginx 可能要重新下 php
6.在其他 从DB上 修改更换主db信息
change master to master_host='主DBip',master_user='rep',master_password='rep123', master_log_file='mysql-bin.000011', master_log_pos=107;
master_log_file 、master_log_pos 信息时通过上面的 master status来的
7.在108上 修改配置Atlas
调整 vim conf/test.cnf 主要是主从DB的选择
Atlas 维护
https://github.com/Qihoo360/Atlas/wiki/Atlas%E7%9A%84%E8%BF%90%E8%A1%8C%E5%8F%8A%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98
执行命令:mysql -h127.0.0.1 -P1234 -u用户名 -p密码,如果能连上则证明Atlas初步测试正常,可以再尝试发几条SQL语句看看执行结果是否正确。
进入Atlas的管理界面的命令:mysql -h127.0.0.1 -P2345 -uuser -ppwd,进入后执行:select * from help;查看管理DB的各类命令。
添加 可以普通登录的用户
use msg;
db.createUser( { "user" : "msg",
"pwd": "cikuutest!",
"customData" : { employeeId: 12345 },
"roles" : [ { role: "clusterAdmin", db: "admin" },
{ role: "readAnyDatabase", db: "admin" },
"readWrite"
] },
{ w: "majority" , wtimeout: 5000 } )
db.sys_msg.ensureIndex({"ct":1},{"expireAfterSecs":60*60*24*180});
修改属性
ALTER TABLE essay_kp UNION=(`essay_kp_2011`,`essay_kp_2012`,`essay_kp_2012_5`,`essay_kp_2012_9`,`essay_kp_2012_11`,`essay_kp_2012_12`,essay_kp_2013_10);
ALTER TABLE essay_snt UNION=(`essay_snt_2011`,`essay_snt_2012`,`essay_snt_2012_5`,`essay_snt_2012_9`,essay_snt_2013_10);
ALTER TABLE essay_feedback UNION=(`essay_feedback_2011`,`essay_feedback_2012`,`essay_feedback_2012_9`,`essay_feedback_2013_5` ,`essay_feedback_2013_10`,`essay_feedback_2013_12` ,`essay_feedback_2014_4`);
增加了 2014-5
将 _2011 _2012 退出
ALTER TABLE essay_snt UNION=(`essay_snt_2012_5`,`essay_snt_2012_9`,essay_snt_2013_10,essay_snt_2014_5);
ALTER TABLE essay_snt_all UNION=(`essay_snt_2011`,`essay_snt_2012`,`essay_snt_2012_5`,`essay_snt_2012_9`,`essay_snt_2013_10`,`essay_snt_2014_5`);
ALTER TABLE essay_feedback UNION=(`essay_feedback_2012_9`,`essay_feedback_2013_5` ,`essay_feedback_2013_10`,`essay_feedback_2013_12` ,`essay_feedback_2014_4`,`essay_feedback_2014_5`);
ALTER TABLE essay_feedback_all UNION=(`essay_feedback_2011`,`essay_feedback_2012`,`essay_feedback_2012_9`,`essay_feedback_2013_5`,`essay_feedback_2013_10`,`essay_feedback_2013_12`,`essay_feedback_2014_4`,`essay_feedback_2014_5`)
ALTER TABLE essay_feedback UNION=( `essay_feedback_2013_10`,`essay_feedback_2013_12` ,`essay_feedback_2014_4`,`essay_feedback_2014_5`,`essay_feedback_2014_8` );
ALTER TABLE essay_feedback_all UNION=(`essay_feedback_2011`,`essay_feedback_2012`,`essay_feedback_2012_9`,`essay_feedback_2013_5`,`essay_feedback_2013_10`,`essay_feedback_2013_12`,`essay_feedback_2014_4`,`essay_feedback_2014_5`,`essay_feedback_2014_8`);
ALTER TABLE essay_snt UNION=(essay_snt_2013_10,essay_snt_2014_5,essay_snt_2014_8);
ALTER TABLE essay_snt_all UNION=(`essay_snt_2011`,`essay_snt_2012`,`essay_snt_2012_5`,`essay_snt_2012_9`,`essay_snt_2013_10`,`essay_snt_2014_5`,essay_snt_2014_8);
ALTER TABLE essay_snt UNION=(essay_snt_2013_10,essay_snt_2014_5,essay_snt_2014_8,essay_snt_2015_5);
#在主服务器上吧 `essay_feedback_2012_9`,`essay_feedback_2013_5` 移除 ssd
#在主服务器上吧 `essay_snt_2012_5`,`essay_snt_2012_9` 移除 ssd
ALTER TABLE essay_feedback UNION=( `essay_feedback_2013_12` ,`essay_feedback_2014_4`,`essay_feedback_2014_5`,`essay_feedback_2014_8`,`essay_feedback_2014_11` );
ALTER TABLE essay_feedback_all UNION=(`essay_feedback_2011`,`essay_feedback_2012`,`essay_feedback_2012_9`,`essay_feedback_2013_5`,`essay_feedback_2013_10`,`essay_feedback_2013_12`,`essay_feedback_2014_4`,`essay_feedback_2014_5`,`essay_feedback_2014_8`,`essay_feedback_2014_11`);
ALTER TABLE `eng_essay_version` UNION=(`eng_essay_version_2014`,`eng_essay_version_2014_5`,`eng_essay_version_2015`);
stop slave;set global sql_slave_skip_counter =1 ;start slave;show slave status\G
ALTER TABLE `eng_essay_version` UNION=(`eng_essay_version_2014`,`eng_essay_version_2014_5`,`eng_essay_version_2015`,`eng_essay_version_2015_9`);
ALTER TABLE essay_snt UNION=(essay_snt_2013_10,essay_snt_2014_5,essay_snt_2014_8,essay_snt_2015_5, essay_snt_2015_9);
ALTER TABLE essay_feedback2 UNION=(`essay_feedback2_2014`,`essay_feedback2_2015`,`essay_feedback2_2015_9`);
essay_snt_2013_10去掉了
ALTER TABLE essay_snt UNION=(essay_snt_2014_5,essay_snt_2014_8,essay_snt_2015_5, essay_snt_2015_9);
ALTER TABLE essay_snt_all UNION=(`essay_snt_2011`,`essay_snt_2012`,`essay_snt_2012_5`,`essay_snt_2012_9`,
`essay_snt_2013_10`,`essay_snt_2014_5`);
ALTER TABLE `eng_essay_version` UNION=(`eng_essay_version_2014`,`eng_essay_version_2014_5`,`eng_essay_version_2015`,`eng_essay_version_2015_9` , eng_essay_version_2016_5 );
ALTER TABLE `eng_essay_version` UNION=(`eng_essay_version_2014`,`eng_essay_version_2014_5`,`eng_essay_version_2015`,`eng_essay_version_2015_9` , eng_essay_version_2016_5,eng_essay_version_2017_4,eng_essay_version_2017_7 );
TRUNCATE TABLE essay_kp_2011;
TRUNCATE TABLE essay_kp_2012;
TRUNCATE TABLE essay_kp_2012_5;
TRUNCATE TABLE essay_kp_2012_9;
TRUNCATE TABLE essay_kp_2012_12;
TRUNCATE TABLE essay_feedback_2012_9;
TRUNCATE TABLE essay_feedback_2013_5;
TRUNCATE TABLE essay_feedback_2013_10;
批改网触发器 目前只在 192.168.1.22上
CREATE TABLE IF NOT EXISTS `member` (
`id` int(11) NOT NULL,
`ct` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS eng_essay (
`id` int(11) NOT NULL,
`ct` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS eng_essay_request (
`id` int(11) NOT NULL,
`ct` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
select TRIGGER_NAME as `name`,EVENT_OBJECT_SCHEMA as tb ,EVENT_MANIPULATION as `event`,ACTION_STATEMENT as ac FROM information_schema.`TRIGGERS`\G
delimiter $
create trigger tg_member
after insert on member
for each row
begin
replace into tg.member (id ) VALUES( new.user_id );
end$
delimiter $
create trigger tg_member_update
after update on member
for each row
begin
replace into tg.member (id ) VALUES( old.user_id );
end$
delimiter $
create trigger tg_member_info_update
after update on member_info
for each row
begin replace into tg.member (id ) VALUES( old.user_id ); end$
delimiter $
create trigger tg_eng_essay_update
after update on eng_essay
for each row
begin replace into tg.eng_essay (id ) VALUES( old.essay_id ); end$
delimiter $
create trigger tg_eng_essay_request
after insert on eng_essay_request
for each row
begin replace into tg.eng_essay_request (id ) VALUES( new.request_id ); end$
delimiter $
create trigger tg_eng_essay_request_update
after update on eng_essay_request
for each row
begin replace into tg.eng_essay_request (id ) VALUES( old.request_id ); end$
如果 webstrom 需要 angular 支持需要
1.npm install --save angular 支持标签
2.需要在 file->setting->Langule***Frameworks->javascript->Librarier->download->angularjs
http://www.cnblogs.com/powertoolsteam/p/angularjs-introdection.html