I have a clickhouse server running on Linux subsystem for Windows on a Windows 2016 server. I've setup firewall rules for both inbound and outbound connections on both 9000 and 8123 ports. I used the default config. When I try to connect remotely got this exception:
DB::Exception: User default is not allowed to connect from address ::ffff:10.201.1.2
How should a user config look like so that a remote connection goes through.
In the users.xml configure the networks settings
<networks>
<ip>::/0</ip>
</networks>
In config.xml uncomment
<listen_host>::</listen_host>
You should allow access from external networks for default user. Add
<networks>
<ip>::/0</ip>
</networks>
to default user configuration. More details here.
Also it should be enabled by default.
I figured out the issue by myself.
I noticed that by default there is a allow_only_from_localhost.xml file inside the dbms\src\Server\user.d directory. So I thought I should remove this file and everything is going to work. It did not help, but I got inspired and moved my networks.xml file into the dbms\src\Server\user.d directory and TA-DA! remote connection finaly started working. Aside from relocating the file, I also adjusted its content, so that it matched the syntax from allow_only_from_localhost.xml file. It did not matter, Whether I kept the allow_only_from_localhost.xml file in the dbms\src\Server\user.d directory or not, remote connection worked in both cases.
Related
I am hoping to get some input on a configuration challenge I am having with a connection string connecting to a named SQL server instance when DNS resolution is not available.
What I have is a third party application that gets a connection string injected into a web.config file via a configuration utility. The configuration uses the server-name\instance-name format to connect to SQL server.
However, the server itself does not have the ability to resolve the name via DNS so it will not work. I can get the database connection working by using the IP address and unfortunately I cannot change the instance name that gets pushed to the web.config file.
I am trying to avoid having this break and need to be manually adjusted any time the configuration gets pushed.
What I am hoping to do is utilize the hosts file to get the connection working properly, but maybe there is another solution.
The database is a named instance, but is using the default port so in my hosts file I am able to add this:
Server-IP Server-Name
and then in my web.config use just the server name server-name in the connection string data source to make a connection.
However, the configuration will always push the data source as server-name\instance-name so I need to somehow get that additional instance name working in my local resolution.
I did try in the hosts file:
Server-Ip Server-Name\Instance-Name
but that did not work. Also server-name\instance-name in the connection string does not work with just the server-name in the hosts file.
As a reference all of the following will work in the connection string without anything in the hosts file:
Server-IP
Server-IP,Port
Server-IP,Port\InstanceName
but the only thing I can get working is server-name only in the hosts file and connection string.
As indicated by AlwaysLearning in the comments, the solution was to allow udp/1434 access for SSRP queries.
When I use getrange against a server the URIs all show localhost.
Is this normal?
I get a communication error when I go forward and want to eliminate this rather basic item.
Thanks in advance
Greg
The public address on the server needs to get set to the correct network address. The default seems to be localhost, so any links generated by the server will only work when opened on the server itself.
You can change the public network address in the MYOB API config file. That should be located on the server at C:\Program Files (x86)\MYOB\API\2.x.x.x\. The xml config file should be called MYOB.AccountRight.API.WindowsServiceHost.exe.config.
In the config file, under <appSettings> there should be a PublicAddressServer key. Update the corresponding value with the correct network address or DNS name for the server.
Lastly, restart the MYOB API service for the changes to take effect. The Windows service name should be MYOB AccountRight API Service.
Give that a try and see if it helps!
Edit: Source - http://myobapi.tumblr.com/post/70231017169/how-to-change-config-variables-for-the-desktop-api
I made ASP.NET MVC web application, uploaded the files, also the database, but I get the following error when browsing it.
The network path was not found
I'm using Entity Framework and this is the connection string in my web.config file
<connectionStrings>
<add name="[mydatabase]Entities" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=sql.[somedomain].net;initial catalog=[mydatabase name];User ID=[myUsername];Password=[myPassword];MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
I've uploaded many websites using IP Address eg. xxx.xxx.x.xxx as data source, but this is the first time to use server name eg. sql.[somedomain].net -I cannot get the server ip-, so I'm not sure if this caused the error, or if I should make something special to make it work.
So, I'm asking if there is something I should do to use server name as data source, if not then what else may cause this error.
This answer doesn't really help.
Thanks in advance.
Update
If I ping the server sql.[somedomain].net, I get this result
Ping request could not find host sql.[somedomain].net. Please check the name and try again.
And if I nslookup it, I get this result
*** Unknown can't find sql.[somedomain].net: Non-existent domain
So does that mean -for sure- that the server is not accessible. And is there anything I can do beside contacting the hosting technical support?
Solved
It was the Hosting Provider error/misconfiguration. After 3 days of searching and contacting the customer support, they realized it was their issue. I'm leaving this question to tell future viewers to Host Only with reliable/well-known Hosting Providers no matter what.
The info you got from tech support seems fairly contradictory. It's common to disable remote access for database servers, but if that's the case, then using the domain to connect doesn't really help you.
If you're trying to connect to this database from a published MVC project, residing with the same provider as supplies your database, then you should have no issues connecting as you're no longer "remote". However, unless your DNS is also hosted at the same provider, using the domain may make the connection appear remote, as it's going outside to come back in. The safest bet is to simply use the IP address of the database server in the connection string.
Also, pay attention to the IP address you have for the database server. If it's in the 10.* or 172.* range, it's a local IP, but if it's something else, it's most likely an outside IP address. Trying to connect to such an address, may also make the connection appear remote as you're going outside the network to come back in. Also, while disallowing remote access to a database server is a good idea, you can generally safely allow remote access to certain IPs. You most likely don't have control over that directly, but you can check with your provider to see if they can add an explicit rule for your web server's IP so that even if the connection is coming through as remote, it'll still work.
As far as working locally in development, you'll just have to use a local database. You may already have that covered, but your question wasn't entirely clear on that aspect.
I also faced the same issue. I used the forward slash instead of back slash for instance name (clustername\instancename). Once I changed it to back slash. It worked fine.
I have hosted my WebApp on server 1 and my database on server 2
But I'm getting following error
Communication with the underlying transaction manager has failed.
I googled and found a post which mentioned that it is the issue of DTC(Distributed Transaction)
I enabled DTC on server2(DB server) and made an exception of it in Firewall.
But still same error.
Here is the full stack trace
Message: System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException: The MSDTC transaction manager was unable to pull the transaction from the source transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02B)
at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32 propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, Guid& transactionIdentifier, OletxTransactionIsolationLevel& isolationLevel, ITransactionShim& transactionShim)
at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken)
Kindly advice
We had the exact same situation, and more than once. Each time, it was one of the following:
The IP address in the DNS for the server is outdated (as said in error message: "two machines cannot find each other by their NetBIOS names"). You can check if this is the case by trying ping servername from one server to another in the command prompt. If the ping by name fails and ping by IP succeeds (or ping by name returns the wrong IP), than you should talk to the System Admins to take a look at DNS/DHCP.
The servers are created as an image of preconfigured server (for example, if you are working with virtual machines, and instead of doing a fresh install for each of the servers, you simply clone the image). This is a problem because DTC has an internal "Identifier" - and in case of image cloning both your installations now have same DTC ID, and won't be able to communicate with each other. The solution is to simply uninstall and install the DTC again.
Hope it helps.
Things to check:
Have you done this configuration on both servers?
Are both servers members of the same domain?
Have you checked the event log?
I had the same problem while connecting to a remote SQl Server.
The solution in my case was to add "enlist=false" to the connection string.
I was missing quite a lot of things:
No authentication (as DB server and APP server and not within same AD domain)
Rule to Windows Firewall enabling msdtc.exe
Rule to firewall between DMZ and internal zone TCP 135,1024-65535 in both directions. The link tell you how to restrict the firewall policy to few ports only.
short / long server names to hosts or a shared DNS server. Eg. 192.168.1.1 app1 as well as 192.168.1.1 app1.domain.local
On the other hand based on this link my setup doesn't require:
Allow Remote Clients
Allow Remote Administration
Enable XA Transactions (required prior Windows Server 2003 SP1)
Solved after adding remote IP\machine name to files on server:
hosts, lmhosts
in folder
C:\Windows\System32\drivers\etc
One of our servers displayed this error after the Virtual Machine (VM) controlling our Domain Controller froze. Several related communication problems also started to pop up (like failed password resets). Resetting the frozen VM fixed the issue.
Lots of helpful answers already given.
One problem for me was the presence of invalid (cyrillic) characters in the computer name.
And there is also a way to validate the connection between two servers (or between a server and a computer) using a small tool from Microsoft called DTCPing.
I have a pgsql server running on windows 7. I can remotely connect to it within the network using the computer name, so i know that there are no issues with config etc. I have disabled firewall. I have a static ip and have tried to connect to the database from another network but i get the error: server does not listen. What am i doing wrong? I know small amounts about ip addresses so any help will be appreciated. thanks in advance!
EDIT:
A little more information, i have set up a home network, i have two computers networked together that can both access the pgsql server that resides on one of the computers. I am based in the uk and get my internet from plusnet, config is all done on the thompson gateway. The third computer is a remote computer not on the same network, i was just testing to see whether or not i could "host" a pgsql database for several, not networked computers. Its more of a hobbiest thing really, although would be could if i could do it for work reasons too. Thanks for you help. (sorry if i sound dumb but this really isnt my subject-yet!)
Configure the pg_hba.conf file to add the line
host all all 192.168.0.1/24 trust
that IP 192.168.0.1 is just for the sake of example, you'll put there your IP
then edit the postgresql.conf to reflect these settings
tcpip_socket = true
i think this ^^ is only required for older versions, but add it there anyway
listen_addresses='*'
by default it's localhost, put * to listen to all addresses, or just your IP to tighten up the security