How can I completely remove a hazelcast map from a Hazelcast cluster running externally from my applications? - external

I am working on a project to externalize some of our maps with an external cluster using the client/server topology provided by Hazelcast. We are using version 5.2. I want to build an endpoint or use some api provided by Hazelcast to allow me to completely remove the map in the external cluster. I don't see anywhere in the Hazelcast Management Center where you can delete maps or any API that allows me to do this.
I don't want to just evict entries I want to remove them and completely get rid of the map. I also don't want to bring the cluster down.
I have tried getting the map from the instance and calling destroy with my local external cluster and that also doesn't seem to work.
externalHazelcastInstance.getMap("mapOfStuff").destroy();
It will evict the entries but the map is still there.
I have found that I can enable the REST api with my NetworkConfig but there doesn't seem to be a solution there either.

Related

Enable google maps api key in production environment

I made a flask app and deployed it to a linux server on Linode. It is running and some of my pages are working. For example, the contact page works. However, some of them have an inset google map. Upon loading one of these pages, my map is visible for a split second, then a big gray exclamation! and the map is blocked.
While testing the app using Flask's built in development server in my remote environment, all my functionality worked. When moving to a production environment, I used nginx and gunicorn. And I think I did it correctly. Judging that I do see the google maps working for just a second, it looks like this is not the issue.
Do I need to enable my google maps javascript api key for the production environment somehow?
When I have a look at your source code, I see
https://maps.googleapis.com/maps/api/js?key=None&callback=initMap
So, you did not add the API key, so it cannot work.
Please see https://developers.google.com/maps/documentation/javascript/get-api-key for how to get a key.

Custom marker missing ... sometimes

We're using the static google maps API and things were going fine when suddenly it started getting hiccups with our custom marker icon. Sometimes it get's displayed as intended, sometimes we end up with the default marker and the yellow banner in the upper right corner stating: "Map error: g.co/staticmaperror".
Taking a look at the headers we found that google seems to have issues fetching our marker image:
x-staticmap-api-warning: Failed to fetch image url https://www.xyz.de/some_image.png
I can fire the very same request n times and get some m <= n responses that are fine and some o <= n requests that have the above mentioned issue. This seems to me like google has some issues caching the image.
I have no issues requesting the marker image from our servers, though. There are no firewall rules that fire. The marker image has a high cache-control max-age and a fine etag, it expires two weeks from now. There's nothing fancy about it.
The maps request looks like this:
https://maps.googleapis.com/maps/api/staticmap?key=<OUR_KEY>&size=260x130&maptype=roadmap&format=png&visual_refresh=true&zoom=10&markers=icon:https://www.xyz.de/some_image.png|52.52008961%2C13.40465566&signature=<SIG>
Nothing fancy here either.
Since SO seems to be the official google support now, may some google techie please help?
As it turns out our application firewall actually blocked some requests from Google and we have to add some more rules. (Although we think we checked that twice already.)
Sadly, there's no fixed IP range for the maps services. But let me share with you what the support told me:
Google Cloud Support
It is not possible to provide a specific list of IP addresses that must be accessible in order to use the Maps APIs, because Google services are not tied to specific hosts or IP addresses in our data centers.
Services are migrated between data centers depending on load, maintenance schedules, and growth. The particular data center that a specific request is routed to depends on the user's geographical location, network location, and the relative load on nearby data centers currently hosting the service concerned, and on the network links that connect them.
If you need to add IP based firewall rules, your only option is to whitelist Google's entire network allocation, which can be obtained using the following command from a Unix system:
$ dig +short _spf.google.com txt
The answer will include some text like:
"v=spf1 include:_netblocks.google.com include:_netblocks2.google.com include:_netblocks3.google.com ~all"
Be sure to follow the includes for all the netblocks e.g.
$ dig +short _netblocks.google.com txt
$ dig +short _netblocks2.google.com txt
$ dig +short _netblocks3.google.com txt
The answer section lists all IP address blocks in CIDR notation.
This list changes several times a year as servers are added and removed, and it is your responsibility to track those changes and update your firewall accordingly. (We recommend that you do so every quarter).
In general it is much easier to set firewall rules based on the list of hostnames used by the Maps API, which is more stable.
Another way to fix this would be to make an exception for this static resource (the marker icon).
It looks like you were affected by this issue that was reported in Google's Issue Tracker about a month ago and has since been fixed.
If you are still getting that "failed to fetch image url" error at times though, I recommend you comment on that bug so that Google techies can look into this further from their side.
Hope this helps!

