c-lightning public node data on explorers - lightning-network

I'm trying to set my first clightning node with docker-compose using image from https://hub.docker.com/r/elementsproject/lightningd. Currently, my node can connect and open channel with other nodes (and I can open a channel to the node just fine), but it's still not updated (ie. has no information) on most explorers.
I've tried to make my port 9735 open, set the bind-addr as the docker's IP address, even tried to set announce-addr with tor addresses. Nothing works.
The following is current results of getinfo and listconfigs:
getinfo
{
"id": "03db40337c2de299a8fa454fdf89d311615d50a27129d43286696d9e497b2b027a",
"alias": "TestName",
"color": "fff000",
"num_peers": 3,
"num_pending_channels": 0,
"num_active_channels": 3,
"num_inactive_channels": 0,
"address": [
{
"type": "ipv4",
"address": "68.183.195.14",
"port": 9735
}
],
"binding": [
{
"type": "ipv4",
"address": "172.18.0.3",
"port": 9735
}
],
"version": "v0.7.1-906-gf657146",
"blockheight": 601917,
"network": "bitcoin",
"msatoshi_fees_collected": 0,
"fees_collected_msat": "0msat"
}
listconfigs
{
"# version": "v0.7.1-906-gf657146",
"lightning-dir": "/root/.lightning",
"wallet": "sqlite3:///root/.lightning/lightningd.sqlite3",
"plugin": "/usr/local/bin/../libexec/c-lightning/plugins/pay",
"plugin": "/usr/local/bin/../libexec/c-lightning/plugins/autoclean",
"plugin": "/usr/local/bin/../libexec/c-lightning/plugins/fundchannel",
"network": "bitcoin",
"allow-deprecated-apis": true,
"always-use-proxy": false,
"daemon": "false",
"rpc-file": "lightning-rpc",
"rgb": "fff000",
"alias": "HubTest",
"bitcoin-rpcuser": [redacted],
"bitcoin-rpcpassword": [redacted],
"bitcoin-rpcconnect": "bitcoind",
"bitcoin-retry-timeout": 60,
"pid-file": "lightningd-bitcoin.pid",
"ignore-fee-limits": false,
"watchtime-blocks": 144,
"max-locktime-blocks": 2016,
"funding-confirms": 3,
"commit-fee-min": 200,
"commit-fee-max": 2000,
"commit-fee": 500,
"cltv-delta": 14,
"cltv-final": 10,
"commit-time": 10,
"fee-base": 0,
"rescan": 15,
"fee-per-satoshi": 1,
"max-concurrent-htlcs": 30,
"min-capacity-sat": 10000,
"bind-addr": "172.18.0.3:9735",
"announce-addr": "68.183.195.14:9735",
"offline": "false",
"autolisten": true,
"disable-dns": "false",
"enable-autotor-v2-mode": "false",
"encrypted-hsm": false,
"log-level": "DEBUG",
"log-prefix": "lightningd(7):"
}
Is there something wrong with this configuration? Or, is it another issue after all?
I understand that explorers update their node list irregularly, and as far as the node can open channels (and can be connected), everything is fine. but this thing has bugging me for weeks.

updated the docker image and put bind-addr to 0.0.0.0:9375 somehow fixed the problem for some unknown reason.

Related

Jmeter - JSON response manipulation Append node in ArrayList

