Override dask scheduler_port - dask

I've tried several ports without success: 8787 is indeed busy serving rstudio. I could redirect rstudio, but shouldn't the following work?
from distributed import Client, LocalCluster
cluster = LocalCluster( scheduler_port = 8785 , n_workers = 2 )
Error:
/home/ec2-user/anaconda3/lib/python3.6/site-packages/distributed/bokeh/core.py:56: UserWarning:
Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the diagnostics dashboard on a random port instead.
warnings.warn('\n' + msg)
tornado.application - ERROR - Multiple exceptions in yield list
...
~/anaconda3/lib/python3.6/multiprocessing/forkserver.py in connect_to_new_process(self, fds)
64 raise ValueError('too many fds')
65 with socket.socket(socket.AF_UNIX) as client:
---> 66 client.connect(self._forkserver_address)
67 parent_r, child_w = os.pipe()
68 child_r, parent_w = os.pipe()
ConnectionRefusedError: [Errno 111] Connection refused

I think you need to override the diagnostics_port instead:
https://github.com/dask/distributed/blob/2ec428ae5652f7d068baeb18223fb8a04ab8804e/distributed/deploy/local.py#L45-L49

Related

nagios - nsclient - nsca - host_check message

I’ve configured some clients to use the nsca to send data to Nagios since I’m not able to connect from server to the client. I was able to achieve like everything I wanted, but one last thing is not exactly how I would like.
The host check / status information is not appending a message I want. This is my nsclient.ini conf:
[/settings/scheduler/schedules]
host_check = Check_OK
;host_check = Check_OK “OK”
And in the nagios server I see these messages:
Jun 30 06:52:02 localhost nagios: EXTERNAL COMMAND:
PROCESS_HOST_CHECK_RESULT;client;0;No message Jun 30 06:57:16
localhost nagios: EXTERNAL COMMAND:
PROCESS_HOST_CHECK_RESULT;client;0;No message Jun 30 07:02:31
localhost nagios: EXTERNAL COMMAND:
PROCESS_HOST_CHECK_RESULT;client;0;No message Jun 30 07:11:17
localhost nagios: EXTERNAL COMMAND:
PROCESS_HOST_CHECK_RESULT;client;3;Invalid command line: unrecognised
option 'OK' Jun 30 07:11:17 localhost nagios: Error: External command
failed -> PROCESS_HOST_CHECK_RESULT;client;3;Invalid command line:
unrecognised option 'OK' Jun 30 07:11:17 localhost nagios: External
command [1656573077] PROCESS_HOST_CHECK_RESULT;client;3;Invalid
command line: unrecognised option 'OK' returned error Command failed
So, when I use the “OK” I get that 3 invalid command line: unrecognised option ‘OK’ and when I don’t use any message I got that 0 No message.
Any thought what I’m doing wrong here?
nsclient version = NSCP-0.5.2.35-x64
Thanks!
It gave me some hard time to figure out but after deciding to check the documentation I tried couple other stuff and ended up with this way to get that message passed along:
host_check = check_ok message=OK
This way Nagios UI I can see the Status Information for the host as "OK" and how I was expecting.

Clickhouse does not find namedDataSource

On a Clickhouse Docker server, I try to use the Clickhouse-jdbc-bridge to access data on a Mariadb Docker server. But I am met with "NamedDataSource [jmdb-1] does not exist!" error.
I followed basic jdbc-bridge instructions over at https://clickhouse.com/docs/en/integrations/jdbc/jdbc-with-clickhouse
The jdbc-bridge is running:
root#c3410b41cd87:/# ps -aux | grep jdbc
root 251 0.3 1.3 6349608 108076 ? Sl 13:28 0:17 java -jar /clickhouse-jdbc-bridge/clickhouse-jdbc-bridge-2.0.7-shaded.jar
root 529 0.0 0.0 6300 716 pts/0 S+ 14:59 0:00 grep --color=auto jdbc
Here is my datasource file:
root#c3410b41cd87:/clickhouse-jdbc-bridge/config/datasources# cat jmdb-1.json
{
"jmdb-1": {
"driverUrls": [
"https://dlm.mariadb.com/2325871/Connectors/java/connector-java-3.0.5/mariadb-java-client-3.0.5.jar"
],
"jdbcUrl": "jdbc:mariadb://10.5.1.11:13306",
"username": "mariadb",
"password": "maria1234"
}
}
Here is my failing query with the resulting error:
SELECT * FROM jdbc('jmdb-1', 'mdb', 'mdb_sf1_region');
Received exception from server (version 22.5.1):
Code: 86. DB::Exception: Received from 10.5.1.31:9000. DB::Exception: Received error from remote server /columns_info?connection_string=jmdb-1&schema=mdb&table=mdb_sf1_region&external_table_functions_use_nulls=true. HTTP status code: 500 Internal Server Error, body: NamedDataSource [jmdb-1] does not exist!.
I assume, that Clickhouse can reach the jdbc-bridge because of the rror. But i have no clue, why the bridge does not find the datasource file. Any help appreciated!
The error message from the Clickhouse server trying to use the Clickhouse-JDBC-bridge is misleading.
At startup, the Clickhouse-JDBC-bridge loads the datasources and tries to connect with them. Only successful connected datasources get registered! So the Clickhouse-JDBC-bridge indeed finds the datasource file, but because there is an error in the file or the connection not working, the datasource does not get loaded and the error returned to the Clickhouse server says, the datasource does not exist.
One can query all registered datasources via:
SELECT * FROM jdbc('','show datasources');
If one does not find his datasource there, it is likely, that there is a typo in the datasources file or the server the datasource points to is not up.
On startup of the Clickhouse-JDBC-bridge, one can read the console output for further error messages about the datasource.

WhatsApp Business API - How to access a wacore container to Check-Health with Postman

After proceed with the installation of WhatsApp Business API (developer single instance) in docker on windows 10 Enterprise, I´m facing the following msg error when using https://192.168.43.200:8080/v1/health by postman
Error msg:
{
"meta": {
"version": "v2.33.3",
"api_status": "stable"
},
"errors": [
{
"code": 1014,
"title": "Internal error",
"details": "php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution. Please check if wacore is running: wacore:6252"
}
]
}
Looking in log files it´s seems that the core is listening in one port that is different from expected by web
---> Web log
[2021-02-24 12:46:38.560338] app.INFO: [064af96616514f6f8b41fc530047db4b] Matched route "{route}". {"route":"GET_v1_health","route_parameters":{"_controller":"WhatsApp\Controller\HealthController::getHealth","_route":"GET_v1_health"},"request_uri":"https://192.168.43.200:8080/v1/health","method":"GET"} []
[2021-02-24 12:46:38.587929] app.INFO: [064af96616514f6f8b41fc530047db4b] Guard authentication successful! {"token":"[object] (Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken: PostAuthenticationGuardToken(user="admin", authenticated=true, roles="ROLE_ADMIN"))","authenticator":"WhatsApp\Security\TokenAuthenticator"} []
[2021-02-24 12:47:14.646964] app.INFO: [064af96616514f6f8b41fc530047db4b] Response: {"meta":{"version":"v2.33.3","api_status":"stable"},"errors":[{"code":1014,"title":"Internal error","details":"php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution. Please check if wacore is running: wacore:6252"}]} []
[2021-02-24 12:47:14.650236] app.INFO: [064af96616514f6f8b41fc530047db4b] Request GET_/v1/health returns 500 in 36269.15 ms [] []
===================================================================================
Core log
D 2021-02-24 12:10:39.282 UTC 28 apiendpointmanager.cpp:190] Endpoint "healthcheck" is listening on address "0.0.0.0" port 6253 req_id=Main
D 2021-02-24 12:10:39.282 UTC 29 apiendpointmanager.cpp:190] Endpoint "control" is listening on address "0.0.0.0" port 6252 req_id=Main
===================================================================================
No one change was executed in docker-compose.yml. Is the same that is on GitHub (https://github.com/WhatsApp/WhatsApp-Business-API-Setup-Scripts) except network mode was changed "bridge" to "nat" since I´m using windows
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
9d811d5d3283 Default Switch ics local
27dc22b69113 nat nat local
4e2733cd792d none null local
$ docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8d7000856b95 docker.whatsapp.biz/web:v2.33.3 "/opt/whatsapp/bin/w…" 17 hours ago Exited (4294967295) 6 minutes ago postgres_waweb_1
909781cdb775 docker.whatsapp.biz/coreapp:v2.33.3 "/opt/whatsapp/bin/w…" 17 hours ago Up 5 minutes 6250-6253/tcp postgres_wacore_1
7d68b7a61cad postgres:10.6 "docker-entrypoint.s…" 17 hours ago Up 6 minutes 5432/tcp, 33060/tcp, 0.0.0.0:33060->3306/tcp postgres_db_1
219b1e393f21 nginx "/docker-entrypoint.…" 42 hours ago Exited (4294967295) 41 hours ago nostalgic_jennings
The current WA_API_VERSION is 2.33.3
Database used is Postgress10.6
Looking at a similar question answered by #WeiyanWang (How to access wacore container using WhatsApp Business API) I tried to execute the same command in Postgres, but no success
Regards,
after some investigation on scenery described, I found some settings mistakes in windows docker.
To fix these problems following the steps:
Change docker settings to original installation
Choose the option "Switch to linux container..."
Reinstall the WhatsApp Business Api following documentation
Note: Is not necessary change the "bridge" to "nat" network settings. I just only changed the "waweb" from 9090:443 to 8080:443

spring data elastic search Not a valid protocol version: This is not an HTTP port

I have the following elastic-search container configuration in my test case
#Container
public static GenericContainer container = new GenericContainer<>("elasticsearch:7.7.0")
.withExposedPorts(9200,9300).withEnv("discovery.type","single-node")
.withNetwork(Network.newNetwork())
.withNetworkAliases("someNetwork");
In a #BeforeAll annotated method I elasticsearch url property like this
System.setProperty("spring.data.elasticsearch.cluster-nodes", container.getContainerIpAddress() + ":" + container.getMappedPort(9300));
From power shell when I check the running containers (during the test case debug pause), I find something like this under ports column : 0.0.0.0:32844->9200/tcp, 0.0.0.0:32843->9300/tcp
When I print container.getContainerIpAddress() + ":" + container.getMappedPort(9300), I get the same port mapped to 9300 in the container ports column, in this case localhost:32843, for sure the port is random and get changed in every new run.
when the code `conf = repo.save(conf); run, I get the following exception:
Caused by: org.apache.http.ProtocolException: Not a valid protocol version: This is not an HTTP port
at org.apache.http.impl.nio.codecs.AbstractMessageParser.parse(AbstractMessageParser.java:209)
at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:245)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:591)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.http.ParseException: Not a valid protocol version: This is not an HTTP port
at org.apache.http.message.BasicLineParser.parseProtocolVersion(BasicLineParser.java:148)
at org.apache.http.message.BasicLineParser.parseStatusLine(BasicLineParser.java:366)
at org.apache.http.impl.nio.codecs.DefaultHttpResponseParser.createMessage(DefaultHttpResponseParser.java:112)
at org.apache.http.impl.nio.codecs.DefaultHttpResponseParser.createMessage(DefaultHttpResponseParser.java:50)
at org.apache.http.impl.nio.codecs.AbstractMessageParser.parseHeadLine(AbstractMessageParser.java:156)
at org.apache.http.impl.nio.codecs.AbstractMessageParser.parse(AbstractMessageParser.java:207)
... 11 more
`
You are using a REST client to access Elasticsearch on port 9300. This is the port for the TransportClient. Wit a REST client you need to target port 9200.

Why does FreeRadius fail to process the accounting response from Fortigate?

I have configured a freeradius proxy (3.0.16) on Ubuntu (4.15.0-47-generic). It receives the radius accounting packets from another radius server running on Ubuntu and writes those to another radius server on running on Fortigate.
Radius Server ---> Proxy Radius Server ---> Fortigate Radius Server
I have configured copy-acct-to-home-server to include the Realm in proxy.conf
proxy.conf ( Realm definition )
home_server myFortigate {
type = acct
ipaddr = <IP address of Fortigate Interface Running Radius>
port = 1813
secret = superSecret
}
home_server_pool myFortigatePool {
type = fail-over
home_server = myFortigate
}
realm myFortigateRealm {
acct_pool = myFortigatePool
nostrip
}
copy-acct-to-home-server entry
preacct {
preprocess
update control {
Proxy-To-Realm := myFortigateRealm
}
suffix
}
After I run the freeradius -X, I also run tcpdump from a new session
tcpdump -ni eth01 port 1812 or port 1813
and get the following log
15:03:40.225570 IP RADIUS_PROXY_IP.56813 > FORTIGATE_INTERFACE_IP.1813: RADIUS, Accounting-Request (4), id: 0x31 length: 371
15:03:40.236155 IP FORTIGATE_INTERFACE_IP.1813 > RADIUS_PROXY_IP.56813: RADIUS, Accounting-Response (5), id: 0x31 length: 27
Which basically shows it is sending the account request to fortigate radius server and receiving the accounting response.
But strangely freeradius -X debug output shows a request time out for the same radius server on Fortigate and it ultimately tags the server as zombie
Starting proxy to home server FORTIGATE_INTERFACE_IP port 1813
(14) Proxying request to home server FORTIGATE_INTERFACE_IP port 1813 timeout 30.000000
Waking up in 0.3 seconds.
(14) Expecting proxy response no later than 29.667200 seconds from now
Waking up in 3.5 seconds.
and Finally it gives up
25) accounting {
(25) [ok] = ok
(25) } # accounting = ok
(25) ERROR: Failed to find live home server: Cancelling proxy
(25) WARNING: No home server selected
(25) Clearing existing &reply: attributes
(25) Found Post-Proxy-Type Fail-Accounting
(25) Post-Proxy-Type sub-section not found. Ignoring.
So the situation is the Radius proxy is sending accounting packets to Fortigate Radius server (could be seen in both freeradius and fortigate logs)
tcpdump shows that Radius proxy is receiving accounting response from the fortigate, but for some reason freeradius process doesn't recognize (or can not read) accounting response. It may be some interoperability issue or I have missed to set some flag. Requesting help from the experts to isolate and rectify the issue.

Resources