Bestand wählen

Using Service Discovery to build dynamic python applications

Zitierlink des Filmsegments
Embed Code

Automatisierte Medienanalyse

Erkannte Entitäten
this going and OK and so worked talking talk about service discovery to the we focus on their the client site how we do use service discovery and and I want argue the if you should or not used is service discovery in this talk I want explain how to install the tree technologies that we we over here and I would just focus on their usage and if we have time which we will have as I'm crazy enough to have done the lifetime of soul what matters is that if the it's an
opinionated talk OK so that's my point of view here short introduction about me you can find me on the nick of 4 but a Gentoo Linux developer where I work mostly on just step and and stuff I mean bycatch is not related to no sequel can humans stores or a message to the I'm also secure somebody and we are problematic in that everything marketing and advertising company where over there is a quiz and you can win great stuff so just come around can talk OK so what is service discovery and to make sure you can compare it to what Dionis's for your brother but in a dynamic way when you connect to websites your brother to have to find out the IP address of the votes hosting the website you wanna reach and to do so it doesn't units had beforehand when you're that you belong to a web server web service as and the website you have to configure the genus and register inside the IP address of the server of yourself service discovery is about the same thing it's about registering and varying but for service but the basic events let's see a bit more about it so we have a catalog that's provided by the service discovery technologies and then you have your servers each of them and provide a service some of them provide the same service there we register themselves into the and so you would get a list of service is running at all and multiple times each the services running on the service then you have lines and the clients will be looking for a service by its name is 3 and there we queried the catalog for the given service and they will be handed over the list of available policy providing set this is 7 discovery so now let's think it 2 of the tree technologies I will
cover here the 1st 1 is the oldest 1 it's names of Cuba is from the head formation and zookeeper in firstly designed as a reliable cluster coordination is used mostly and mainly in and it does so pretty interesting features and it's natural since it so is the oldest of the tree technologies will go over here and when I say in in the negative ones that he doesn't provide service discovery per that's true that we get back to it later so as to how we can still use of people choose to use to achieve service discovery what I mean by this is that it's not the breaching feature of people but the main design of the keeper and it's the same authority CD which means he just after this is that you can compare them to a distributive you're working on file system which is also compared to a key-value store you and it's written in Java and each chooses as presented commendation for consensus algorithm and the consensus is about making sure all the nodes of the the ZooKeeper cluster agree on something the peak on vitamin C bindings I'm not usable there is 1 provided here on the on the sources but it's not really using and even more so for service discovery noted that the center where technology he just knows about its own cluster this now you have the to see the cities from the chorus it's pretty recent project it's written in it uses the rats consensus and which is pretty robust and it has that option and it's used on many these will be your project and like of and it provides an HTTP API to do all the queries and researchers stuff it's pretty simple pretty simple to to to to implement and configure just like the people it doesn't provide a service discovery mechanism but we will use the fastest Iraqi to achieve this it's not that the center where either and it doesn't provide any kind of of your services once you register would see about that the 1st 1 is to assumed is from Chicago that's the newest of the tree and it says everything go it's also using the rough consensus uh algorithm and yeah I told you it's an opinionated talk so I didn't find any at things to say about it because it has built-in service discovery and future of its data center where so you can have multiple clusters of consumers and unit status center and they can talk about them in between them and it also provides a genus API so you can also look up for services using didn't which is kind of a good feature the known I wanted to stress outcomes of Uberon CD is that we will have achieved services covered by abusing the Q values for you can see the key-value store other so the file system where you can sort of stored data registering is about creating note Walter folder or file a flight related to your local filesystem and make it meaningful In this kind of example at the root of the Iraqi I would say that in the 1st level is will be my surface make 88 at then on the 2nd level I would create a folder which we represent all the services on the service providing this service so I call this form the provider and then decide how we create nodes all you can related to find which are named my horse 2 points and the port extols discovering providers for API X and service is just like listing the content of APA x slash providers during wikinews same Memcached and stuff like that that's how you can abuse energy of service discovery using key-value store based such as the OK OK now let's see the whitened class libraries to talk to each other this technology is the first one is the year of the keeper of his his his it's easy and yeah I know I'm sorry about this we can be very very creative community and and will use the underscore line 1 that sees that shape which underlie and then use just so you can see a rapid that CZK as a service discovery oriented rock graph of 1 of the so it's really pretty then for each ECG we have some stand out items that should TCG library which is pretty good and if you use a single you know you have another for case and for pencil you have insulate and bite and consumed we use item consumers which is more of a no documented and more active than last year it was the contrary but and this year's heightened considers very very nicely implemented so we just this thank you but when which is a technology you have to rely even more when it could be the for all your whole topology and you have to make sure that you can rely on the byte and clients because they're really really have a direct impact on your application so
let's see about this is that the 2nd class library which and users when you want to connect to secure cluster you can specify multiple host which is critical it does with reconnect feature you can query about the connections states you would get connected or uh disconnected and stuff like that so you can have your code part the and it says rejection exceptions and if something wrong happened so and preventing quick example here the connecting means if necessary syllable when I do the 1st line and wait and try to connect to to make keeper cluster will be blocking we need to raise an exception in this case it's looking if you then you can change this with the weight apparent but if we raise an exception OK so so it's not part of the 1 of you are used to the entitlement as libraries and you have to know about and going because this can block don't call application if should know that the person is and the GCD side vitamin site you don't have the possibility to connect to the the and but you have little reconnection gracefully so it's pretty good you can't freely good try and get the connections states there is no exception as are pretty rich so you can see what's happening pretty easy and gets the good exceptions and about the different kind of errors that you can happen to to be running until and it doesn't connect the bite and consider 1 of these while not so good as this this season K 1 as well because the support In the Heat reconnect feature but Oregon the feature you the x sections are also so and on providing an example here of connection is well sometimes not very very meaningful but he doesn't fit connects that means it's non-blocking you just create your own symbol clients and then continue nothing happens when you do that which can be used a good feature OK now and about the
service registration . 3 things you have to consider here prospective as part of a service life sigh is getting up and needs to register into the content then it's running and you have to make sure it's still running because if it's not running each pressures your service and providing such service becomes inevitable you don't want to answer the ions about it OK so you have to remove it In away from the catalog when it's done that's the report of and then if we stopped gracefully all for if we crash we have to is it from the get so we have checking we also do the restrictions for and in that in case of failure we're saying how it's done on every item implementation 4 of this city that came it's pretty straightforward the main line of the main thing to to understand is the 1st 1 over here and there in the 1st try except will just creates the file system reaction I talked to you about so we just make sure that we have slashed be 2016 providers and we do make we created whole path that engaging in Dutch and you know that already exists it's OK we can we can continue then the that's easy provides the coordinates of which is registered and then you say OK on this node and providers and I we restore the machine yes running port 5 thousand any tree creative the 5 lights and node like yes 2 points 5 thousand for the only the no about have chicken they have checking is looking for these include the because the keeper as the score feature Maine ephemeral nodes disempowerment each slide and that there are like 5 on nodes in the file system Muraki that are present on the file system as long as the could make at as the station of the client who created them is alive so whenever the the client dies for closes its sessions so people will know about it and we remove the given automatic so it's a good way of doing have checking because if your application crashes or are you in just to deregister you just have to x gracefully and close your station by closing the station a keeper the people we remove all the nodes you created With this so the rest is those that it creates an atom unknown so that's increases includes it's is it and but client what about the failure detection latency the my is he investment or pressures badly and didn't have time to their sister gracefully how long would it take for us to keep up to improve the node from the and then In other words how long we live we take for the clients to not my host and port anymore it would take session timeout here when I created my client sessions I said 5 so if we take up to 5 seconds In this case to make this happen so for fight against maximum I could be serving the wrong host and port to my clients from the that's something you have to consider as well In such component on to the it's basically the same principle and we try to reduce the provider if confined to recreate as a directory then we just have to right there is no resistance wrapper or something like this so you when you just have to write the given note have talked to you about here and we can set the date it so we but also the same thing in the value is not the territory and it has a time to leave you which of the you that's the have taken actually you can see that it's coming difficult here 1 because it UCT doesn't have the concept of it from your own notes as a you perhaps that means that you have to implement have checking yourself or use it for about 2 library or program to do it for you but you have to do it yourself so in this example and doing it myself so the trick I knew using these have is that when I Applications stop I have to create a have been your friends which way constantly in an infinite loop register my services and that will be sort of have or have taken was a teacher and then my teacher at the time to live off the node and creating it would be removed after X so don't tedious segments from the the so my frame detection latencies teacher but I have to have good thread constantly making sure that my nose is present and so my service and some of these in the if is Everything is
granted and so you can see in the that's it's pretty straightforward and I just have to register my service into a constant agents as well as various self-explanatory and the name of the service the address of the host providing in the port finding it's integrated nothing more to the have checking is interesting in control because you have to wait and to make sure that the calls service we some have checks of your Service by themselves so you just have to create like in my example it's issue should be service so and creating an object that have check objects which is a kind of http and and providing the Euro that the kinds servers should have called every 2 seconds something consumed a OK and when I registered I passed the experiment checks and I said to consolidate check the serial which is 7 if fails reduce the from the get to begin very correct mock me as the right how do you discover all
of this its predecessor
straightforward as well I'm sorry just show you the query in part for the people you can get the address this by listing the children of a given node so I'm missing the children of the providers order in the 2016 and that would be my notes that I just have to look over then speech 2 points and I get the host and port of the receptor providing my service OK it basically the same steps so you make a recursive squaring range you get the children and it's pretty and you get your posts and what on and so it's also very easy you query the health service because you want only to get the healthy service providing a service so that's the passing equals true here I just want you to return the service where they have shaky specify the servers imports for which the sum of the intensities passing OK and then inside I get a lot of information so subject areas I think and inside there is cause for concern and that's interesting I walking now that's states so have
given 3 rest advice and my machine here is running as the keeper of and it and consider agent
so the idea I had the to showcase service discovery page like this where we will be looking for the 2016 and also providing that you it will be looking for the host providing the 2016 terms so I just wanted also to demonstrated here that's my of the demonstrate the key value as storage which she although the technology is also used to configuration the access so you can store your configuration in this um key-value stores so your application can also get them from from so the color here I don't know if it's readable because of the result shown here every time I read all of this I change
Carter configure on each it is a cheaper energy C D N in concert forum idea for my web service so injection can you start running your uh your Raspberry Pi so residue by 4 is this 1 that I plugged if few seconds before and I can just go to like this
and you can see that every time
that would change the corridor the key
store it would be picked up by uh the application from In this case the people and then there's just that the Raspberry Pi number 1 which appeared and but discovered here by the 7 on every that's what so if you can do 1st breaking yards and you want to so we see
users coming and what's interesting about this is called like this OK is going to get
pardon I think the Raspberry
Pi or I this
the the overall here that's the way find OK so it's a memory load OK dear Raspberry Pi is running pretty awesome you see that my brother by 4 which is not responding here you can see it's not responding we have since for every 1 of them and that's it's has been removed from so it is and consul so it's a good thing OK it's where he right OK so now we can see a raspberry pi to OK revenue by 4 is getting by somehow and yet it's the is getting back yeah it's getting OK and arrested by its
consul yeah it's working as well you can see the value of the car now all right so now we have before us very biased at and learning and this seems to be no produce stable on the subject yeah I remove it I was just a raspberry Pi for
now see about the time it takes it depends on the technology i'm because they have different kind of GTL if among
session timeout for have strict time of all right this yeah someone them are you have any questions without B
the I I don't know you would be the is the the on the whole yes and the but what people of what this the client sites so the question is is there any kind of a balancing note the catalog in that when the planet queries the catalog he gets a list of all the available nodes for the given service that's so that then it's up to you to decide to which 1 you want to connect and you have a question about the redundancy and if you have an application that is dependent on the service discovery catalog and for different services that that but exposes and the capital for some reason crashes How would you like to recover from that situation we have like service discovery of the service discovery or but how would you do that yeah there are no you don't do services Core service discovery and the many that's and the advisor of servers these 3 so you should have at least 3 zookeeper or constant servers running became so if you want more resiliency make up make it 5 7 but and an even number OK or with an even number if something very that happens and you don't have services covering anymore I guess you have to on the on your application site you can make heats like this cashed fishing stuff it's not is discovery easy and it really depends on the type of application arise but the best the this course is to make sure you service discovery cluster has enough nodes to sustain this kind of problem the people of the state of of of the of the research and then another well it depends on the technology actually as you so if you use the people who can connect to multiple hosts show you don't you of of abundance of just but every year of the node in the in on the other hand in consul and you just the you have to specify 1 of them 1 of the notes so maybe you can implement some kind of stuff on your application to handle this like having a DQ or something like this in Python and try in each exception if you use the phrase is an exception you can try and connect to the other rows except rights yes original of so that for the recording site question about the registration procedure you know why it going want to use external to to do this it can be but implemented in our what integration management chief Public sold and in this case you will have the purpose of a to register our support services like among the DB and tomatically uh so that's the 1 that to this as external services for your occasions when through exchange to me chef and stuff like that are good for or configuration and really configuration applying configuration to service I don't see services covering like this to me it's not I I relate to your point Weizmann would you be in and then and demons stuff like this and you have external programs that do it for you I'm not sure that for instance share its rock and have have checks running on so if you make tweets we suggested the become difficult to do it there are a lot of third-party libraries doing it for it see for example which was used as a wide audience and for container stuff like this and they they use specific for to but not the provisioning of the word is in progress to continue the that they have to optimistic units any continued to running of the proposed in this there are and idea I think he that works well and so if something happens container and there is no automatically yeah but it has to be reduced so somewhere so we're having this set the running local agent of which was machine the local agent and each of the service node so that I could get on the gentleman this and the agents or only agent knows where there is a come from cluster located it's going a lot of invariance with yet so have but you don't you don't have century configurations place or you you would you delete of solving them really thankful to to install everything but you're actually a service discovery is implemented in using special containers no other questions I think you
Gewichtete Summe
Service provider
Elektronischer Programmführer
Shape <Informatik>
Güte der Anpassung
Dienst <Informatik>
Rechter Winkel
Ordnung <Mathematik>
Stabilitätstheorie <Logik>
Überlagerung <Mathematik>
Virtuelle Maschine
Spannweite <Stochastik>
Arithmetische Folge
Inhalt <Mathematik>
Cluster <Rechnernetz>
Demo <Programm>
Wort <Informatik>
Dämon <Informatik>
Abstimmung <Frequenz>
Gemeinsamer Speicher
Natürliche Zahl
Familie <Mathematik>
Kartesische Koordinaten
Fortsetzung <Mathematik>
Web Services
Einheit <Mathematik>
Wurzel <Mathematik>
Web Services
Physikalischer Effekt
Algorithmische Programmiersprache
Konfiguration <Informatik>
Twitter <Softwareplattform>
Registrierung <Bildverarbeitung>
Projektive Ebene
Web Site
Wrapper <Programmierung>
Pi <Zahl>
Zusammenhängender Graph
Speicher <Informatik>
Einfach zusammenhängender Raum
Objekt <Kategorie>
Serielle Schnittstelle
Registrierung <Bildverarbeitung>


Formale Metadaten

Titel Using Service Discovery to build dynamic python applications
Serientitel EuroPython 2016
Teil 63
Anzahl der Teile 169
Autor Jacob, Alexys
Lizenz CC-Namensnennung - keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben
DOI 10.5446/21091
Herausgeber EuroPython
Erscheinungsjahr 2016
Sprache Englisch

Inhaltliche Metadaten

Fachgebiet Informatik
Abstract Alexys Jacob - Using Service Discovery to build dynamic python applications Let's compare the usage of three major **service discovery** technologies to build a dynamic and distributed python application ! This talk will be about **consul**, **etcd** and **zookeeper** and their python bindings and will feature code along with a live demo. ----- This talk will **showcase and compare** three Service Discovery technologies and their usage to **build a dynamic and distributed python application** : - consul - etcd - zookeeper After a short introduction to service discovery, we will **iterate and compare** how we can address the concrete and somewhat complex design of our python application using each technology. We'll then be able to discuss their strengths, weaknesses and python bindings and finally showcase the application in a demo.

Ähnliche Filme