I've got the response from HTTP GET request as JSON object and I want to use that JSON and put other node pass it to the next HTTP request. I got the following response data
{
"settlementFolio": "0002",
"settlementID": 283,
"businessUnitID": 43,
"routeID": 955,
"chargeAmount": 22248.0000,
"paymentAmount": 68560.6000,
"isPaid": false,
"hasValidCrewConfiguration": true,
"settlementDate": "2020-09-21T00:00:00",
"charged": 68560.6000,
"packageRemain": 7500.0000,
"totalBoxes": 280,
"detail": [
{
"settlementTransactionID": 1,
"settlementTransactionDescription": "1 Ventas Netas",
"charge": 0.0,
"payment": 61060.6000,
"isAutomatic": true,
"isForClient": false,
"isCharge": false,
"isChecked": false,
"settlementTransactionClientDetail": [
{
"settlementTransactionID": 3456,
"clientID": 392342,
"saleNote": 11792,
"amount": 30530.3000,
"reference": "",
"clientName": "OXXO NUEVA MAYAPAN",
"isChecked": false
},
{
"settlementTransactionID": 3456,
"clientID": 391322,
"saleNote": 11793,
"amount": 30530.3000,
"reference": "",
"clientName": "OXXO CHICHI SUAREZ",
"isChecked": false
}
]
}
],
"productTypeCounter": [
{
"centralCostID": 1,
"centralCostName": "Refrescos",
"sellUnit": 280,
"cNomina": 0.0000
}
]
}
I need to append a node like this with "settlementTransactionID": 2,
{
"settlementFolio": "0002",
"settlementID": 283,
"businessUnitID": 43,
"routeID": 955,
"chargeAmount": 22248.0000,
"paymentAmount": 68560.6000,
"isPaid": false,
"hasValidCrewConfiguration": true,
"settlementDate": "2020-09-21T00:00:00",
"charged": 68560.6000,
"packageRemain": 7500.0000,
"totalBoxes": 280,
"detail": [
{
"settlementTransactionID": 1,
"settlementTransactionDescription": "1 Ventas Netas",
"charge": 0.0,
"payment": 61060.6000,
"isAutomatic": true,
"isForClient": false,
"isCharge": false,
"isChecked": false,
"settlementTransactionClientDetail": [
{
"settlementTransactionID": 3456,
"clientID": 392342,
"saleNote": 11792,
"amount": 30530.3000,
"reference": "",
"clientName": "OXXO NUEVA MAYAPAN",
"isChecked": false
},
{
"settlementTransactionID": 3456,
"clientID": 391322,
"saleNote": 11793,
"amount": 30530.3000,
"reference": "",
"clientName": "OXXO CHICHI SUAREZ",
"isChecked": false
}
]
},
{
"settlementTransactionID": 2,
"settlementTransactionDescription": "2 Envase Faltante",
"charge": 0.0,
"payment": 7500.0000,
"isAutomatic": true,
"isForClient": false,
"isCharge": false,
"isChecked": false,
"settlementTransactionClientDetail": [
{
"settlementTransactionID": 3461,
"clientID": 0,
"saleNote": null,
"amount": 7500.0000,
"reference": "202|75.00|100.000",
"clientName": "",
"isChecked": false
}
]
}
],
"productTypeCounter": [
{
"centralCostID": 1,
"centralCostName": "Refrescos",
"sellUnit": 280,
"cNomina": 0.0000
}
]
}
I am using something like this
String addMore = '${detail}';
def detail = new groovy.json.JsonSlurper().parseText(addMore);
detail.put(deposito);
vars.put("detail", new groovy.json.JsonBuilder(detail).toPrettyString());
log.info("",vars.get('detail'));
The log shows the following error
020-09-23 09:09:25,857 ERROR o.a.j.e.JSR223PostProcessor: Problem in JSR223 script, JSR223 PostProcessor
javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.put() is applicable for argument types: (org.apache.groovy.json.internal.LazyMap) values: [[settlementTransactionID:11, settlementTransactionDescription:11 Deposito de Efectivo, ...]]
Possible solutions: sum(), pop(), get(int), get(int), sum(java.lang.Object), plus(java.lang.Object)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:320) ~[groovy-jsr223-3.0.3.jar:3.0.3]
at org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:71) ~[groovy-jsr223-3.0.3.jar:3.0.3]
at javax.script.CompiledScript.eval(CompiledScript.java:89) ~[java.scripting:?]
at org.apache.jmeter.util.JSR223TestElement.processFileOrScript(JSR223TestElement.java:222) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.extractor.JSR223PostProcessor.process(JSR223PostProcessor.java:45) [ApacheJMeter_components.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.java:940) [ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:572) [ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.3]
at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.put() is applicable for argument types: (org.apache.groovy.json.internal.LazyMap) values: [[settlementTransactionID:11, settlementTransactionDescription:11 Deposito de Efectivo, ...]]
Possible solutions: sum(), pop(), get(int), get(int), sum(java.lang.Object), plus(java.lang.Object)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:70) ~[groovy-3.0.3.jar:3.0.3]
at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46) ~[groovy-3.0.3.jar:3.0.3]
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) ~[groovy-3.0.3.jar:3.0.3]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) ~[groovy-3.0.3.jar:3.0.3]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139) ~[groovy-3.0.3.jar:3.0.3]
at Script158.run(Script158.groovy:31) ~[?:?]
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:317) ~[groovy-jsr223-3.0.3.jar:3.0.3]
... 9 more
We cannot help you as it's unclear what are these ${detail} and ${deposito} mean and contain.
If you get a deposito JMeter Variable which looks like:
{
"settlementTransactionID": 2,
"settlementTransactionDescription": "2 Envase Faltante",
"charge": 0.0,
"payment": 7500.0000,
"isAutomatic": true,
"isForClient": false,
"isCharge": false,
"isChecked": false,
"settlementTransactionClientDetail": [
{
"settlementTransactionID": 3461,
"clientID": 0,
"saleNote": null,
"amount": 7500.0000,
"reference": "202|75.00|100.000",
"clientName": "",
"isChecked": false
}
]
}
and you want to add it to the response of a certain sampler and store the result into another JMeter Variable you can use JSR223 PostProcessor with the following code:
def originalResponse = new groovy.json.JsonSlurper().parse(prev.getResponseData())
originalResponse.detail.add(new groovy.json.JsonSlurper().parseText(vars.get('deposito')))
vars.put('modifiedResponse', new groovy.json.JsonBuilder(originalResponse).toPrettyString())
assuming everything goes well you will get the JSON payload you're looking for in the ${modifiedResponse} JMeter Variable.
More information:
Apache Groovy - Parsing and producing JSON
Apache Groovy - Why and How You Should Use It

