Skip to content

Commit 13f37d7

Browse files
committed
update
1 parent d460891 commit 13f37d7

File tree

10 files changed

+914
-11
lines changed

10 files changed

+914
-11
lines changed

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Java template
3+
# Compiled class file
4+
*.class
5+
6+
# Log file
7+
*.log
8+
9+
# BlueJ files
10+
*.ctxt
11+
12+
# Mobile Tools for Java (J2ME)
13+
.mtj.tmp/
14+
15+
# Package Files #
16+
*.jar
17+
*.war
18+
*.ear
19+
*.zip
20+
*.tar.gz
21+
*.rar
22+
23+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
24+
hs_err_pid*
25+

doc/hacked.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 2017-09-23
2+
服务器被黑,进程占用率高达99%,查看了一下,是/usr/sbin/bashd的原因,怎么删也删不掉,使用ps查看:
3+
![](http://ohlrxdl4p.bkt.clouddn.com/images/553ac1ca20170923033013.png)
4+
stratum+tcp://get.bi-chi.com:3333 -u 47EAoaBc5TWDZKVaAYvQ7Y4ZfoJMFathAR882gabJ43wHEfxEp81vfJ3J3j6FQGJxJNQTAwvmJYS2Ei8dbkKcwfPFst8FhG
5+
6+
使用top查看:
7+
![](http://ohlrxdl4p.bkt.clouddn.com/images/20170923033252.png)
8+
9+
<div align="center">
10+
11+
![](http://ohlrxdl4p.bkt.clouddn.com/images/20170923034427.png)
12+
13+
</div>
14+
15+
<div align="center">
16+
17+
![](http://ohlrxdl4p.bkt.clouddn.com/images/20170923040503.png)
18+
19+
</div>
20+
21+
启动iptables,参考[http://www.setphp.com/981.html](http://www.setphp.com/981.html)
22+
[http://www.setphp.com/981.html](http://www.setphp.com/981.html)
23+
24+
iptables -A INPUT -s xmr.crypto-pool.fr -j DROP
25+
iptables -A OUTPUT -d xmr.crypto-pool.fr -j DROP
26+
27+
28+

doc/images/.png

20.4 KB
Binary file not shown.

doc/images/553ac1ca.png

7.98 KB
Loading
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.myblog.datasource;
2+
3+
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
4+
5+
/**
6+
* Created with IntelliJ IDEA.
7+
* User: Zephery
8+
* Time: 2017/9/23 12:00
9+
* Description:
10+
*/
11+
public class DynamicDataSource extends AbstractRoutingDataSource {
12+
13+
@Override
14+
protected Object determineCurrentLookupKey() {
15+
// 从自定义的位置获取数据源标识
16+
return DynamicDataSourceHolder.getDataSource();
17+
}
18+
19+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.myblog.datasource;
2+
3+
/**
4+
* Created with IntelliJ IDEA.
5+
* User: Zephery
6+
* Time: 2017/9/23 12:00
7+
* Description:
8+
*/
9+
public class DynamicDataSourceHolder {
10+
/**
11+
* 注意:数据源标识保存在线程变量中,避免多线程操作数据源时互相干扰
12+
*/
13+
private static final ThreadLocal<String> THREAD_DATA_SOURCE = new ThreadLocal<String>();
14+
15+
public static String getDataSource() {
16+
return THREAD_DATA_SOURCE.get();
17+
}
18+
19+
public static void setDataSource(String dataSource) {
20+
THREAD_DATA_SOURCE.set(dataSource);
21+
}
22+
23+
public static void clearDataSource() {
24+
THREAD_DATA_SOURCE.remove();
25+
}
26+
27+
}

src/main/resources/applicationContext.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
</bean>
3131
<!-- 配置数据源,使用阿里巴巴连接池Druid -->
3232
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
33-
<property name="url" value="${jdbc.url}"/>
34-
<property name="username" value="${jdbc.username}"/>
35-
<property name="password" value="${jdbc.password}"/>
33+
<property name="url" value="${jdbc.url_2}"/>
34+
<property name="username" value="${jdbc.username_2}"/>
35+
<property name="password" value="${jdbc.password_2}"/>
3636
<!--配置这些才能使用druid监控-->
3737
<!-- 配置初始化大小、最小、最大 -->
3838
<property name="initialSize" value="1"/>

src/main/resources/load.properties

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
11
# mysql
22
jdbc.driverClassName=com.mysql.jdbc.Driver
3-
jdbc.url=jdbc:mysql://47.95.10.139:3306/myblog?useUnicode=true&characterEncoding=UTF-8
4-
jdbc.host=47.95.10.139
5-
jdbc.username=root
6-
jdbc.password=helloroot
7-
jdbc.database=myblog
3+
# jdbc1
4+
jdbc.url_1=jdbc:mysql://47.95.10.139:3306/myblog?useUnicode=true&characterEncoding=UTF-8
5+
jdbc.host_1=47.95.10.139
6+
jdbc.username_1=root
7+
jdbc.password_1=helloroot
8+
jdbc.database_1=myblog
9+
10+
#jdbc2
11+
jdbc.url_2=jdbc:mysql://119.23.46.71:3306/myblog?useUnicode=true&characterEncoding=UTF-8
12+
jdbc.host_2=119.23.46.71
13+
jdbc.username_2=root
14+
jdbc.password_2=helloroot
15+
jdbc.database_2=myblog
16+
817
#server
918
#remember to update or change
10-
server.host=47.95.10.139
19+
server.host=119.23.46.71
1120
server.username=wenzhihuai
1221
server.password=wenzhihuai
1322
# redis
14-
host=47.95.10.139
23+
host=119.23.46.71
1524
port=6379
1625
password=root
1726
timeout=5000
1827
maxIdle=8
1928
minIdle=0
2029
maxWait=8
2130
#Jmx
22-
jmx_ip=47.95.10.139
31+
jmx_ip=119.23.46.71
2332
jmx_port=8888
2433
credentials=monitorRole,tomcat
2534
#设置最大连接数

0 commit comments

Comments
 (0)