2016-07-08 4 views
1

Apache Apollo를 설치하고 성공적으로 실행했습니다. 웹 대시 보드 http://127.0.0.1:61680/에 액세스 할 수 있습니다.Apache Apollo Connection Refused

STOMP를 통해 연결하고 싶습니다. 나는 이것을하기 위해 [StompKit] [1] 라이브러리를 사용하고 있습니다. 연결

private let host: String = "127.0.0.1" 
private let port: UInt = 61680 

private var client: STOMPClient! 

override func viewDidLoad() { 
    super.viewDidLoad() 

    client = STOMPClient(host: host, port: port) 
    connect() 
} 

연결이 거부 ​​오류와 함께 실패합니다.

이것은 apollo.xml 파일입니다.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<!-- 
    Licensed to the Apache Software Foundation (ASF) under one or more 
    contributor license agreements. See the NOTICE file distributed with 
    this work for additional information regarding copyright ownership. 
    The ASF licenses this file to You under the Apache License, Version 
    2.0 (the "License"); you may not use this file except in compliance 
    with the License. You may obtain a copy of the License at 
    http://www.apache.org/licenses/LICENSE-2.0 Unless required by 
    applicable law or agreed to in writing, software distributed under 
    the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 
    OR CONDITIONS OF ANY KIND, either express or implied. See the 
    License for the specific language governing permissions and 
    limitations under the License. 
--> 

<!-- 
    For more information on how configure this file please 
    reference: 

    http://activemq.apache.org/apollo/versions/1.7.1/website/documentation/user-manual.html 
    --> 
<broker xmlns="http://activemq.apache.org/schema/activemq/apollo"> 

    <notes> 
    The default configuration with tls/ssl enabled. 
    </notes> 

    <log_category console="console" security="security" connection="connection" audit="audit"/> 


    <authentication domain="apollo"/> 
    <!-- Give admins full access --> 
    <access_rule allow="admins" action="*"/> 
    <access_rule allow="*" action="connect" kind="connector"/> 


    <virtual_host id="mybroker"> 
    <!-- 
     You should add all the host names that this virtual host is known as 
     to properly support the STOMP 1.1 virtual host feature. 
     --> 
    <host_name>mybroker</host_name> 
    <host_name>localhost</host_name> 
    <host_name>127.0.0.1</host_name> 

    <!-- Uncomment to disable security for the virtual host --> 
    <!-- <authentication enabled="false"/> --> 

    <!-- Uncomment to disable security for the virtual host --> 
    <!-- <authentication enabled="false"/> --> 
    <access_rule allow="users" action="connect create destroy send receive consume"/> 


    <!-- You can delete this element if you want to disable persistence for this virtual host --> 
    <leveldb_store directory="${apollo.base}/data"/> 


    </virtual_host> 

    <web_admin bind="http://127.0.0.1:61680"/> 
    <web_admin bind="https://127.0.0.1:61681"/> 

    <connector id="tcp" bind="tcp://0.0.0.0:61613" connection_limit="2000"/> 
    <connector id="tls" bind="tls://0.0.0.0:61614" connection_limit="2000"/> 
    <connector id="ws" bind="ws://0.0.0.0:61623" connection_limit="2000"/> 
    <connector id="wss" bind="wss://0.0.0.0:61624" connection_limit="2000"/> 

    <key_storage file="${apollo.base}/etc/keystore" password="password" key_password="password"/> 

</broker> 

시도 1

만 나는 이것이 관련이 찾을 수있는 답변 [이] [2] (가 MQTT에 대한 비록). 어쨌든, authentication 행을 추가하여 apollo.xml 파일을 수정했습니다.

<virtual_host id="mybroker"> 
    <authentication enabled="false"/> 
... 

그러나 변경된 사항은 없습니다.

시도 2 ​​:

웹 대시 보드는 사용자 이름/암호 로그인이있다. 그래서 StompKit의 다른 방법을 시도했습니다.

client.connectWithLogin("admin", passcode: "password") { connectedFrame, error in 
    if let error = error { 
     print("Error during connecting: \(error.localizedDescription)") 
    } else { 
     print("Connected!") 
    } 
} 

그래도 오류가 지속됩니다.

내가 뭘 잘못하고 있니?

답변

0

기본적으로 STOMP 클라이언트는 포트 의 Apollo에 연결할 수 있습니다. 포트 61680은 웹 관리 인터페이스 용입니다.

귀하의 구성은

<connector id="tcp" bind="tcp://0.0.0.0:61613" connection_limit="2000"/> 

그래서 난 당신의 코드에서

private let port: UInt = 61613 

문제를


주를 해결해야한다고 가정 포함 당신이 있는지 확인 NETSTAT 또는 TCPView 사용할 수 있습니다 포트 61613이 열려 있음

+0

포트 번호를 '61613'으로 변경했지만 여전히 동일한 오류가 발생했습니다. 그런 다음 호스트를 '0.0.0.0'으로 변경하고 다시 시도했지만 여전히 운이 없습니다. – Isuru