Cannot retrieve attribute value from geoserver

Iam new to geoserver. I have created shape file of my district and added certain attributes like covid count, covid zone , district name etc related to COVID . I have loaded this to postgis database and I could see attributes also in table .But when I try to retrieve the feature using postman . Attribute values are not retrieved. Can anyone help
Below is my request
http://localhost:8080/geoserver/rest/workspaces/DistrictWpc/datastores/district_store/featuretypes/ernakulam.json
Response is
{
"featureType": {
"name": "ernakulam",
"nativeName": "ernakulam",
"namespace": {
"name": "DistrictWpc",
"href": "http://localhost:8080/geoserver/rest/namespaces/DistrictWpc.json"
},
"title": "ernakulam",
"keywords": {
"string": [
"features",
"ernakulam"
]
},
"srs": "EPSG:404000",
"nativeBoundingBox": {
"minx": 76.1618881225586,
"maxx": 76.6080093383789,
"miny": 9.63820648193359,
"maxy": 10.1869020462036
},
"latLonBoundingBox": {
"minx": 76.1618881225586,
"maxx": 76.6080093383789,
"miny": 9.63820648193359,
"maxy": 10.1869020462036,
"crs": "EPSG:4326"
},
"projectionPolicy": "FORCE_DECLARED",
"enabled": true,
"store": {
"#class": "dataStore",
"name": "DistrictWpc:district_store",
"href": "http://localhost:8080/geoserver/rest/workspaces/DistrictWpc/datastores/district_store.json"
},
"serviceConfiguration": false,
"maxFeatures": 0,
"numDecimals": 0,
"padWithZeros": false,
"forcedDecimal": false,
"overridingServiceSRS": false,
"skipNumberMatched": false,
"circularArcPresent": false,
"attributes": {
"attribute": [
{
"name": "id",
"minOccurs": 0,
"maxOccurs": 1,
"nillable": true,
"binding": "java.lang.Long"
},
{
"name": "district",
"minOccurs": 0,
"maxOccurs": 1,
"nillable": true,
"binding": "java.lang.String"
},
{
"name": "count",
"minOccurs": 0,
"maxOccurs": 1,
"nillable": true,
"binding": "java.lang.Long"
},
{
"name": "zone",
"minOccurs": 0,
"maxOccurs": 1,
"nillable": true,
"binding": "java.lang.String"
},
{
"name": "geom",
"minOccurs": 0,
"maxOccurs": 1,
"nillable": true,
"binding": "org.locationtech.jts.geom.MultiPolygon"
}
]
}
}
}
GeoServer's REST API is used for administrative tasks and as such does not provide a way to see the actual data you have stored in the database, just the details of how GeoServer is connecting to the database and some metadata about the store.
To access the actual data you need to use the WFS endpoint which is described by the OGC WES Specification and described in the GeoServer manual.
If you must have REST access to the features you could use the experimental OGC Features API module to do this.

Calling parse function in swift fails

