XSF logo jdev - 2019-11-22


  1. alexis has joined
  2. debacle has left
  3. Daniel has left
  4. Daniel has joined
  5. UsL has left
  6. alexis has left
  7. alexis has joined
  8. Daniel has left
  9. Daniel has joined
  10. Alexis has joined
  11. Wojtek has left
  12. Alexis has left
  13. Daniel has left
  14. alexis has left
  15. alexis has joined
  16. Daniel has joined
  17. Daniel has left
  18. Daniel has joined
  19. sonny has left
  20. sonny has joined
  21. sonny has left
  22. sonny has joined
  23. rion has left
  24. rion has joined
  25. Daniel has left
  26. asterix has joined
  27. asterix has left
  28. asterix has joined
  29. Daniel has joined
  30. asterix has left
  31. asterix has joined
  32. wurstsalat has joined
  33. asterix has left
  34. asterix has joined
  35. Daniel has left
  36. asterix has left
  37. asterix has joined
  38. sonny has left
  39. sonny has joined
  40. Daniel has joined
  41. pulkomandy has left
  42. pulkomandy has joined
  43. UsL has joined
  44. Daniel has left
  45. Daniel has joined
  46. debacle has joined
  47. asterix has left
  48. asterix has joined
  49. pulkomandy has left
  50. goffi has joined
  51. pulkomandy has joined
  52. larma has left
  53. larma has joined
  54. pulkomandy has left
  55. pulkomandy has joined
  56. pulkomandy has left
  57. pulkomandy has joined
  58. debacle has left
  59. debacle has joined
  60. debacle has left
  61. gav has left
  62. gav has joined
  63. sonny has left
  64. gav has left
  65. gav has joined
  66. sonny has joined
  67. pulkomandy has left
  68. debacle has joined
  69. pulkomandy has joined
  70. asterix has left
  71. asterix has joined
  72. UsL has left
  73. Guus has left
  74. Guus has joined
  75. asterix has left
  76. asterix has joined
  77. lovetox has joined
  78. zuk has joined
  79. asterix has left
  80. asterix has joined
  81. asterix has left
  82. asterix has joined
  83. pulkomandy has left
  84. pulkomandy has joined
  85. Guus has left
  86. Guus has joined
  87. Guus has left
  88. Guus has joined
  89. Guus has left
  90. Guus has joined
  91. allie has left
  92. allie has joined
  93. sonny has left
  94. sonny has joined
  95. Zash has left
  96. Zash has joined
  97. wangzhen has joined
  98. asterix has left
  99. asterix has joined
  100. wangzhen has left
  101. asterix has left
  102. asterix has joined
  103. paul has joined
  104. pulkomandy has left
  105. alexis has left
  106. pulkomandy has joined
  107. Zash has left
  108. debacle has left
  109. pulkomandy has left
  110. Zash has joined
  111. pulkomandy has joined
  112. Daniel has left
  113. zuk has left
  114. pulkomandy has left
  115. pulkomandy has joined
  116. Daniel has joined
  117. Meta Bergman has left
  118. Meta Bergman has joined
  119. sonny has left
  120. sonny has joined
  121. goffi has left
  122. pulkomandy has left
  123. pulkomandy has joined
  124. pulkomandy has left
  125. pulkomandy has joined
  126. asterix has left
  127. asterix has joined
  128. pulkomandy has left
  129. pulkomandy has joined
  130. pulkomandy has left
  131. pulkomandy has joined
  132. asterix has left
  133. asterix has joined
  134. asterix has left
  135. asterix has joined
  136. sonny has left
  137. sonny has joined
  138. debacle has joined
  139. asterix has left
  140. asterix has joined
  141. lovetox_ has joined
  142. lovetox_ has left
  143. pulkomandy has left
  144. pulkomandy has joined
  145. asterix has left
  146. asterix has joined
  147. debacle has left
  148. lovetox_ has joined
  149. lovetox_ has left
  150. asterix has left
  151. asterix has joined
  152. lovetox_ has joined
  153. lovetox_ has left
  154. asterix has left
  155. asterix has joined
  156. asterix has left
  157. asterix has joined
  158. lovetox_ has joined
  159. lovetox_ has left
  160. lovetox_ has joined
  161. lovetox_ has left
  162. debacle has joined
  163. alexis has joined
  164. pulkomandy has left
  165. pulkomandy has joined
  166. pulkomandy has left
  167. pulkomandy has joined
  168. SERGE90 has left
  169. SERGE90 has joined
  170. asterix has left
  171. lovetox has left
  172. pulkomandy has left
  173. pulkomandy has joined
  174. UsL has joined
  175. dandan has joined
  176. dandan I have a question about DNS SRV setup for xmpp server for a cluster of XMPP servers. Anyone able to help?
  177. Link Mauve dandan, ask your question, if someone can answer they’ll do so.
  178. Link Mauve They can’t if you don’t ask.
  179. dandan Sure, Thanks.
  180. dandan The question is that I have a cluster of 2 nodes (very simple) deployed on AWS.
  181. dandan I have setup DNS SRV records correctly (hopefully) for all servers.
  182. dandan Now the question is that in case I do not use a load balancer for my servers, to what address should my clients connect to?
  183. Alex has left
  184. dandan For instance if my configuration is as below: 0 5 5223 server1.mydomain.com 0 5 5223 server2.mydomain.com for _xmpps-client._tcp.mydomain.com then to what address should my clients connect?
  185. dandan should they connect to server1.mydomain.com or server2.mydomain.com?
  186. Zash yes
  187. Zash they should pick one of them with about 50/50 chance
  188. dandan Yes but that would be up to the client then and different from what load balancer is.
  189. Zash yes
  190. dandan As far as I have understood, these records are supposed to do the work of load balancer.
  191. Zash but what you pasted amounts to 50/50 load balancing
  192. Link Mauve dandan, without any software required in front of your server.
  193. dandan What do you mean Link Mauve?
  194. dandan Ah sure. Yes. I mean no load balancing will be needed in that case. But how the client should decide what server to choose? The client has no idea about the load.
  195. Zash dandan: if you want more control then use a load balancer
  196. Link Mauve dandan, it will pick one at random, throw a coin, and go for that one.
  197. moparisthebest The client literally flips a coin
  198. Link Mauve flip*, that’s the word.
  199. Link Mauve Thanks. ^^
  200. dandan Ok then. I see.
  201. Zash but if it for whatever reason can't establish a connection to the chosen one it should try the other
  202. dandan I see. Well is it really realiable? I mean a NLB seems to be a better solution, or?
  203. Zash No idea what "NLB" is
  204. dandan Network Load Balancer
  205. Zash It's up to you
  206. Zash more moving parts etc
  207. dandan If this is totally random by the client side, so why the wight is decided on the server side in DNS record?
  208. moparisthebest dandan: refer to the algorithm here https://tools.ietf.org/html/rfc2782
  209. dandan I mean 50%, 30%, etc.
  210. Zash dandan: that's what the second number is
  211. Link Mauve dandan, because the administrator might have provisioned different size of servers.
  212. Link Mauve So they prefer clients to flip a four-faced coin and go 25% of the time to one physical server, 75% of the time to another one.
  213. Link Mauve Or any other possible combinaison.
  214. Zash dandan: in your example you have 5 and 5 as weight. so each entry should have a 5/10 = 50% chance of being selected first
  215. dandan Yes I know. This is an example.
  216. dandan OK. Then so if I have 4 servers of shared load of 50%, 30% and 20% then I should flip a dice of 3 sides with respective probabilities?
  217. Zash if you set up SRV records like that, yes
  218. dandan OK thanks. One more question if you don't mind.
  219. dandan Is it OK not to set DNS SRV records and just go for load balancer?
  220. Zash of course
  221. Zash altho for xmpps you do need them
  222. dandan I am asking because for instance Openfire will complain when DNS SRV records are not set.
  223. Link Mauve For normal _xmpp-client record (non-xmpps), you need either a SRV record or a A record, if the user will only ever connect to a single server (or load-balancer).
  224. Guus Openfire will warn, but will operate fine.
  225. Link Mauve You can set both but the end result will be identical.
  226. dandan Yes I have observed that it work as it should but I was wondering if this is recommended to set DNS SRV records or not.
  227. dandan Yes sure. The result will be identical as you said.
  228. Link Mauve You only need a SRV record if you plan to use xmpps (XEP-0368), or if you want to use the inherent “load” balancing SRV provides with multiple records.
  229. Guus or if you want to run a cluster
  230. dandan I run a cluster.
  231. Guus or if you run on a server for which the host name doesn't match the XMPP domain name
  232. Zash or if you wanna use a non-standard port or point at a different machine/A record
  233. dandan and want it to be scalable.
  234. Zash (what Guus said)
  235. Guus generally, DNS SRV records are good.
  236. Guus Openfire should give you concrete examples of DNS SRV records suitable for your instance.
  237. Zash dandan: If I were you I'd worry about using a separate load balancer later if it turns out you need one
  238. Guus but a general grasp of the concept is good to have, so that you can make informed decisions.
  239. dandan Yes I know. But I mean if I use a load balancer then I don't need to set DNS SRV records that are recommended by Openfire.
  240. Zash It's easy to change DNS
  241. moparisthebest dandan: what's the point of a cluster if you put a single point of failure load balancer in front?
  242. Guus (capacity, probably)
  243. dandan Well, I might be wrong, but by having a cluster I will be able to have fail-over config and scale the system.
  244. Guus dandan, it won't fail over a failing loadbalancer.
  245. moparisthebest He said AWS, isn't it cheaper to run 1 big server vs 2 small?
  246. dandan The load balancer in AWS AFAIK is not a single point failure system since the load balancer itself will be scaled. I might be wrong though.
  247. Guus Oh, I dropped in half way through the conversation - I missed that.
  248. Link Mauve Fail-over is also definitely possible with SRV records, if the coin flipped by the client leads it to a dead end^Wserver, it will fallback to the other one(s).
  249. Guus but yeah, DNS SRV records are less complex by an order of magnitude
  250. Guus that's generally good.
  251. paul has left
  252. Guus a lot cheaper too, presumably
  253. Zash you can have 1 5 5222 first-choice.example.com 2 5 5222 second-choice.example.com etc
  254. moparisthebest dandan: are you running them both in the same AWS datacenter too?
  255. dandan Yes Zash?
  256. dandan Then choose randomly between them?
  257. dandan Yes mopasisthebest.
  258. moparisthebest dandan: so single point of failure again
  259. Zash dandan: no, they get tried in order of the priority (first number)
  260. moparisthebest Whole AWS datacenters fail often
  261. Guus dandan i suggest you read up on DNS SRV. They're pretty versatile, and easy to work with. You can always invest in load balancers if you feel that DNS SRV doesn't suit your needs.
  262. dandan Thanks Guus.
  263. Guus wikipedia comes with a handy example
  264. Guus Ok, I'm off to bed
  265. dandan Zash the question is that how the client will know that for instance the first server is loaded and chose the second one?
  266. Zash dandan: it doesn't
  267. Zash dandan: it sorts the records by priority and if there are multiple with the same priority it'll shuffle them and pick by weight. if the connection fails it removes that one and tries the whole thing again (roughly)
  268. Zash the RFC moparisthebest linked explains how it works, I recommend you read it
  269. Zash and as I said, if you need more control then use a load balancer
  270. moparisthebest But you probably don't, and regardless don't run all your services in the same DC if you are after reliability
  271. dandan Yes you are right.
  272. dandan I will read the link that moparisthebest sent.
  273. Zash load balancing and high availability at the same time is non-trivial. most xmpp clustering solutions are focused on load balancing afaik
  274. dandan Definitely need to read more about it.
  275. dandan Zash you mean that the clients have knowledge about all servers that a DNS SRV record has been assigned to it?
  276. Zash I don't understand the question
  277. dandan Like your example, a client will also have the list of all serves you listed?
  278. Zash client would query for the SRV records, receive a list
  279. dandan first-choice, second-choice ?
  280. Zash ?
  281. Zash If you query for _xmpp-client._tcp.example.com you get an aswer with all the SRV records there
  282. dandan Aha ok. That is what I wanted to know. Is there any special command for querying in XMPP client libraries like Smack for instance or this should be done in other ways?
  283. Zash then it follows the sorting algorithm and tries to connect until it gets a connection or runs out of options
  284. Zash I know nothing of Smack, can't help you with that.
  285. dandan OK. Thanks a lot all of you for your kind help.
  286. Daniel has left
  287. guus.der.kinderen Smack does SRV lookup by default
  288. Daniel has joined
  289. guus.der.kinderen It'll actually warn you if you're connecting to a domain that has no SRV records