[ 
https://issues.apache.org/jira/browse/CASSANDRA-18438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17742299#comment-17742299
 ] 

Jackson Fleming edited comment on CASSANDRA-18438 at 7/12/23 7:37 AM:
----------------------------------------------------------------------

Tested the GCP snitch, looks good on my end

!image-2023-07-12-17-28-24-723.png!

 

The following log line was present on startup
{code:java}
INFO  [main] 2023-07-12 07:23:09,575 AbstractCloudMetadataServiceSnitch.java:59 
- org.apache.cassandra.locator.GoogleCloudSnitch using datacenter: us-central1, 
rack: a, connector: 
org.apache.cassandra.locator.AbstractCloudMetadataServiceConnector$DefaultCloudMetadataServiceConnector{metadata_url=http://metadata.google.internal,metadata_request_timeout=30000},
 properties: SnitchProperties{properties={rack=rack1, dc=dc1}} {code}
The following test steps were performed:
1 - Sanity testRan with SimpleSnitch to make sure Cassandra is built and setup 
correctly.

 
{code:java}
~/apache-cassandra-5.0-SNAPSHOT/bin$ ./nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load        Tokens  Owns (effective)  Host ID                    
           Rack 
UN  127.0.0.1  116.43 KiB  16      100.0%            
3b90fbed-fff1-4499-84b1-28cfe63cd93e  rack1 
{code}
So we know it's built correctly and working.

 

2 - Next update the snitch name to GoogleCloudSnitch in cassandra.yml. Clear 
the data directories with rm -rf data/*, start up Cassandra. Run nodetool status
{code:java}
~/apache-cassandra-5.0-SNAPSHOT/bin$ ./nodetool status
Datacenter: us-central1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns (effective)  Host ID                     
          Rack
UN  127.0.0.1  116.4 KiB  16      100.0%            
ed234a02-4af3-433c-950f-cbec23c87fb6  a  {code}
 
I have attached full startup logs as well, incase they are useful. 
[https://pastebin.com/LUM42X3W] (this Jira won't let me upload a log file, if 
pastebin is not appropriate just let me know how I can provide them).

 


was (Author: JIRAUSER294685):
Tested the GCP snitch, looks good on my end

!image-2023-07-12-17-28-24-723.png!

 

The following log line was present on startup
{code:java}
INFO  [main] 2023-07-12 07:23:09,575 AbstractCloudMetadataServiceSnitch.java:59 
- org.apache.cassandra.locator.GoogleCloudSnitch using datacenter: us-central1, 
rack: a, connector: 
org.apache.cassandra.locator.AbstractCloudMetadataServiceConnector$DefaultCloudMetadataServiceConnector{metadata_url=http://metadata.google.internal,metadata_request_timeout=30000},
 properties: SnitchProperties{properties={rack=rack1, dc=dc1}} {code}
The following test steps were performed:
1 - Sanity testRan with SimpleSnitch to make sure Cassandra is built and setup 
correctly.

 
{code:java}
~/apache-cassandra-5.0-SNAPSHOT/bin$ ./nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load        Tokens  Owns (effective)  Host ID                    
           Rack 
UN  127.0.0.1  116.43 KiB  16      100.0%            
3b90fbed-fff1-4499-84b1-28cfe63cd93e  rack1 


{code}
So we know it's built correctly and working.

2 - Next update the snitch name to GoogleCloudSnitch in cassandra.yml. Clear 
the data directories with rm -rf data/*, start up Cassandra. Run nodetool status

 
{code:java}
~/apache-cassandra-5.0-SNAPSHOT/bin$ ./nodetool status
Datacenter: us-central1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns (effective)  Host ID                     
          Rack
UN  127.0.0.1  116.4 KiB  16      100.0%            
ed234a02-4af3-433c-950f-cbec23c87fb6  a  {code}
 
 
I have attached full startup logs as well, incase they are useful. 
[https://pastebin.com/LUM42X3W] (this Jira won't let me upload a log file, if 
pastebin is not appropriate just let me know how I can provide them).

 

> Refactor cloud snitches to get rid of duplicate code
> ----------------------------------------------------
>
>                 Key: CASSANDRA-18438
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18438
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Local/Other
>            Reporter: Maxwell Guo
>            Assignee: Stefan Miklosovic
>            Priority: Normal
>             Fix For: 5.x
>
>         Attachments: alicloud-snitch.png, image-2023-07-12-17-28-24-723.png, 
> image-2023-07-12-17-30-53-158.png, image-2023-07-12-17-31-37-447.png
>
>          Time Spent: 5h 50m
>  Remaining Estimate: 0h
>
> Nowadays we have got about four public cloud platform snitchs : EC2 snitch 
> for aws, google cloud snitch for google cloud, alibaba cloud snitch for 
> alibaba cloud and multi region snitch for ec2. And the common place for the 
> first three is that we just need to query the zone center to get the ec2 / 
> ecs id , so I think we can refactor the code , and  if some new public cloud 
> platform want to add one more snitch for himself, there is no need to pull a 
> pr for him and  configure some options in yaml is enough .
> Besides it would be even better that we may reuse the multic region snitch 
> for ec2 for other public cloud platform.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to