I am working on a food delivery app, which uses parse as its backend. I am facing a problem while calling the placeOrder API through
PFCloud.callFunction(inBackground: PlaceOrder, withParameters: params) { (data, err) in}
Please have a look at the JSON which I need to post below.
{
"source": "card_1EVYuOEynlyM6L4SHgBMJYRQ",
"userId": "YjSZYSXEp7",
"data": {
"menuItems": [{
"id": "QSYa2JDcIm",
"title": "Rice With Tibss(Beef)",
"menuTitle": "Rice With Tibss",
"submenuItem": [{
"id": "zaOo6G4KSV",
"name": "Beef",
"price": 12,
"desc": "Fillings?"
}],
"price": 24,
"qty": 1,
"storeId": "yqBCDmzaDP",
"storeName": "Ibex Ethiopian Cusine and Bar",
"orderType": "takeout",
"taxState": 0.0925,
"storeInfo": {
"cart_storeId": "yqBCDmzaDP",
"cart_storeName": "Ibex Ethiopian Cusine and Bar",
"cart_storeImage": "https://res.cloudinary.com/http-get-tolofood-com/image/upload/c_scale,h_199,q_auto,w_270/v1461575640/Ibex_lopx38.jpg",
"cart_storeCuisine": "Ethiopian",
"cart_storeDescription": "We always serve a quality food. We always serve a quality food. We always serve a quality food. We always serve a quality food.",
"cart_storeRating": 3.33,
"cart_storeDelivery": false,
"takeout": true,
"address": "12255 Greenville Ave,Dallas, TX 75243",
"slugname": "TX_DAL_ibex_ethiopian_cuisine_and_bar",
"multiple_location": false,
"cart_storeDeliveryFee": 15,
"cart_storeServes": "Lunch,Dinner",
"busy": false,
"cart_storeSeoSlug": "ibex-ethiopian-cusine-and-bar"
},
"enable": true,
"voice_read_mi_label": "fbgcb",
"voice_read_mi_option": false,
"menuTypeName": "Standard"
}],
"lastOrderType": "takeout",
"searchedAddress": "takeout",
"timeData": {
"day": "06-05-2019",
"time": "12:55 am",
"tz": "America/Los_Angeles"
}
},
"unavailable_option": "restaurant_recommendation"
}
And below is the Swift code which I have used to make pass it.
let storeInfo: Dictionary = [CartStoreId: self.cartStoreId, CartStoreName: self.cartRestaurantName, CartStoreImage: self.cartStoreImage, CartStoreCuisine: self.cartStoreCuisine, CartStoreDescription: self.cartStoreDescription, CartStoreRating: self.cartStoreRating, CartStoreDelivery: self.cartStoreDelivery, Takeout: self.takeOut, Address: self.address, Slugname: self.slugName, MultipleLocation: self.multipleLocation, CartStoreDeliveryFee: self.cartStoreDelivery, CartStoreServes: self.cartStoreServes, Busy: self.busy, CartStoreSeoSlug: self.cartStoreSeoSlug] as Dictionary
let subMenuItem = ["id": "zaOo6G4KSV", "name": "Beef", "price": 12, "desc": "Fillings?", "voice_read_submi_label":"bf", "voice_read_submi_option":false, "disabled": false] as [String: Any]
let ordersDictionary = [
"id" : "1234",
"title" : "Test",
"menuTitle" : "MenuName",
"price" : 23,
"qty" : 2,
"storeId" : 23,
"orderType" : "standard",
"taxState" : 0.22,
"enable" : true,
"menuTypeName" : "Type Name",
"voice_read_mi_label":"fdfs",
"voice_read_mi_option":"false",
"submenuitem": subMenuItem,
"storeInfo": storeInfo
] as Dictionary
let timeData = ["day" : 17-06-2019, "time": "11:00 AM", "tz": "America/Los_Angeles"] as Dictionary
let data = ["menuItems": ordersDictionary, "lastOrderType": "takeout", "searchedAddress": "takeout", "timeData" : timeData] as Dictionary
let params = [UserId: self.userId, "source":"card_1EVYuOEynlyM6L4SHgBMJYRQ", "data": data, "unavailable_option":"restaurant_recommendation","_ApplicationId":"6EuadToYoFGJhI1sX8XnuFBz9tp9l3yH6HxzzXZO", "_JavaScriptKey":"rQkALu9saFtF2oq9yCibyw6mEcs3PVqct3uuP6vg", "_ClientVersion":"js1.6.14", "_InstallationId":"444ec64d-5fcc-7b8e-596e-6be627892c2a",
"_SessionToken":"r:c966376120c8eca77aa63c29d5bebe1a"] as Dictionary
After all this is done I call the parse function like below.
PFCloud.callFunction(inBackground: PlaceOrder, withParameters: params) { (data, err) in
if err != nil {
print(err!)
} else {
print(data!)
}
}
But this gives me error after a few seconds saying
"Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}"
I have searched the web with the error and made fixes accordingly but still no success. Please help me guys.
I noticed that your params var is not compatible with the JSON you sent, there are more fields and also missing fields. Moreover, menuItems and submenuItem are an Array in your JSON and an Object in your code. It is probably making the cloud code function to fail and you are therefore not receiving back a valid JSON. Try the following and check if it works. In the case it works, just replace the values by your vars.
let params = [
"source": "card_1EVYuOEynlyM6L4SHgBMJYRQ",
"userId": "YjSZYSXEp7",
"data": [
"menuItems": [[
"id": "QSYa2JDcIm",
"title": "Rice With Tibss(Beef)",
"menuTitle": "Rice With Tibss",
"submenuItem": [[
"id": "zaOo6G4KSV",
"name": "Beef",
"price": 12,
"desc": "Fillings?"
]],
"price": 24,
"qty": 1,
"storeId": "yqBCDmzaDP",
"storeName": "Ibex Ethiopian Cusine and Bar",
"orderType": "takeout",
"taxState": 0.0925,
"storeInfo": [
"cart_storeId": "yqBCDmzaDP",
"cart_storeName": "Ibex Ethiopian Cusine and Bar",
"cart_storeImage": "https://res.cloudinary.com/http-get-tolofood-com/image/upload/c_scale,h_199,q_auto,w_270/v1461575640/Ibex_lopx38.jpg",
"cart_storeCuisine": "Ethiopian",
"cart_storeDescription": "We always serve a quality food. We always serve a quality food. We always serve a quality food. We always serve a quality food.",
"cart_storeRating": 3.33,
"cart_storeDelivery": false,
"takeout": true,
"address": "12255 Greenville Ave,Dallas, TX 75243",
"slugname": "TX_DAL_ibex_ethiopian_cuisine_and_bar",
"multiple_location": false,
"cart_storeDeliveryFee": 15,
"cart_storeServes": "Lunch,Dinner",
"busy": false,
"cart_storeSeoSlug": "ibex-ethiopian-cusine-and-bar"
],
"enable": true,
"voice_read_mi_label": "fbgcb",
"voice_read_mi_option": false,
"menuTypeName": "Standard"
]],
"lastOrderType": "takeout",
"searchedAddress": "takeout",
"timeData": [
"day": "06-05-2019",
"time": "12:55 am",
"tz": "America/Los_Angeles"
]
],
"unavailable_option": "restaurant_recommendation"
]

