This file contains hidden or 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
| # create a three node Cassandra Cluster | |
| # the following command will create a cluster with Cassandra verion: 3.11.10, with 3 nodes, and start the cluster | |
| python ccm.py create test -v 3.11.10 -n 3 -s | |
| # view the status of the ring from node1's perspective, you can change to node2, node3 accordingly | |
| python ccm.py node1 ring | |
| # start a cqlsh connected to node1 | |
| python ccm.py node1 cqlsh | |
| # stop node2 | |
| python ccm.py node2 stop | |
| # start node2 |
This file contains hidden or 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
| # activate ccm_env env | |
| conda activate ccm_env | |
| # install psutil | |
| pip install psutil | |
| # install ccm, which will install pyYAML and six | |
| pip install ccm |
This file contains hidden or 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
| # create ccm_env env by clone base env | |
| conda create --name ccm_env --clone base | |
| # list env | |
| conda env list |
This file contains hidden or 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
| -- begin new transaction; expect lost connection error here. | |
| begin; | |
| -- new transaction should succeed | |
| begin; | |
| insert into test values (22); | |
| commit; |
This file contains hidden or 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
| begin; | |
| insert into test values (21); | |
| commit; |
This file contains hidden or 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
| # open a bash to our test conainer | |
| docker exec -it db_backend_switch_nose_1 bash | |
| # in the bash shell connect to proxysql admin | |
| mysql -usbtest1 -ppassword -hproxysql -P6032 | |
| # view the current query rules | |
| SELECT destination_hostgroup,apply FROM mysql_query_rules WHERE username='sbtest1'; | |
| # swtich to hostgroup 20 | |
| UPDATE mysql_query_rules SET destination_hostgroup=20 WHERE username='sbtest1'; | |
| # apply the changes |
This file contains hidden or 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
| # open a bash to our test conainer | |
| docker exec -it db_backend_switch_nose_1 bash | |
| # in the bash shell connect to mysql db via proxysql | |
| mysql -usbtest1 -ppassword -hproxysql -P6033 | |
| # turn off autocommit | |
| set autocommit=0; | |
| # start long running transaction | |
| begin; | |
| insert into test values (11); |
This file contains hidden or 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
| # open a bash to our test conainer | |
| docker exec -it db_backend_switch_nose_1 bash | |
| # in the bash shell connect to db1 directly | |
| mysql -usbtest1 -ppassword -hdb1 | |
| # run the following sql to create our test table in db1 | |
| create table test(id int primary key); | |
| # in the bash shell connect to db2 directly | |
| mysql -usbtest1 -ppassword -hdb2 |
This file contains hidden or 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
| CREATE OR REPLACE FUNCTION akka_projection.textToTimestamp ( | |
| input TEXT | |
| ) | |
| CALLED ON NULL INPUT | |
| RETURNS Timestamp | |
| LANGUAGE java AS | |
| $$ | |
| final long NUM_100NS_INTERVALS_SINCE_UUID_EPOCH = 0x01b21dd213814000L; | |
| UUID uuid = UUID.fromString(input); |
This file contains hidden or 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
| sed -i -r 's/enable_user_defined_functions: false/enable_user_defined_functions: true/' /etc/cassandra/cassandra.yaml |
NewerOlder