This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (InetAddress inetAddress : Collections.list(inetAddresses)) { | |
//init ip string as inet.getHostAddress might be null | |
String ip = "" + inetAddress.getHostAddress(); | |
// VPN connection | |
if(netint.getName().contains("ppp") && !ip.equals("") && ip.length() < 16){ | |
System.out.println("VPN InetAddress: " + ip); | |
return ip; | |
} | |
// Ethernet connection that is IPv4 and starts with 134 / 182 / 10 (private ip ranges) | |
if(netint.getName().contains("eth") && !ip.equals("") && ip.length() < 16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup passwords for keystore / truststore | |
export STOREPASS=somePassword | |
# Cassandra server certificate | |
keytool -genkeypair -alias cassandra_external -keyalg RSA -keysize 1024 -dname "CN=cassandra_external, OU=SSL, O=CompanyName, C=CountryCode" -keystore cassandra_external.jks -storepass $STOREPASS -keypass $STOREPASS | |
keytool -exportcert -alias cassandra_external -file cassandra_external.crt -keystore cassandra_external.jks -storepass $STOREPASS | |
# Cassandra clients' certificate | |
keytool -genkeypair -alias cassandra_client -keyalg RSA -keysize 1024 -dname "CN=cassandra_client, OU=SSL, O=CompanyName, C=CountryCode" -keystore cassandra_client.jks -storepass $STOREPASS -keypass $STOREPASS | |
keytool -exportcert -alias cassandra_client -file cassandra_client.crt -keystore cassandra_client.jks -storepass $STOREPASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# enable or disable client/server encryption. | |
client_encryption_options: | |
enabled: true | |
keystore: location/to/keystore | |
keystore_password: somePassword #the password specified in $STOREPASS | |
# For the purpose of the demo the default settings were used. | |
# More advanced defaults below: | |
protocol: TLS | |
algorithm: SunX509 | |
store_type: JKS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AstyanaxContext<Keyspace> ctx = new AstyanaxContext.Builder() | |
.forKeyspace("MyKeyspace") | |
// Config parameters | |
.withConnectionPoolConfiguration( | |
new com.netflix.astyanax.connectionpool.impl.ConnectionPoolConfigurationImpl("MyConnectionPool") | |
.setSeeds("127.0.0.1") | |
.setSSLConnectionContext( | |
new SSLConnectionContext( | |
"/path/to/certificate/cassandra_external_trust.jks", | |
"somePassword")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.util.concurrent.ExecutionException: java.lang.AssertionError | |
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252) | |
at java.util.concurrent.FutureTask.get(FutureTask.java:111) | |
at org.apache.cassandra.db.compaction.CompactionManager.performAllSSTableOperation(CompactionManager.java:229) | |
at org.apache.cassandra.db.compaction.CompactionManager.performAnticompaction(CompactionManager.java:284) | |
at org.apache.cassandra.db.ColumnFamilyStore.forceAntiCompaction(ColumnFamilyStore.java:1049) | |
at org.apache.cassandra.service.StorageService$4.runMayThrow(StorageService.java:2418) | |
at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) | |
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) | |
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void doAntiCompaction(ColumnFamilyStore cfs, Collection<SSTableReader> sstables, Collection<Range<Token>> ranges) throws IOException | |
{ | |
List<SSTableReader> repairedSSTables = new ArrayList<SSTableReader>(); | |
if (ranges.isEmpty()) | |
{ | |
logger.info("Cannot anti-compact an empty range"); | |
return; | |
} | |
int expectedBloomFilterSize = Math.max(cfs.metadata.getIndexInterval(), (int)(SSTableReader.getApproximateKeyCount(sstables,cfs.metadata))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Data insterted using CQLSH | |
// Connected to Test Cluster at azgdWwx:9160. | |
// [cqlsh 4.0.1 | Cassandra 2.0.0-rc2-SNAPSHOT | CQL spec 3.1.1 | Thrift protocol 19.37.0] | |
// Use HELP for help. | |
// cqlsh> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; | |
// cqlsh> CREATE TABLE test.test (key varchar PRIMARY KEY, value varchar); | |
// cqlsh> INSERT INTO test.test (key, value) VALUES ('zi_key', 'example_value'); | |
[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lyubent:bin me$ ./nodetool cfstats system.local system.schema_columnfamilies system_traces | |
Keyspace: system_traces | |
Read Count: 0 | |
Read Latency: NaN ms. | |
Write Count: 0 | |
Write Latency: NaN ms. | |
Pending Tasks: 0 | |
Column Family: sessions | |
SSTable count: 0 | |
Space used (live): 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lyubent:bin me$ ./nodetool cfstats system system_traces.sessions -i | |
Keyspace: system_traces | |
Read Count: 0 | |
Read Latency: NaN ms. | |
Write Count: 0 | |
Write Latency: NaN ms. | |
Pending Tasks: 0 | |
Column Family: events | |
SSTable count: 0 | |
Space used (live): 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add columns to a column family. | |
* | |
* @param row the columns associated with a row | |
* @param superName name of the super column if any | |
* @param cfamily the column family to add columns to | |
*/ | |
private void addColumnsToCF(List<?> row, ByteBuffer superName, ColumnFamily cfamily) | |
{ | |
CFMetaData cfm = cfamily.metadata(); |
OlderNewer