How do I get french text FEMMES.COM to index as language variants of FEMMES

I need FEMMES.COM to get tokenized as singular + plural forms of the base word FEMME.
Custom Analyzer Config
"analyzers": [ { "#odata.type": "#Microsoft.Azure.Search.CustomAnalyzer", "name": "text_language_search_custom_analyzer", "tokenizer": "text_language_search_custom_analyzer_ms_tokenizer", "tokenFilters": [ "lowercase", "asciifolding" ], "charFilters": [ "html_strip" ] } ], "tokenizers": [ { "#odata.type": "#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer", "name": "text_language_search_custom_analyzer_ms_tokenizer", "maxTokenLength": 300, "isSearchTokenizer": false, "language": "english" } ], "tokenFilters": [], "charFilters": []}
Analyze API call for FEMMES
{ "analyzer": "text_language_search_custom_analyzer", "text": "FEMMES" }
Analyze API response for FEMMES
{ "#odata.context": "https://one-adscope-search-eu-stage.search.windows.net/$metadata#Microsoft.Azure.Search.V2016_09_01.AnalyzeResult", "tokens": [ { "token": "femme", "startOffset": 0, "endOffset": 6, "position": 0 }, { "token": "femmes", "startOffset": 0, "endOffset": 6, "position": 0 } ] }
Analyze API response for FEMMES.COM
{ "#odata.context": "https://one-adscope-search-eu-stage.search.windows.net/$metadata#Microsoft.Azure.Search.V2016_09_01.AnalyzeResult", "tokens": [ { "token": "femmes", "startOffset": 0, "endOffset": 6, "position": 0 }, { "token": "com", "startOffset": 7, "endOffset": 10, "position": 1 } ] }
Analyze API response for FEMMES COM
{ "#odata.context": "https://one-adscope-search-eu-stage.search.windows.net/$metadata#Microsoft.Azure.Search.V2016_09_01.AnalyzeResult", "tokens": [ { "token": "femme", "startOffset": 0, "endOffset": 6, "position": 0 }, { "token": "femmes", "startOffset": 0, "endOffset": 6, "position": 0 }, { "token": "com", "startOffset": 7, "endOffset": 10, "position": 1 } ]}
I think I figured this one out myself after some experimentation. I found the MappingCharFilter could be used to replace . with , before the indexer did the tokenization. This allowed the lemmatization/stemming to work as expected on the terms in question. I need to do more thorough integration tests with our other use cases, but I think this would solve the problem for anybody facing the same type of issue.
My previous answer was not correct. Azure Search implementation actually applies the language tokenizer BEFORE token filters. This essentially made the WordDelimiterToken filter useless in my use case.
What I ended up having to do was to pre-process data BEFORE I uploaded to Azure for indexing. In my C# code, I added some regex logic that would break apart text like FEMMES2017 into FEMMES 2017, before I sent it to Azure. This way, when the text got to Azure, the indexer would see FEMMES by itself and properly tokenize as FEMME and FEMMES using the language tokenizer.

