MySQL 服务器:
10.224.144.135(主) 10.224.144.138(从)
配置主服务器:编辑/etc/my.cnf
# vi /etc/my.cnf #add for replication log-bin=/var/lib/mysql/log-bin server-id=1 binlog-do-db = test binlog-do-db = CLOPSDB binlog-ignore-db = mysql innodb_flush_log_at_trx_commit=1 sync_binlog=1 #add for replication relay-log=/var/lib/mysql/relay-bin relay-log-index=/var/lib/mysql/relay-bin.index log_slave_updates = 1 auto_increment_increment = 2 auto_increment_offset = 1
保存退出 ,在master机上为slave机添加一同步帐号
#mysql –u root –p Paswod: >grant replication slave on *.* to 'clopsrepl'@'10.224.144.138' identified by 'cscocmse'; >quit
Spring Security Filter Ordering
The order that filters are defined in the chain is very important. Irrespective of which filters you are actually using, the order should be as follows:
ChannelProcessingFilter, because it might need to redirect to a different protocol
SecurityContextPersistenceFilter, so a SecurityContext can be set up in the SecurityContextHolder at the beginning of a web request, and any changes to the SecurityContext can be copied to the HttpSession when the web request ends (ready for use with the next web request)
ConcurrentSessionFilter, because it uses the SecurityContextHolder functionality and needs to update theSessionRegistry to reflect ongoing requests from the principal
Authentication processing mechanisms - UsernamePasswordAuthenticationFilter, CasAuthenticationFilter,BasicAuthenticationFilter etc - so that the SecurityContextHolder can be modified to contain a valid Authenticationrequest token
Algorithm HmacSHA256 not available
场景:
有一段代码需要访问Amazon,直接执行main方法是没问题的。可是把代码打成jar包,用ProcessBuilder执行java -jar的方式来run的时候,抛出了Exception。
Algorithm HmacSHA256 not available 异常信息
Exception in thread "pool-1-thread-1" com.amazonaws.AmazonClientException: Unable to calculate a
request signature: Unable to calculate a request signature: Algorithm HmacSHA256 not available
at com.amazonaws.auth.AbstractAWSSigner.sign(AbstractAWSSigner.java:81)
at com.amazonaws.auth.AWS4Signer.computeSignature(AWS4Signer.java:289)
at com.amazonaws.auth.AWS4Signer.sign(AWS4Signer.java:127)
at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:646)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:454)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:294)
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.invoke(AmazonDynamoDBClient.java:3106)
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.batchWriteItem(AmazonDynamoDBClient.java:771)
at com.amazonaws.services.dynamodbv2.document.internal.BatchWriteItemImpl.doBatchWriteItem(BatchWriteItemImpl.java:111)
at com.amazonaws.services.dynamodbv2.document.internal.BatchWriteItemImpl.batchWriteItem(BatchWriteItemImpl.java:52)
at com.amazonaws.services.dynamodbv2.document.DynamoDB.batchWriteItem(DynamoDB.java:159)
at com.saasbee.webapp.service.search.DocumentService.store(DocumentService.java:79)
at com.saasbee.webapp.service.search.thread.ParseTaskThread.run(ParseTaskThread.java:97)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: com.amazonaws.AmazonClientException: Unable to calculate a request signature: Algorithm HmacSHA256 not available
at com.amazonaws.auth.AbstractAWSSigner.sign(AbstractAWSSigner.java:91)
at com.amazonaws.auth.AbstractAWSSigner.sign(AbstractAWSSigner.java:79)
... 15 more
Caused by: java.security.NoSuchAlgorithmException: Algorithm HmacSHA256 not available
at javax.crypto.Mac.getInstance(Mac.java:181)
at com.amazonaws.auth.AbstractAWSSigner.sign(AbstractAWSSigner.java:87)
... 16 more
使用ProtoBuffers做数据通信
Proto Buffers 简介
Proto Buffers 是什么?
Protocol buffers are a language-neutral, platform-neutral extensible mechanism for serializing structured data.