How to get a Google Place using a placeId on Flutter?

I'm trying to find a function that would allow me to get a Google Place only using a placeId (and the apiKey of course).
I found the function GeoDataClient.getPlaceById(placeId) but unfortunately this doesn't seem to be available on Flutter. I am currently using the flutter_google_places dart package but am open to using something different if necessary.
I can't find one. It seems like something of a large gap in the ecosystem -- if you store a Google Place ID in your local database, you should be able to convert that into a place name and a location when you reload it.
The iOS equivalent of GeoDataClient is the Places SDK for iOS: https://developers.google.com/places/ios-sdk/intro.
I may write a plugin for this and add it to pub.dev. Unless you've found a better solution since you posted this question, this seems like the best available approach at the moment.
With that said, however, connecting to the Google Places SDK requires a network connection, so if you want optimal performance, you should try to keep invocations of the SDK bridge to a bare minimum, and ideally keep place details in a local SQLite database. This way, users will only be invoking the SDK bridge after loading the app on a new device.

know when a service fabric windows container is being shut down

I can't see any options in the VS project to add any code logic to determine when a container is being shutdown/moved in service fabric.
The only thing I can see this work, would be to have a reliable service in the container, and then override the OnCloseAsync()
Does this sound right/feasible? Are reliable services, in windows containers, available yet?
You can run a service inside a container. This features is currently in preview.
Another way that may work is to register a notification callback for endpoint changes. When a service is moved, or removed, its endpoint changes.

Get underlying image name for Google Cloud Launcher deployment

I'd like to deploy MongoDB in Google Cloud Compute Engine using terraform. Since this is an experimental setup, I'd like to use some pre-configured image to save time. Browsing through Google Cloud Launcher I've found this MongoDB deployments.
After some more Googling I've found this Google Deployment Manager example, where I found project name for Cloud Launcher images: click-to-deploy.
Using it I've managed to list all MongoDB click-to-deploy images:
gcloud compute images list --project click-to-deploy-images --regexp mongodb.+ --uri
Which gave me this list:
https://www.googleapis.com/compute/v1/projects/click-to-deploy-images/global/images/mongodb-3-2-debian-8-jessie-20161006-083532
https://www.googleapis.com/compute/v1/projects/click-to-deploy-images/global/images/mongodb-3-2-debian-8-jessie-20161111-154124
https://www.googleapis.com/compute/v1/projects/click-to-deploy-images/global/images/mongodb-3-4-debian-8-jessie-20170117-113500
https://www.googleapis.com/compute/v1/projects/click-to-deploy-images/global/images/mongodb-3-4-debian-8-jessie-20170119-150929
https://www.googleapis.com/compute/v1/projects/click-to-deploy-images/global/images/mongodb-32-1607281513-debian-8-jessie-v20160718
https://www.googleapis.com/compute/v1/projects/click-to-deploy-images/global/images/mongodb-cloud-manager-bootstrap-ubuntu-v20160516a
But there is no way to correlate these images to Cloud Launcher deployments. I've thought about using image/deployment timestamps for this, but unfortunately they don't match.
So, the question is, how to get underlying image for Google Cloud Launcher deployment?
This is not the answer I was hoping for, but it's the best I've got for now.
You have to deploy VM using Google Cloud Launcher and grab image name afterwards from Google Deployment Manager. To do so, you have to expand Template details and click on template type (mongodb.jinja in my case).
It's also gives you a complete Deployment Manager config (with metadata, scripts and other stuff).
Here is the screenshot: