Windows Server AppFabric 1.1 - Failed to read remote registry key from host - appfabric-cache

I have just installed and configured AppFabric cache cluster with one Host (the local machine). I use SQL as the Provider.
When I launch the Caching Administration Windows PowerShell using Administrator privileges,
I got the following error,
Use-CacheCluster : ErrorCode<ERRCAdmin040>:SubStatus<ES0001>:Failed to connect
to hosts in the cluster
At line:1 char:62
+ Import-Module DistributedCacheAdministration;Use-CacheCluster <<<<
+ CategoryInfo : NotSpecified: (:) [Use-CacheCluster], DataCacheE
xception
+ FullyQualifiedErrorId : Microsoft.ApplicationServer.Caching.DataCacheExc
eption,Microsoft.ApplicationServer.Caching.Commands.UseCacheClusterCommand
When I opened the DCacheAdministration.log it shows as below,
Host XXX is Reachable.,DistributedCache.CacheAdmin,Verbose,2013-5-2 13:54:06.042
Failed to read remote registry key from host XXX: Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode<ERRCAdmin026>:SubStatus<ES0001>:Remote registry access failed on host XXX. Check if the required permissions are available and the host is not down. ---> System.ComponentModel.Win32Exception: The network path was not found at Microsoft.ApplicationServer.Caching.AdminApi.RemoteRegistry64.OpenRemoteConnection(String hostName) at Microsoft.ApplicationServer.Caching.AdminApi.RemoteRegistry64.OpenConnection(String hostName, String registryPath)at Microsoft.ApplicationServer.Caching.AdminApi.CacheAdmin.GetRemoteRegistryKey(String hostName, Boolean writable)
--- End of inner exception stack trace ---
at Microsoft.ApplicationServer.Caching.AdminApi.CacheAdmin.GetRemoteRegistryKey(String hostName, Boolean writable)
at Microsoft.ApplicationServer.Caching.AdminApi.CacheAdmin.GetServerVersion(String hostName),DistributedCache.CacheAdmin,Error,2013-5-2 13:54:08.053
Remote registry Service has been started. Which accounts needs read permission in regedit.exe? I have provided rights for LOCAL SERVICE (as Remote registry service use this as Logon) and for NETWORK SERVICE (Which i have used as Caching Service Account). Do i have to give any other permissions to make Registry key accessible??
Or what are the other things I need to check?
Please Help

I fixed the same issue by enabling the Remote Registry Services and running it. I think AppFabric tries to connect to the remote server (which is local machine) using domain name to manipulate registry.

What exactly do you see in the HOSTNAME reported in the error message "Failed to read remote registry key from host XXX". Is XXX the machine name of the local machine or FQDN of the machine or is it pointing to a totally different machine ???
If it is pointing to the local machine name or the FQDN of the local machine, then try putting an entry in the HOSTS file for the hostname pointing to 127.0.0.1 and see if that helps. If that doesn't then try restarting Remote Registry service and then run Restart-CacheCluster from the same PowerShell Caching Administration window and see if that helps.

It is FQDN. I tried editing the host file also and alos restarted the service and cachecluster, but resulted in the same issue.
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
127.0.0.1 <My FQDN>

Related

MongoDB: DNS issue of resolv.conf connecting to MongoDB

I want to export some data from MongoDB Atlas.
If I execute the command below, It tries connect localhost and export the data.
mongoexport --uri="mongodb+srv://<username>:<password>#name-of-project-x2lpw.mongodb.net/test" --collection users --out /tmp/testusers.json
Note: If you run this command from Windows CMD, it works fine
After researching the problem and with the help of a user, everything seems to point to a DNS problem and to the related resolv.conf file.
Below the original /etc/resolv.conf:
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
options edns0
search name.com
At the beginning that resulted into a connection failure as shown below:
But if I would change that address into the following public available address according to what advised on this post to 1.1.1.1 the connection is successful, see below:
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 1.1.1.1
options edns0
search name.com
Which resulted into a connection success as shown below:
HOWEVER the problem is that instead of explicitly connecting to the name of the MongoDB cluster, it will connect to the localhost, which is very strange as I successfully exported the files I was looking for from the real connection.
Which means that the machine was correctly connecting to the database but via localhost.
Everything seems to lead, also according to this source and also here to a DNS problem while connecting to MongoDB via terminal to export collections.
Now from this last post it not advisable to manually change this address for several reasons, therefore right after successfully exporting the data using DNS 1.1.1.1 I changed it back to its original DNS 127.0.0.53.
However I don't think this should be a proper behavior as every time I need to export data I will have to continuously and manually change this address.
What could be the reason for this strange behavior? And therefore what could be a long term solution without manually switching between DNS addresses?
Thanks for pointing to the right direction for solving this issue.
It seems you all ready have the answer in the links you mentioned. I will summarize this:
Install resolvconf (for Ubuntu apt install resolvconf), add the line nameserver 8.8.8.8 to /etc/resolvconf/resolv.conf.d/base, then run sudo resolvconf -u and to be sure service resolvconf restart.
To verify run systemd-resolve --status.
You should see on the first line your DNS server like here:
DNS Servers: 8.8.8.8
DNS Domain: sa-east-1.compute.internal
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
This solution persists between reboots.

Rye::Box commands failing on remote server

Firstly, I can ssh into the remote server and execute the following commands
cd public_html
du -sh
each successful & exiting with code 0.
Automating the process with Rye::Box & with option safe: false
rbox.cd :public_html
does change directory but also returns exit code -1
rbox.execute 'du -sh'
fails with error message "SocketError::getaddrinfo: Name or service not known"
Would appreciate an explanation if possible.
Check your hosts entry for 127.0.0.1
You might have to add a hostname in /etc/hosts for 127.0.0.1.
A similar question addresses this issue on SO.
See also
SocketError (getaddrinfo: Name or service not known) - Sunspot/Solr Rails development

Nagios - NRPE commands definitions

I have a Nagios server with 10 servers monitored. I'm using hostgroups and NRPE to check Cpu and Disks.
But by default, check_disk command definition doesn't exist in the NRPE configuration file.
Is there any way to define these alias commands only on the Nagios Server ?
I would to avoid to change the NRPE config file on each server...
Thanks.
Nagios server connects to the monitored server via NRPE and execute the defined command in the remote nrpe.cfg file. So, the command must exist in the nrpe config file of the server to be monitored.
In the other hand, the list of the nrpe commands to be executed in the mentioned remote server is located under the nagios server: .../nagios/configurations/objects/server1.cfg
To summarize:
In Nagios server:
Define the command in the corresponding server's cfg file. (The name of the check, the servers/server groups to be checked etc.)
In Monitored server (for every individual server):
Add the command in nrpe.cfg. (Show the checker script's path and give parameters.)

run a distribution test with jmeter in Vm Centos

I'm trying to run a distribution test for learning purpose and i'm using a Virtual machine Centos 7 as a slave in my Windows 7 ( master running in window 7) but even if i configure the master with the IP of the slave ( VM ), modifying the file jmeter.properties, doesn't work, i try run Jmeter-server in the Centos machine but this problem appears.
Created remote object: UnicastServerRef [liveRef: [endpoint:[127.0.0.1:44341](lo
cal),objID:[4e68a212:14a8564a618:-7fff, 5760053273490727502]]]
Server failed to start: java.rmi.RemoteException: Cannot start. localhost.locald
omain is a loopback address.
An error occurred: Cannot start. localhost.localdomain is a loopback address.
Can somebody give me a direction where look or a explanation how can i do it?
Thanks!
Put the following line in system.properties file: java.rmi.server.hostname=xxx.xxx.xxx.xxx
Alternatively start JMeter providing above property as a command-line argument as:
jmeter (or jmeter-server) -Djava.rmi.server.hostname=xxx.xxx.xxx.xxx
Double check your network configuration, i.e. make sure that your /etc/hosts file contains the following lines:
127.0.0.1 localhost localhost.localdomain
xxx.xxx.xxx.xxx your CentOS machine hostname
In all above cases xxx.xxx.xxx.xxx should be IP address of your CentOS machine and this IP address must be different from 127.0.0.1.
Also make sure that you select "Bridged" networking in your Virtual Machine, machines should be able to reach each other over the network, firewalls should be properly configured to allow communication, etc.
For more information on different JMeter Properties and ways of setting/overriding them see Apache JMeter Properties Customization Guide

Errors to Enable PSRemoting on win2008R2 and Win7

Today I need enable PSRemoting on W2008R2 and Win7:
All VMs are in workgroup.
I have setup same administrator account with same pwd on each VMs.
Run Enable-PSRemoting in powershell with administrator role.
However I still faced following errors:
Error 1:
Set-WSManQuickConfig : Access is denied.
Error 2:
[192.168.23.2] Connecting to remote server failed with the following
error message : The WinRM client cannot process th e request. If the
authentication scheme is different from Kerberos, or if the client
computer is not joined to a domain , then HTTPS transport must be used
or the destination machine must be added to the TrustedHosts
configuration setting. Use winrm.cmd to configure TrustedHosts. Note
that computers in the TrustedHosts list might not be authenticated.
You can get more information about that by running the following
command: winrm help config. For more information, see the
about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (:) [], PSRemotingTransportException
+ FullyQualifiedErrorId : PSSessionStateBroken
Error 3:
Set-WSManQuickConfig : WinRM firewall exception will not work since
one of the network connection types on this machine is set to Public.
Change the network connection type to either Domain or Private and try
again.
For error 3, run this command:
Set-WSManQuickConfig -SkipNetworkProfileCheck
When you connect your network, it gets set to Public, Private, or Domain. If the current profile is set to Public, Set-WSManQuickConfig will fail with that message. You can either change it (if the system will let you) or skip the profile check.
After google, error are fixed with following solution:
Error 1:
Set-WSManQuickConfig : Access is denied.
Solution:
Run following cmd with administrator role.
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
Error 2:
If the authentication scheme is different from Kerberos, or if the
client computer is not joined to a domain , then HTTPS transport must
be used or the destination machine must be added to the TrustedHosts
configuration setting.
Solution:
Run following cmd on your client machine
Set-Item WSMan:\localhost\Client\TrustedHosts *
Error 3:
Set-WSManQuickConfig : WinRM firewall exception will not work since
one of the network connection types on this machine is set to Public.
Change the network connection type to either Domain or Private and try
again.
Solution:
ref: http://blogs.msdn.com/b/powershell/archive/2009/04/03/setting-network-location-to-private.aspx
Run following ps script with adminsitrator role:
#Skip network location setting for pre-Vista operating systems
if([environment]::OSVersion.version.Major -lt 6) { return }
#Skip network location setting if local machine is joined to a domain.
if(1,3,4,5 -contains (Get-WmiObject win32_computersystem).DomainRole) { return }
#Get network connections
$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
$connections = $networkListManager.GetNetworkConnections()
#Set network location to Private for all networks
$connections | % {$_.GetNetwork().SetCategory(1)}