Remove straggling zookeper references 47/79947/1
authorTschaen, Brendan <ctschaen@att.com>
Thu, 7 Mar 2019 21:43:47 +0000 (16:43 -0500)
committerTschaen, Brendan <ctschaen@att.com>
Thu, 7 Mar 2019 21:57:02 +0000 (16:57 -0500)
Issue-ID: MUSIC-361
Signed-off-by: Tschaen, Brendan <ctschaen@att.com>
Change-Id: I4faac78bc898b07902ce97ac6112f0dcd4a3729a

16 files changed:
README.md
WebContent/WEB-INF/music.properties.sample
distribution/tomcat/Dockerfile [deleted file]
distribution/zookeeper/Dockerfile [deleted file]
docs/multi.rst
docs/setup.rst
docs/single.rst
docs/swagger.json
pom.xml
src/main/java/org/onap/music/eelf/logging/format/AppMessages.java
src/main/java/org/onap/music/lockingservice/cassandra/MusicLockState.java
src/main/java/org/onap/music/main/MusicUtil.java
src/main/java/org/onap/music/main/PropertiesLoader.java
src/main/java/org/onap/music/rest/RestMusicLocksAPI.java
src/test/java/org/onap/music/unittests/MusicUtilTest.java
src/test/java/org/onap/music/unittests/TestRestMusicQAPI.java

index 9d5c4cd..e826f7c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -32,25 +32,19 @@ MUSIC is to be installed in a single Dir.
 /opt/app/music/etc
 /opt/app/music/logs
 ```
-When installing Tomcat, Cassandra and Zookeeper they should also be installed here. 
+When installing Cassandra it should also be installed here. 
 ```bash
 /opt/app/music/apache-cassandra-n.n.n
-/opt/app/music/zookeeper-n.n.n
-/opt/app/music/apache-tomcat-n.n.n
 ```
 Its suggested you create links from install dirs to a common name ie:
 ```bash 
 ln -s /opt/app/music/apache-cassandra-n.n.n cassandra
-ln -s /opt/app/music/zookeeper-n.n.n zookeeper
-ln -s /opt/app/music/apache-tomcat-n.n.n tomcat
 ```
  
-Cassandra and Zookeeper have data dirs. 
+Cassandra has data dirs. 
 ```bash
 # For cassandra it should be (This is the default) 
 /opt/app/music/cassandra/data
-# For Zookeeper it should be 
-/opt/app/music/var/zookeeper/
 ```
  
 If you are using a VM make sure it has at least 8 GB of RAM (It may work with 4 GB, but with 2 GB it
@@ -69,7 +63,6 @@ does give issues).
 - Ensure you have java jdk 8 or above working on your machine.
 - Download apache Apache Cassandra 3.2, install into /opt/app/music and follow these instructions http://cassandra.apache.org/doc/latest/getting_started/installing.html till and including Step
 - By the end of this you should have Cassandra working.
-- Download Apache Zookeeper 3.4.6, install into /opt/app/music and follow these instructions https://zookeeper.apache.org/doc/trunk/zookeeperStarted.html pertaining to the standalone operation. By the end of this you should have Zookeeper working.
 - Create a music.properties file and place it in /opt/app/music/etc/. Here is a sample of the file:
 
 ```properties 
@@ -80,7 +73,6 @@ all.public.ips=localhost
 #######################################
 # Optional current values are defaults
 #######################################
-#zookeeper.host=localhost
 #cassandra.host=localhost
 #music.ip=localhost
 #debug=true
@@ -92,10 +84,11 @@ aaf.endpoint.url=http://aafendpoint/proxy/authz/nss/
 ```
 
 - Make a dir /opt/app/music/logs MUSIC dir with MUSIC logs will be created in this dir after MUSIC starts.
-- Download the latest Apache Tomcat and install it using these instructions http://tecadmin.net/install-tomcat-9-on-ubuntu/ (this is for version 9).
-- Build the MUSIC.war (or download it from https://github.com/att/music/blob/master/MUSIC.war) and place it within the webapps folder of the tomcat installation.
 - Authentications/AAF Setup For Authentication setup.
-- Start tomcat and you should now have MUSIC running.
+- Start MUSIC using the jar built in distribution/music folder
+```bash
+java -jar music.jar
+```
 
  
 Extra Cassandra information for Authentication:
@@ -207,50 +200,6 @@ cassandra.password=<new_password>
 
 To access keyspace through cqlsh, login with credentials that are passed to MUSIC while creating the keyspace.
 
-#### Zookeeper:
-
-Once zookeeper has been installed on all the nodes, modify the  zk_install_location/conf/zoo.cfg on all the nodes with the following lines:
-```properties
-tickTime=2000
-dataDir=/opt/app/music/var/zookeeper
-clientPort=2181
-initLimit=5
-syncLimit=2
-quorumListenOnAllIPs=true
-server.1=public IP of node 1:2888:3888
-server.2=public IP of node 2:2888:3888
-server.3=public IP of node 3:2888:3888
-```
-In /opt/app/music/var/zookeeper in all the machines, create a file called myid that contains the id of the machine. The machine running node.i will contain just the number i in the file myid.
-
-Start each of the nodes one by one from the zk_install_location/bin folder using the command:
-```bash
-./zkServer.sh start
-```
-On each node check the file zookeeper.out in the  zk_install_location/ bin to make sure all the machines are talking to each other and there are no errors. Note that while the machines are yet to come up there maybe error messages saying that connection has not yet been established. Clearly, this is ok.
-
-If there are no errors, then from zk_install_location/bin simply run the following to get command line access to zookeeper.   ./zkCli.sh
-
-Run these commands on different machines to make sure the zk nodes are syncing.
-```bash
-[zkshell] ls /
-[zookeeper]
-```
-Next, create a new znode by running
-```bash
-create /zk_test my_data.
-```
-This creates a new znode and associates the string "my_data" with the node. You should see:
-```bash
-[zkshell] create /zk_test my_data
-Created /zk_test
-```
-Issue another ls / command to see what the directory looks like:
-```bash
-[zkshell] ls /
-[zookeeper, zk_test]
-```
-
 #### MUSIC
 
 Create a music.properties file and place it in /opt/app/music/etc at each node. Here is a sample of the file: If this location is to be changed please update the file project.properties in the src/main/resources directory before compiling MUSIC to a war.
@@ -263,7 +212,6 @@ all.public.ips=public IP of node 0:public IP of node 1:public IP of node 2
 #######################################
 # Optional current values are defaults
 #######################################
-#zookeeper.host=localhost
 #cassandra.host=localhost
 #music.ip=localhost
 #debug=true
index d562429..871b0c3 100644 (file)
@@ -6,7 +6,6 @@ all.public.ips=12.13.14.45:12.13.14.46:12.13.14.47
 #######################################
 # Optional current values are defaults
 #######################################
-#zookeeper.host=localhost
 #cassandra.host=localhost
 #music.ip=localhost
 #debug=true
diff --git a/distribution/tomcat/Dockerfile b/distribution/tomcat/Dockerfile
deleted file mode 100644 (file)
index 7d4f2ad..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-FROM library/tomcat:8.5
-LABEL purpose="Tomcat for MUSIC"
-
diff --git a/distribution/zookeeper/Dockerfile b/distribution/zookeeper/Dockerfile
deleted file mode 100644 (file)
index fdc89dc..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-FROM library/zookeeper:3.4
-LABEL purpose="For MUSIC"
-
index bc26465..380f4ea 100644 (file)
@@ -72,63 +72,6 @@ To access keyspace through cqlsh, login with credentials that are passed to MUSI
 
 
 
-Zookeeper:
-----------
-Once zookeeper has been installed on all the nodes, modify the  **zk_install_location/conf/zoo.cfg** on all the nodes with the following lines:
-
-::
-
-    tickTime=2000
-    dataDir=/opt/app/music/var/zookeeper
-    clientPort=2181
-    initLimit=5
-    syncLimit=2
-    quorumListenOnAllIPs=true
-    server.1=public IP of node 1:2888:3888
-    server.2=public IP of node 2:2888:3888
-    server.3=public IP of node 3:2888:3888
-
-Create the directory /var/zookeeper in all the machines and within that create a file called myid that contains the id of the machine. The machine running node.i will contain just the number i in the file myid.
-
-Start each of the nodes one by one from the zk_install_location/bin folder using the command:
-
-
-
- ./zkServer.sh start
-
-On each node check the file zookeeper.out in the  zk_install_location/ bin to make sure all the machines are talking to each other and there are no errors. Note that while the machines are yet to come up there maybe error messages saying that connection has not yet been established. Clearly, this is ok.
-
-
-If there are no errors, then from zk_install_location/bin simply run the following to get command line access to zookeeper.   ./zkCli.sh
-
-
-Run these commands on different machines to make sure the zk nodes are syncing.
-
-::
-
-    [zkshell] ls /
-    [zookeeper]
-
-Next, create a new znode by running
-
-::
-
-    create /zk_test my_data.
-
-This creates a new znode and associates the string "my_data" with the node. You should see:
-
-::
-
-    [zkshell] create /zk_test my_data
-    Created /zk_test
-
-Issue another ls / command to see what the directory looks like:
-
-::
-
-    [zkshell] ls /
-    [zookeeper, zk_test]
-
 MUSIC
 Create a music.properties file and place it in /opt/app/music/etc at each node. Here is a sample of the file: 
 cassandra.yaml::
index b12acd0..7fb5bf4 100644 (file)
@@ -17,27 +17,20 @@ The main MUSIC dir should be::
     # These also need to be set up
     /opt/app/music/etc
     /opt/app/music/logs
-    /opt/app/music/lib/zookeeper
 
-When installing Tomcat, Cassandra and Zookeeper they should also be installed here.::
+When installing, Cassandra should also be installed here.::
 
     /opt/app/music/apache-cassandra-n.n.n
-    /opt/app/music/zookeeper-n.n.n
-    /opt/app/music/apache-tomcat-n.n.n
 
 
 You could also create links from install dirs to a common name ie\:::
 
     ln -s /opt/app/music/apache-cassandra-n.n.n cassandra
-    ln -s /opt/app/music/zookeeper-n.n.n zookeeper
-    ln -s /opt/app/music/apache-tomcat-n.n.n tomcat
 
-Cassandra and Zookeeper have data dirs.::
+Cassandra has data dirs.::
     
     # For cassandra it should be (This is the default) 
     /opt/app/music/cassandra/data    
-    # For Zookeeper it should be 
-    /opt/app/music/zookeeper/
 
 
 Continue by selecting the link to the setup you are doing.
index 060f02b..632db5a 100644 (file)
@@ -15,8 +15,6 @@ Instructions
 - Ensure you have OpenJDK 8 on your machine.
 - Download Apache Cassandra 3.0, install into /opt/app/music and follow these instructions http://cassandra.apache.org/doc/latest/getting_started/installing.html till and including Step
 - By the end of this you should have Cassandra working.
-- Download Apache Zookeeper 3.4.6, install into /opt/app/music and follow these instructions https://zookeeper.apache.org/doc/r3.4.6/zookeeperStarted.html pertaining to the standalone operation. By the end of this you should have Zookeeper working.
-- Download the Version 8.5 Apache Tomcat and install it using these instructions https://tomcat.apache.org/download-80.cgi (this is for version 8.5).
 - Create a music.properties file and place it in /opt/app/music/etc/. Here is a sample of the file:
 
 music.properties::
@@ -30,7 +28,6 @@ music.properties::
     # Optional current values are defaults
     ######################################
     # If using docker this would point to the specific docker name.
-    #zookeeper.host=localhost
     #cassandra.host=localhost
     #music.ip=localhost
  
index 534d2af..3bc6705 100644 (file)
           "Lock Api"
         ],
         "summary": "Create Lock",
-        "description": "Puts the requesting process in the q for this lock. The corresponding node will be created in zookeeper if it did not already exist. Lock Name is the \"key\" of the form keyspaceName.tableName.rowId",
+        "description": "Puts the requesting process in the q for this lock. The corresponding lock will be created if it did not already exist. Lock Name is the \"key\" of the form keyspaceName.tableName.rowId",
         "operationId": "createLockReference",
         "produces": [
           "application/json"
diff --git a/pom.xml b/pom.xml
index 68f835a..ef1fbbf 100755 (executable)
--- a/pom.xml
+++ b/pom.xml
             <artifactId>metrics-core</artifactId>
             <version>3.1.0</version>
         </dependency>
-        <dependency>
-            <groupId>org.apache.curator</groupId>
-            <artifactId>curator-test</artifactId>
-            <version>2.3.0</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.zookeeper</groupId>
-                    <artifactId>zookeeper</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.slf4j</groupId>
-                    <artifactId>slf4j-log4j12</artifactId>
-                </exclusion>
-            </exclusions>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
index 40f69e3..5af3661 100644 (file)
@@ -55,10 +55,10 @@ public enum AppMessages {
      * [ERR402E] Ill formed queryObject for the request
      * [ERR403E] Error processing Prepared Query Object  
      * 
-     * 500-599 - Zookeepr/Locking Related
+     * 500-599 - Locking Related
      * [ERR500E] Invalid lock
      * [ERR501E] Locking Error has occured
-     * [ERR502E] Zookeeper error has occured
+     * [ERR502E] Deprecated
      * [ERR503E] Failed to aquire lock store handle  
      * [ERR504E] Failed to create Lock Reference
      * [ERR505E] Lock does not exist
@@ -68,7 +68,7 @@ public enum AppMessages {
      * [ERR509E] Lock not destroyed 
      * [ERR510E] Lock not released 
      * [ERR511E] Lock not deleted 
-     * [ERR512E] Failed to get ZK Lock Handle
+     * [ERR512E] Deprecated
      * 
      * 
      * 600 - 699 - Music Service Errors
@@ -113,7 +113,6 @@ public enum AppMessages {
     
     INVALIDLOCK("[ERR500E]"," Invalid lock or acquire failed",""," Lock is not valid to aquire"),
     LOCKINGERROR("[ERR501E]"," Locking Error has occured",""," Locking Error has occured"),
-    KEEPERERROR("[ERR502E]"," Zookeeper error has occured","","Please check zookeeper details"),
     LOCKHANDLE("[ERR503E]","Failed to aquire lock store handle",""," Failed to aquire lock store handle"),
     CREATELOCK("[ERR504E]","Failed to aquire lock store handle  ","","Failed to aquire lock store handle  "),
     LOCKSTATE("[ERR508E]"," Lock state not set",""," Lock state not set"),
index a8e5ac4..5128e2c 100644 (file)
@@ -35,7 +35,7 @@ import org.onap.music.eelf.logging.format.AppMessages;
 import org.onap.music.eelf.logging.format.ErrorSeverity;
 import org.onap.music.eelf.logging.format.ErrorTypes;
 
-// the state variable that will be stored in zookeeper, capturing the transitions of
+// the state variable that will be stored in the locking service, capturing the transitions of
 public class MusicLockState implements Serializable {
     public enum LockStatus {
         UNLOCKED, BEING_LOCKED, LOCKED
index aa82ea9..b737377 100755 (executable)
@@ -118,7 +118,7 @@ public class MusicUtil {
     private static String musicRestIp = LOCALHOST;
     private static String musicPropertiesFilePath = PROPERTIES_FILE;
     private static long defaultLockLeasePeriod = 6000;
-    private static final String[] propKeys = new String[] { "zookeeper.host", "cassandra.host", "music.ip", "debug",
+    private static final String[] propKeys = new String[] { "cassandra.host", "music.ip", "debug",
             "version", "music.rest.ip", "music.properties", "lock.lease.period", "id", "all.ids", "public.ip",
             "all.pubic.ips", "cassandra.user", "cassandra.password", "aaf.endpoint.url","admin.username","admin.password","aaf.admin.url",
             "music.namespace","admin.aaf.role","cassandra.port","lock.using"};
@@ -427,25 +427,6 @@ public class MusicUtil {
         return version;
     }
 
-    /**
-     * Get MyZkHost - Zookeeper Hostname - Default = localhost property file
-     * value - zookeeper.host
-     *
-     * @return
-     */
-    public static String getMyZkHost() {
-        return myZkHost;
-    }
-
-    /**
-     * Set MyZkHost - Zookeeper Hostname
-     *
-     * @param myZkHost
-     */
-    public static void setMyZkHost(String myZkHost) {
-        MusicUtil.myZkHost = myZkHost;
-    }
-
     /**
      * Get MyCassHost - Cassandra Hostname - Default = localhost property file
      * value - cassandra.host
@@ -734,8 +715,6 @@ public class MusicUtil {
         }
         // get the property value and return it
         MusicUtil.setMyCassaHost(prop.getProperty("cassandra.host"));
-        String zkHosts = prop.getProperty("zookeeper.host");
-        MusicUtil.setMyZkHost(zkHosts);
         MusicUtil.setCassName(prop.getProperty("cassandra.user"));
         MusicUtil.setCassPwd(prop.getProperty("cassandra.password"));
         MusicUtil.setCassandraPort(Integer.parseInt(prop.getProperty("cassandra.port")));
index ee10db4..db04ff4 100644 (file)
@@ -37,9 +37,6 @@ import org.springframework.stereotype.Component;
 @Component
 public class PropertiesLoader implements InitializingBean {
 
-    @Value("${zookeeper.host}")
-    private String zookeeperHost;
-    
     @Value("${cassandra.host}")
     public String cassandraHost;
     
@@ -168,8 +165,6 @@ public class PropertiesLoader implements InitializingBean {
         logger.info("#### Cassandra Host: " + MusicUtil.getMyCassaHost());
         if(myId != null && !myId.equals("${my.id}")) 
             MusicUtil.setMyId(Integer.parseInt(myId));
-        if(zookeeperHost != null && !zookeeperHost.equals("${zookeeper.host}"))
-            MusicUtil.setMyZkHost(zookeeperHost);
         if(notifyInterval != null && !notifyInterval.equals("${notify.interval}")) 
             MusicUtil.setNotifyInterval(Integer.parseInt(notifyInterval));
         if(notifyTimeout != null && !notifyTimeout.equals("${notify.timeout}"))
index b3e3b4d..943f4ca 100644 (file)
@@ -70,7 +70,7 @@ public class RestMusicLocksAPI {
 
     /**
      * Puts the requesting process in the q for this lock. The corresponding
-     * node will be created in zookeeper if it did not already exist
+     * node will be created if it did not already exist
      * 
      * @param lockName
      * @return
@@ -80,7 +80,7 @@ public class RestMusicLocksAPI {
     @Path("/create/{lockname}")
     @ApiOperation(value = "Create Lock",
         notes = "Puts the requesting process in the q for this lock." +
-        " The corresponding node will be created in zookeeper if it did not already exist." +
+        " The corresponding lock will be created if it did not already exist." +
         " Lock Name is the \"key\" of the form keyspaceName.tableName.rowId",
         response = Map.class)
     @Produces(MediaType.APPLICATION_JSON)    
index 47f387c..9835034 100644 (file)
@@ -92,7 +92,7 @@ public class MusicUtilTest {
 
     @Test
     public void testGetPropkeys() {
-        assertEquals(MusicUtil.getPropkeys()[2],"music.ip");
+        assertEquals(MusicUtil.getPropkeys()[2],"debug");
     }
 
     @Test
index c2666d2..4594ba2 100644 (file)
@@ -35,7 +35,6 @@ import javax.servlet.http.HttpServletResponse;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
-import org.apache.curator.test.TestingServer;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -85,7 +84,6 @@ public class TestRestMusicQAPI {
     RestMusicLocksAPI lock = new RestMusicLocksAPI(); 
     RestMusicQAPI qData = new RestMusicQAPI();
     static PreparedQueryObject testObject;
-    static TestingServer zkServer;
 
     @Mock
     static HttpServletResponse http;
@@ -216,8 +214,6 @@ public class TestRestMusicQAPI {
         MusicCore.eventualPut(testObject);
         if (MusicDataStoreHandle.mDstoreHandle!=null) {}
             //MusicDataStoreHandle.mDstoreHandle.close();
-        if (zkServer!=null)
-            zkServer.stop();
     }