Service Discovery versus DCOS Overlay Network

I've setup a DCOS 1.8 cluster and am currently familiarizing.
So far I have marathon-lb working like a charm with Jenkins via Host networking. Now I am trying to set things up using Overlay.
I have a couple of test containers, some in the dcos overlay network, some not. So far they can reach each other via IP, which is nice. However when I try to resolv containers on the overlay network using mesos-dns, all it resolves is the host address (not exactly what I am expecting).
So I played around some with marathon to figure it out. What I did was add a discovery block to ipAddress:
{
"volumes": null,
"id": "/mariadb10",
"cmd": null,
"args": null,
"user": null,
"env": {
"MYSQL_ROOT_PASSWORD": "foo"
},
"instances": 1,
"cpus": 1,
"mem": 1024,
"disk": 0,
"gpus": 0,
"executor": null,
"constraints": null,
"fetch": null,
"storeUrls": null,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"docker": {
"image": "mariadb:10.0",
"forcePullImage": false,
"privileged": false,
"network": "USER"
},
"type": "DOCKER",
"volumes": [
{
"containerPath": "/var/lib/mysql",
"hostPath": "/mnt/foo",
"mode": "RW"
}
]
},
"healthChecks": [
{
"protocol": "TCP",
"gracePeriodSeconds": 30,
"intervalSeconds": 10,
"timeoutSeconds": 10,
"maxConsecutiveFailures": 3,
"port": 3306
}
],
"readinessChecks": null,
"dependencies": null,
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"labels": null,
"acceptedResourceRoles": null,
"ipAddress": {
"networkName": "dcos",
"discovery": {
"ports": [
{ "number": 3306, "name": "mysql", "protocol": "tcp" }
]
}
},
"residency": null,
"secrets": null,
"taskKillGracePeriodSeconds": null
}
Marathon tells me this is not allowed with "Bridge" or "User" networks. However it did not complain about the following and launched the container:
{
"volumes": null,
"id": "/mariadb10",
"cmd": null,
"args": null,
"user": null,
"env": {
"MYSQL_ROOT_PASSWORD": "foo"
},
"instances": 1,
"cpus": 1,
"mem": 1024,
"disk": 0,
"gpus": 0,
"executor": null,
"constraints": null,
"fetch": null,
"storeUrls": null,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"docker": {
"image": "mariadb:10.0",
"forcePullImage": false,
"privileged": false,
"network": "USER"
},
"type": "DOCKER",
"volumes": [
{
"containerPath": "/var/lib/mysql",
"hostPath": "/mnt/foo",
"mode": "RW"
}
]
},
"healthChecks": [
{
"protocol": "TCP",
"gracePeriodSeconds": 30,
"intervalSeconds": 10,
"timeoutSeconds": 10,
"maxConsecutiveFailures": 3,
"port": 3306
}
],
"readinessChecks": null,
"dependencies": null,
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"labels": null,
"acceptedResourceRoles": null,
"ipAddress": {
"networkName": "dcos"
},
"residency": null,
"secrets": null,
"taskKillGracePeriodSeconds": null
}
Funny thing is, it does not use the overlay address anymore, but now listens to the hosts address and also announces the hosts address into the overlay network.
Am I just doing it wrong or does that not work as expected, yet?
So,
I found the solution myself. The easy workaround is to edit /opt/mesosphere/etc/mesos-dns.json. Then change the order of IPSources to list netinfo first.
For more information, you can also check here
Alternatively, you can use taskname.marathon.containerip.dcos.thisdcos.directory. It is documented here: https://docs.mesosphere.com/1.8/administration/overlay-networks/.

Resources