Update port 8080 remap for Lithium 11/57511/1
authorDaniel Farrell <dfarrell@redhat.com>
Wed, 12 Aug 2015 23:21:02 +0000 (19:21 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Fri, 19 May 2017 16:52:24 +0000 (12:52 -0400)
Lithium changed how ODL opens port 8080, so the config needed to be
updated to match.

This is needed to support running ODL with other apps that rely on
8080.

Ideally, we'll eventually support remapping 8181 as well.

We also need to clarify our API for doing port remapping,
as the var name is horrible.

Change-Id: I74212c5fdc90cf6bf397f89ace0893f450568476
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
tasks/configure_nb_rest_port.yml
templates/jetty.xml [new file with mode: 0644]
templates/tomcat-server.xml [deleted file]
vars/main.yml

index 7a2f7f6b07e99d7be235f53fe7039af4208e493d..b67c3e1bfd9ccb17ea53cd5372d577149209f062 100644 (file)
@@ -1,7 +1,7 @@
 - name: Configure ODL NB REST port
   template:
-    src=tomcat-server.xml
-    dest=/opt/opendaylight/configuration/tomcat-server.xml
+    src=jetty.xml
+    dest=/opt/opendaylight/etc/jetty.xml
     owner=odl
     group=odl
   notify:
diff --git a/templates/jetty.xml b/templates/jetty.xml
new file mode 100644 (file)
index 0000000..40dfdfa
--- /dev/null
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//
+DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
+
+<Configure class="org.eclipse.jetty.server.Server">
+
+    <!-- =========================================================== -->
+    <!-- Set connectors -->
+    <!-- =========================================================== -->
+    <!-- One of each type! -->
+    <!-- =========================================================== -->
+
+    <!-- Use this connector for many frequently idle connections and for
+        threadless continuations. -->
+    <Call name="addConnector">
+        <Arg>
+            <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
+                <Set name="host">
+                    <Property name="jetty.host" />
+                </Set>
+                <Set name="port">
+                    <Property name="jetty.port" default="8181" />
+                </Set>
+                <Set name="maxIdleTime">300000</Set>
+                <Set name="Acceptors">2</Set>
+                <Set name="statsOn">false</Set>
+                <Set name="confidentialPort">8543</Set>
+                <Set name="lowResourcesConnections">20000</Set>
+                <Set name="lowResourcesMaxIdleTime">5000</Set>
+            </New>
+        </Arg>
+    </Call>
+    <Call name="addConnector">
+      <Arg>
+        <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
+          <Set name="host">
+            <Property name="jetty.host" />
+          </Set>
+          <Set name="port">
+            <Property name="jetty.port" default="{{ nb_rest_port  }}" />
+          </Set>
+          <Set name="maxIdleTime">300000</Set>
+          <Set name="Acceptors">2</Set>
+          <Set name="statsOn">false</Set>
+          <Set name="confidentialPort">8443</Set>
+          <Set name="lowResourcesConnections">20000</Set>
+          <Set name="lowResourcesMaxIdleTime">5000</Set>
+        </New>
+      </Arg>
+    </Call>
+
+    <!-- =========================================================== -->
+    <!-- Configure Authentication Realms -->
+    <!-- Realms may be configured for the entire server here, or -->
+    <!-- they can be configured for a specific web app in a context -->
+    <!-- configuration (see $(jetty.home)/contexts/test.xml for an -->
+    <!-- example). -->
+    <!-- =========================================================== -->
+    <Call name="addBean">
+        <Arg>
+            <New class="org.eclipse.jetty.plus.jaas.JAASLoginService">
+                <Set name="name">karaf</Set>
+                <Set name="loginModuleName">karaf</Set>
+                <Set name="roleClassNames">
+                    <Array type="java.lang.String">
+                        <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal
+                        </Item>
+                    </Array>
+                </Set>
+            </New>
+        </Arg>
+    </Call>
+    <Call name="addBean">
+        <Arg>
+            <New class="org.eclipse.jetty.plus.jaas.JAASLoginService">
+                <Set name="name">default</Set>
+                <Set name="loginModuleName">karaf</Set>
+                <Set name="roleClassNames">
+                    <Array type="java.lang.String">
+                        <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal
+                        </Item>
+                    </Array>
+                </Set>
+            </New>
+        </Arg>
+    </Call>
+
+</Configure>
diff --git a/templates/tomcat-server.xml b/templates/tomcat-server.xml
deleted file mode 100644 (file)
index 26af9c1..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!--
-  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.
--->
-<Server>
-  <!--APR library loader. Documentation at /docs/apr.html -->
-  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
-  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
-  <Listener className="org.apache.catalina.core.JasperListener" />
-  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
-  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
-  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
-  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
-
-  <Service name="Catalina">
-    <Connector port="{{ nb_rest_port  }}" protocol="HTTP/1.1"
-               connectionTimeout="20000"
-               redirectPort="8443" />
-
-<!--
-        Please remove the comments around the following Connector tag to enable HTTPS Authentication support.
-        Remember to add a valid keystore in the configuration folder.
-        More info : http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
--->
-
- <!--
-    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
-               maxThreads="150" scheme="https" secure="true"
-               clientAuth="false" sslProtocol="TLS"
-               keystoreFile="configuration/keystore"
-               keystorePass="changeit"/>
- -->
-
-    <Engine name="Catalina" defaultHost="localhost">
-      <Host name="localhost" appBase=""
-            unpackWARs="false" autoDeploy="false"
-            deployOnStartup="false" createDirs="false">
-            <Realm className="org.opendaylight.controller.karafsecurity.ControllerCustomRealm" />
-            <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-            <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
-                        prefix="web_access_log_" suffix=".txt" resolveHosts="false"
-                        rotatable="true" fileDateFormat="yyyy-MM"
-                        pattern="%{yyyy-MM-dd HH:mm:ss.SSS z}t - [%a] - %r"/>
-      </Host>
-    </Engine>
-  </Service>
-</Server>
index 731dc88f93a29561b6498d7e5dad41b3fb1b5083..7ea787d22c3e6d70745e73d56113afbd385e55d9 100644 (file)
@@ -33,7 +33,7 @@ extra_features: []
 
 # Specifies the port for the ODL northbound REST interface to listen on.
 # This was added because OpenStack's Swift project uses a conflicting port.
-nb_rest_port: 8282
+nb_rest_port: 8080
 
 # Karaf feature repositories configured by default in ODL's release arifact.
 # You likely don't need to override these. Override the extra_feature_repos