StreamInsight Connection Error: TCP error code 10061: No connection could be made because the target machine actively refused it

Answered StreamInsight Connection Error: TCP error code 10061: No connection could be made because the target machine actively refused it

  • 29 марта 2012 г. 22:17
     
     

    I am trying to connect to remote StreamInsight server via c# app and get "TCP error code 10061: No connection could be made because the target machine actively refused it" error. 

    this is the string I use to connect:

    using (Server server = Server.Connect(new System.ServiceModel.EndpointAddress(@"http://ServerName:8090/StreamInsight/StreamInsightInstanceName")))

    Firewall is turned off.

    If I try to connect from Event Flow Debugger with http://localhost/StreamInsight/StreamInsightInstanceName, it works fine, but with http://ServerName:8090/StreamInsight/StreamInsightInstanceName it gives same error. 

    Does anyone have an idea what it could be?

    thank you

Все ответы

  • 30 марта 2012 г. 13:53
     
     

    It sounds like there may not be anything listening on the port/URI. What is it that you are trying to connect to? Is it the built-in StreamInsight service or one that you are hosting using the embedded model?

    If the service, you need to make sure that the service is started. It is not started by default - it's set to manual. Also, the default URI for this instance doesn't have a port number ... it's on port 80. However, this can be changed. If you look in the StreamInsight installation folder, under Host, you will see a folder for each installed instance. The URI for the management service is in there.

    If connecting to an embedded instance, you will either need to "Run as Administrator" via User Account Control (being in the local admin group isn't enough) or use the netsh command to add a URI reservation. See this thread for some more details.


    DevBiker (aka J Sawyer)
    My Blog
    My Bike - Concours 14


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

  • 30 марта 2012 г. 13:56
     
     

    I looked at this again and noticed that you are connecting successfully on port 80, just not 8090. Why are you trying to connect to port 8090?

    The port 80 URI is the default for the StreamInsight service.


    DevBiker (aka J Sawyer)
    My Blog
    My Bike - Concours 14


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

  • 30 марта 2012 г. 19:28
     
     

    I am trying to connect sample StreamInsight app to see how it works. port 80 doesn't work either. Service is running on remote server. I added user in StreamInsight group as well. So, basically if I only run following:

    Server server1 = Server.Connect(new System.ServiceModel.EndpointAddress(@"http://RemoteMachineName:80/StreamInsight/StreamInsightInstanceName"));
                server1.CreateApplication("test");

    shouldn't it work?

  • 30 марта 2012 г. 19:38
     
     Отвечено

    As long as the URL is correct, yes, it looks good.

    However ... you may need to review the bindings in the configuration file for the service - [InstallDir]\Host\[InstanceName]\StreamInsightHost.exe.config. The default binding has a hostNameComparisonMode of "Exact" with localhost as the service endpoint address. With a hostNameComparisonMode of "Exact", only localhost will be valid for the binding ... no other DNS setting will be valid.

    You can do either of the following:

    1. Change the hostNameComparisonMode to StrongWildcard or WeakWildcard.
    2. Change the endpoint address to http://RemoteMachineName/StreamInsight/StreamInsightInstanceName.

    DevBiker (aka J Sawyer)
    My Blog
    My Bike - Concours 14


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

    • Помечено в качестве ответа DonnaTamta 7 апреля 2012 г. 1:22
    •  
  • 30 марта 2012 г. 20:23
     
     

    I'm so sorry to bother but this is driving me crazy. Nothing seems to work for me. I changed endpoint address in config file but now I get 

    There was no endpoint listening at http://RemoteMachineName/StreamInsight/myInstance that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
    -------------------
    The remote server returned an error: (404) Not Found.

    In this case RemoteMachineName is actually the local server name because I'm trying to connect to StreamInsight instance (myInstance) through Event Flow Debugger.

    I don't know if i'm being clear enough, but basically this is what I would like to do.I have 2 machines on a domain: ServerA and ServerB. I installed StreamInsight on ServerA and service is running. 

    Scenario 1: I try to connect to http://localhost/StreamInsight/myInstance through Event Flow Debugger from the same server (ServerA), so in this case there's only 1 server involved. Connection is successfull. Then, I try to connect to  http://ServerName:80/StreamInsight/myInstance, again,  through Event Flow Debugger, and it throws an error.

    Scenario 2: I try to run following code through c# from ServerB

    Server server = Server.Connect(new System.ServiceModel.EndpointAddress(@"http://ServerA:80/StreamInsight/myInstance"));
                server.CreateApplication("test");

    I get an error

    so all I want is to use StreamInsight Service that is installed on a different server. How can I achieve this.

    Thank you very much


    tmeladze

  • 30 марта 2012 г. 20:34
     
      С кодом

    You are going down the right path. And you aren't bothering ... it's what the forum is for.

    First, have you made sure that your user account is added to the StreamInsightUsers$[InstanceName] group on the target server?

    Second, verify that the service is running. And perhaps change the comparison mode to StrongWildcard.

    Third, did the inner exception say anything? Could you post the full stack trace? Have you also tried using Fiddler to see all of the traffic going back and forth?

    Finally ... and I can't see why it would make a difference ... but this is the code that I use to connect to a remote instance ...

    var endpointAddress = new System.ServiceModel.EndpointAddress(stringInsightUri); 
    using (Server cepServer = Server.Connect(endpointAddress)) 
    { 
          //Do stuff.
    } 
    
    Functionally, your version and mine should be identical. Maybe try dropping the :80?

    After that, it may help if you post the contents of your config file.


    DevBiker (aka J Sawyer)
    My Blog
    My Bike - Concours 14


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

  • 30 марта 2012 г. 21:18
     
     

    Account is added to that group, service is running. here is the config file. (ServerA is where StreamInsight Service is installed)

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <system.serviceModel>
            <bindings>
                <wsHttpBinding>
                    <binding name="NewBinding0" hostNameComparisonMode="StrongWildcard>
                        <security mode="Message">
                            <message clientCredentialType="Windows"/>
                        </security>
                    </binding>
                </wsHttpBinding>
            </bindings>
            <services>
                <service behaviorConfiguration="ServiceBehavior" name="Microsoft.ComplexEventProcessing.ManagementService.ManagementService">
                    <endpoint address="http://ServerA/StreamInsight/myInstance" binding="wsHttpBinding"
                        bindingConfiguration="NewBinding0" contract="Microsoft.ComplexEventProcessing.ManagementService.IManagementService" />
                </service>
            </services>
            <behaviors>
                <serviceBehaviors>
                    <behavior name="ServiceBehavior">
                      <serviceMetadata httpGetEnabled="false"/>
                    </behavior>
                </serviceBehaviors>
            </behaviors>

    connection string from ServerB: 

    var EndpointAddress = new System.ServiceModel.EndpointAddress(@"http://ServerA/StreamInsight/myInstance");

                using (Server server = Server.Connect(EndpointAddress))
                {
                    var myApp = server.CreateApplication("test");
                    
                }

    Inner exception: The remote server returned an error: (404) Not Found

    name of the machine is correct. I have tried with :80 or without. Since i changed hostNameComparisonMode, what should the endpoint address be in the config file?

    Thank you


    tmeladze

  • 30 марта 2012 г. 21:23
     
     
    Did you restart the service after making the config changes? And have you tried connecting with Event Flow Debugger from Server B?

    DevBiker (aka J Sawyer)
    My Blog
    My Bike - Concours 14


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

  • 7 апреля 2012 г. 1:21
     
     

    Sorry, I just got a chance to test it. Looks like I never restarted service after config changes. I still got error after that but it was something else. I had to specify login name in my connection string. So, finally I got the connection working. Thank you so much. 

    p.s. Do you have simple working example that tracks threads in coming from sql server? I tried so many of them and they all give some errors. 

    Thanks again



    tmeladze

  • 7 апреля 2012 г. 19:47
     
     
    Tracks threads incoming from Sql Server? I'm not sure that I understand what you are looking for here. What is it that you are trying to do and what kind of errors are you getting?

    DevBiker (aka J Sawyer)
    Ruminations of J.net


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.