From 2f34aa7d458a0e370571e5859d42e58618c75c23 Mon Sep 17 00:00:00 2001 From: Anuradha Hegde Date: Mon, 3 Oct 2016 16:33:48 +0000 Subject: [PATCH 1/3] Reduce the usage of jps in dcscheck script some minor fixes --- core/conn/odbc/src/odbc/Makefile | 2 -- core/sqf/sql/scripts/cleanlogs | 1 + core/sqf/sql/scripts/dcscheck | 18 ++++++++++++++---- core/sqf/sql/scripts/sqcheck | 6 +++++- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/core/conn/odbc/src/odbc/Makefile b/core/conn/odbc/src/odbc/Makefile index 29ec9ca3cf..019808593c 100644 --- a/core/conn/odbc/src/odbc/Makefile +++ b/core/conn/odbc/src/odbc/Makefile @@ -1,5 +1,3 @@ -# Top level HPDCS & WMS make file - # @@@ START COPYRIGHT @@@ # # Licensed to the Apache Software Foundation (ASF) under one diff --git a/core/sqf/sql/scripts/cleanlogs b/core/sqf/sql/scripts/cleanlogs index 83d9b3a2db..2bbc0ec1e0 100755 --- a/core/sqf/sql/scripts/cleanlogs +++ b/core/sqf/sql/scripts/cleanlogs @@ -43,6 +43,7 @@ function core_logs() { $L_PDSH "rm -f ${MY_SQROOT}/logs/*.err" $L_PDSH "rm -f ${MY_SQROOT}/logs/*.log" $L_PDSH "rm -f ${MY_SQROOT}/logs/*log.[0-9]*" + $L_PDSH "rm -f ${MY_SQROOT}/sql/scripts/stdout_*" fi } diff --git a/core/sqf/sql/scripts/dcscheck b/core/sqf/sql/scripts/dcscheck index a478451142..307839c00a 100755 --- a/core/sqf/sql/scripts/dcscheck +++ b/core/sqf/sql/scripts/dcscheck @@ -19,8 +19,6 @@ # @@@ END COPYRIGHT @@@ dcsznode=/$USER/dcs/master -dcstmp=/tmp/dcstmp-$USER.log -tmpjps=/tmp/jpstmp-$USER.log jpscmd=$JAVA_HOME/bin/jps cfg_mxo_cnt=0 act_mxo_cnt=0 @@ -40,14 +38,26 @@ else L_PDSH= fi +dcstmp=`mktemp -t` +if [[ $? != 0 ]]; then + echo "Error while getting a temporary file for dcstmp. Exiting." + exit 3 +fi + +tmpjps=`mktemp -t` +if [[ $? != 0 ]]; then + echo "Error while getting a temporary file for tmpjps. Exiting." + exit 3 +fi + tmp_ps=`mktemp -t` if [[ $? != 0 ]]; then - echo "Error while getting a temporary file. Exiting." + echo "Error while getting a temporary file for tmp_ps. Exiting." exit 3 fi tmp_chk=`mktemp -t` if [[ $? != 0 ]]; then - echo "Error while getting a temporary file. Exiting." + echo "Error while getting a temporary file tmp_chk. Exiting." exit 3 fi diff --git a/core/sqf/sql/scripts/sqcheck b/core/sqf/sql/scripts/sqcheck index c7b971ac0e..737a7f37f1 100755 --- a/core/sqf/sql/scripts/sqcheck +++ b/core/sqf/sql/scripts/sqcheck @@ -161,7 +161,11 @@ function getRestInfo { } jpscmd=$JAVA_HOME/bin/jps -tmpjps=/tmp/tmpjps-$USER.log +tmpjps=`mktemp -t` +if [[ $? != 0 ]]; then + echo "Error while getting a temporary file for tmpjps. Exiting." + exit 3 +fi begin_time_seconds=$(date +%s) declare -i max_checks From 449f48ae3935d87f1523af74613dff683e55be09 Mon Sep 17 00:00:00 2001 From: Anuradha Hegde Date: Mon, 24 Oct 2016 18:15:55 +0000 Subject: [PATCH 2/3] Documenation update for DCS and REST server Minor fixes in scripts --- .../src/main/asciidoc/_chapters/apis.adoc | 60 +++++++++++++++---- core/rest/src/main/asciidoc/index.adoc | 4 +- core/sqf/sql/scripts/cleanlogs | 7 +++ core/sqf/sql/scripts/install_traf_components | 3 +- .../asciidoc/_chapters/configuration.adoc | 17 +++--- .../asciidoc/_chapters/troubleshooting.adoc | 18 +++++- dcs/src/main/resources/dcs-default.xml | 2 +- .../src/asciidoc/_chapters/requirements.adoc | 2 +- 8 files changed, 83 insertions(+), 30 deletions(-) diff --git a/core/rest/src/main/asciidoc/_chapters/apis.adoc b/core/rest/src/main/asciidoc/_chapters/apis.adoc index d561b85a69..21980b47f6 100644 --- a/core/rest/src/main/asciidoc/_chapters/apis.adoc +++ b/core/rest/src/main/asciidoc/_chapters/apis.adoc @@ -157,11 +157,30 @@ Response Body: } } ---- - -== Example Usage -There are many ways/languages to use the REST API's. The following examples use the curl command line interface to do the REST GET calls. - -In this example the user wishes to know the status of all Trafodion resources. +== Supported REST APIs +There are many ways/languages to use the REST API's. The following examples use the curl command line interface to do the REST calls. + +[cols="15%,10%,40%,35%"] +|=== +| *EndPoint* | *HTTP Verb* | *Description* | *Example* +| /servers | GET | Displays the status of various Trafodion components |<> +| /dtm | GET | Displays the status of Distributed Transaction Manager(DTM) |<> +| /rms | GET | Displays the status of Runtime Management Statistics(RMS) |<> +| /dcs | GET | Displays the status of Database Connectivity Servers(DCS) |<> +| /dcs/summary | GET | Displays the configuration information of Database Connectivity Servers(DCS) |<> +| /dcs/connections | GET | Displays the client/server information of Database Connectivity Servers(DCS) from zookeeper |<> +| /nodes | GET | Displays the status of Trafodion nodes |<> +| /pstack | GET | Displays the call stack for a collection of Trafodion processes |<> +| /pstack/program/{program} | GET | Displays call stack for a specific Trafodion process |<> +| /jstack/program/{program} | GET | Displays call stack for a specific java process |<> +| /transactions | GET | Displays the status of Distributed Transaction manager(DTM) |<> +| /transactions/stats | GET | Displays the status of Distributed Transaction manager(DTM) service statistics |<> +|=== + +<<< +[[server-status]] +=== Displays the status of various components +In this example the user wishes to know the status of all Trafodion components. This a jsonized version of the _sqcheck -c all_ command. .Http command @@ -201,7 +220,8 @@ curl -X GET -H "Accept: application/json" http://{hostname}:4200/v1/servers/ ] } ---- - +[[dtm-status]] +=== Displays the status of Distributed Transaction Manager(DTM) In this example the user wishes to know the status of Trafodion DTM. This a jsonized version of the _sqcheck -c dtm_ command. @@ -212,7 +232,7 @@ curl -X GET -H "Accept: application/json" http://{hostname}:4200/v1/servers/dtm .Response ---- -{ + "STATE":"UP", "SUBSTATE":"OPERATIONAL", "PROCESSES": @@ -226,7 +246,8 @@ curl -X GET -H "Accept: application/json" http://{hostname}:4200/v1/servers/dtm ] } ---- - +[[rms-status]] +=== Status of RMS In this example the user wishes to know the status of Trafodion RMS. This a jsonized version of the _sqcheck -c rms_ command. @@ -252,7 +273,8 @@ curl -X GET -H "Accept: application/json" http://{hostname}:4200/v1/servers/rms ] } ---- - +[[dcs-status]] +=== Status of Database Connectivity Service (DCS) In this example the user wishes to know the status of Trafodion DCS components. This a jsonized version of the _sqcheck -c dcs_ command. @@ -283,7 +305,8 @@ curl -X GET -H "Accept: application/json" http://{hostname}:4200/v1/servers/dcs ] } ---- - +[[summary-status]] +=== Summary of DCS Configuration In this example the user wishes to see a summary of the Trafodion DCS configuration. The server retrieves this information by executing dcscheck script. @@ -303,6 +326,8 @@ curl -X GET -H "Accept: application/json" http://{hostname}:4200/v1/servers/dcs "Active DcsMaster": "\"node1\", pid 8526" } ---- +[[dcs-connection-status]] +=== Displays the client/server information In this example the user wishes to see the Trafodion DCS server/client connection information. The server retrieves this information from ZooKeeper. @@ -349,7 +374,8 @@ curl -X GET -H "Accept: application/json" http://{hostname}:4200/v1/servers/dcs } ] ---- - +[[node-status]] +=== Displays status of Trafodion nodes In this example the user wishes to know the status of Trafodion nodes. This is a jsonized version of the _sqnodestatus_ command. @@ -379,7 +405,8 @@ curl -X GET -H "Accept: application/json" http://{hostname}:4200/v1/servers/nod } ] ---- - +[[pstack-process]] +=== Gets the collection of stack for various Trafodion process In this example the user wishes to see the call stack for a collection of Trafodion processes. This is a jsonized version of the _sqpstack_ command. Newlines are added to all lines in the response so clients can recognize each end of line. @@ -545,6 +572,8 @@ curl -X GET -H "Accept: application/json" http://{hostname}:4200/v1/servers/pst #3 0x000000000041c48a in CCluster::exchangeNodeData() ()\n #4 0x0000000000409c9c in main ()\n"}] ---- +[[pstack-per-process]] +=== Displays call stack information for a specific process In this example the user wishes to see the call stack for Trafodion process id 20642. This is a jsonized version of the _sqpstack []_ command. Newlines are added to all lines @@ -628,6 +657,8 @@ curl -X GET -H "Accept: application/json" http://{hostname}:4200/v1/servers/pst } ] ---- +[[jstack-process]] +=== Displays the call stack for a specific java process In this example the user wishes to see the call Java stack for Trafodion process id 20642. This is a jsonized version of the _jstack []_ command. Newlines are added to all lines @@ -765,7 +796,8 @@ curl -X GET -H "Accept: application/json" http://{hostname}:4200/v1/servers/jst } ] ---- - +[[dtm-transactions]] +=== Displays status of transactions In this example the user wishes to know the status of Trafodion DTM service. This is a jsonized version of the _dtmci status tm_ command. @@ -795,6 +827,8 @@ curl -X GET -H "Accept: application/json" http://{hostname}:4200/v1/transaction } ] ---- +[[dtm-service-stats]] +=== Displays the transaction service statistics In this example the user wishes to know the Trafodion DTM service statistics. This is a jsonized version of the _dtmci stats_ command. diff --git a/core/rest/src/main/asciidoc/index.adoc b/core/rest/src/main/asciidoc/index.adoc index 166cbc4743..667050298d 100644 --- a/core/rest/src/main/asciidoc/index.adoc +++ b/core/rest/src/main/asciidoc/index.adoc @@ -68,11 +68,11 @@ under the License. include::_chapters/preface.adoc[] include::_chapters/getting_started.adoc[] -include::_chapters/configuration.adoc[] include::_chapters/architecture.adoc[] +include::_chapters/configuration.adoc[] include::_chapters/apis.adoc[] include::_chapters/troubleshooting.adoc[] = Appendix -include::_chapters/appendix_contributing_to_documentation.adoc[] \ No newline at end of file +include::_chapters/appendix_contributing_to_documentation.adoc[] diff --git a/core/sqf/sql/scripts/cleanlogs b/core/sqf/sql/scripts/cleanlogs index 2bbc0ec1e0..76ac55e2ab 100755 --- a/core/sqf/sql/scripts/cleanlogs +++ b/core/sqf/sql/scripts/cleanlogs @@ -44,6 +44,9 @@ function core_logs() { $L_PDSH "rm -f ${MY_SQROOT}/logs/*.log" $L_PDSH "rm -f ${MY_SQROOT}/logs/*log.[0-9]*" $L_PDSH "rm -f ${MY_SQROOT}/sql/scripts/stdout_*" + else + rm -f ${MY_SQROOT}/logs/* + rm -f ${MY_SQROOT}/sql/scripts/stdout_* fi } @@ -53,6 +56,8 @@ function dcs_logs() { $L_PDSH "rm -f ${DCS_INSTALL_DIR}/logs/*.log.[0-9]*" $L_PDSH "rm -f ${DCS_INSTALL_DIR}/logs/*.out" $L_PDSH "rm -f ${DCS_INSTALL_DIR}/logs/*.out.[0-9]*" + else + rm -f ${DCS_INSTALL_DIR}/logs/* fi } @@ -62,6 +67,8 @@ function rest_logs() { $L_PDSH "rm -f ${REST_INSTALL_DIR}/logs/*.log.[0-9]*" $L_PDSH "rm -f ${REST_INSTALL_DIR}/logs/*.out" $L_PDSH "rm -f ${REST_INSTALL_DIR}/logs/*.out.[0-9]*" + else + rm -f ${REST_INSTALL_DIR}/logs/* fi } diff --git a/core/sqf/sql/scripts/install_traf_components b/core/sqf/sql/scripts/install_traf_components index 709ff996c4..cd8e8af5cb 100755 --- a/core/sqf/sql/scripts/install_traf_components +++ b/core/sqf/sql/scripts/install_traf_components @@ -334,7 +334,8 @@ elif [[ \$1 == "t2" ]] then export LD_PRELOAD=\$JAVA_HOME/jre/lib/amd64/libjsig.so:\$MY_SQROOT/export/lib\$SQ_MBTYPE/libseabasesig.so ./phoenix_test.py --targettype=TR --javahome=\$JAVA_HOME \\ - --jdbccp=\$MY_SQROOT/export/lib/jdbcT2.jar --jdbctype=T2 + --jdbccp=\$MY_SQROOT/export/lib/jdbcT2.jar --jdbctype=T2 \\ + --nomvntest --tests="AlterTableTest,ArithmeticQueryTest,BinaryRowKeyTest,CoalesceFunctionTest,CompareDecimalToLongTest,CustomEntityDataTest,DeleteRangeTest,DescColumnSortOrderTest,DistinctCountTest,ExtendedQueryExecTest,FunkyNamesTest,IsNullTest,OrderByTest,QueryExecTest,SaltedTableTest,SaltedTableUpsertSelectTest,SaltedTableVarLengthRowKeyTest,SkipScanQueryTest,UpsertSelectAutoCommitTest,UpsertSelectTest,UpsertValuesTest],AutoCommitTest,CreateTableTest,ExecuteStatementsTest,GroupByCaseTest,IndexTest,KeyOnlyTest,MultiCfQueryExecTest,ProductMetricsTest,QueryExecWithoutSCNTest,QueryPlanTest,ReadIsolationLevelTest,ServerExceptionTest,StatementHintsTest,StddevTest,ToCharFunctionTest,ToNumberFunctionTest,TopNTest,UpsertBigValuesTest,VariableLengthPKTest,SaltedTableUpsertSelectTest" else echo "Usage: swphoenix (t2|t4)" exit 1 diff --git a/dcs/src/main/asciidoc/_chapters/configuration.adoc b/dcs/src/main/asciidoc/_chapters/configuration.adoc index 0eed4a52fa..bdb8294c5b 100644 --- a/dcs/src/main/asciidoc/_chapters/configuration.adoc +++ b/dcs/src/main/asciidoc/_chapters/configuration.adoc @@ -306,23 +306,20 @@ include::../../../../target/asciidoc/dcs-default.adoc[] Set DCS environment variables in this file. Examples include options to pass the JVM on start of an DCS daemon such as heap size and garbage collector configs. You can also set configurations for DCS configuration, log directories, niceness, ssh options, where to locate process pid files, etc. Open the file at _conf/dcs-env.sh_ and peruse its content. -Each option is fairly well documented. Add your own environment variables here if you want them read by DCS daemons on startup. - -Changes here will require a cluster restart for DCS to notice the change. +Each option is fairly well documented. Add your own environment variables here if you want them read by DCS daemons on startup. Changes done to this file requires restart of DCS. === _log4j.properties_ -Edit this file to change rate at which DCS files are rolled and to change the level at which DCS logs messages. - -Changes here will require a cluster restart for DCS to notice the change though log levels can be changed for -particular daemons via the DCS UI. +Edit this file to change rate at which DCS files are rolled over and, to change the level at which DCS logs messages. Changes done to this file will require restart of DCS. === _master_ -A plain-text file which lists host on which the primary master process should be started. Only one host allowed to be the -primary master +A plain-text file which lists hostname or host IP address on which the primary master process should be started. Only one host is allowed to be the primary master === _backup-masters_ A plain-text file which lists hosts on which the backup master process should be started. Only one host per line is allowed + +=== _servers_ +A plain-text file which lists hosts on which the DcsServer server process should be started. Only one host per line or the host name followed by the count or number of master executor servers. All servers listed in this file will be started and stopped when DCS start or stop is run. == Example Configurations @@ -468,4 +465,4 @@ There is no default value. You must ensure the value contains the correct interf === `dcs.master.floating.ip.external.ip.address` There is no default value. It is important that you set this to the dotted IP address appropriate for your network. -To change this configuration, edit _dcs-site.xml_, copy the changed file to all nodes in the cluster and restart dcs. \ No newline at end of file +To change this configuration, edit _dcs-site.xml_, copy the changed file to all nodes in the cluster and restart dcs. diff --git a/dcs/src/main/asciidoc/_chapters/troubleshooting.adoc b/dcs/src/main/asciidoc/_chapters/troubleshooting.adoc index 6a74484f97..9f948530a2 100644 --- a/dcs/src/main/asciidoc/_chapters/troubleshooting.adoc +++ b/dcs/src/main/asciidoc/_chapters/troubleshooting.adoc @@ -58,7 +58,7 @@ The DcsMaster web UI allows navigation to each DcsServer's web UI. [[trouble-tools-builtin-webserver]] ==== DcsServer Web Interface -DcsServers starts a web-interface on port 24420 by default. +DcsServers starts a web-interface on port 24410 by default. The DcsServer web UI lists its server metrics (build info, zookeeper quorum, usedHeap, maxHeap, etc.). @@ -151,4 +151,18 @@ See the link:http://wiki.apache.org/hadoop/ZooKeeper/Troubleshooting[ZooKeeper O It has suggestions and tools for checking disk and networking performance; i.e. the operating environment your ZooKeeper and DCS are running in. -Additionally, the utility <> may help investigate ZooKeeper issues. \ No newline at end of file +Additionally, the utility <> may help investigate ZooKeeper issues. + +[[trouble-ha]] +== High Availability +On Linux cluster, if you run into issues please check dcs log files located in $DCS_INSTALL_DIR/logs folder. + +Validate that the interace is set up correctly. This command should only show one additional interface for HA configuration +---- +pdsh $MY_NODES "/sbin/ip addr show |grep 23400" +---- + +Validate to get the list of all the DcsMaster that are configured and started in the cluster +---- +pdsh $MY_NODES $JAVA_HOME/bin/jps |grep -i dcsmaster +---- diff --git a/dcs/src/main/resources/dcs-default.xml b/dcs/src/main/resources/dcs-default.xml index cdff47ff6a..c8e45908c3 100644 --- a/dcs/src/main/resources/dcs-default.xml +++ b/dcs/src/main/resources/dcs-default.xml @@ -124,7 +124,7 @@ dcs.server.info.port - 40030 + 24410 The port for the DcsServer web UI Set to -1 if you do not want the server UI to run. diff --git a/docs/provisioning_guide/src/asciidoc/_chapters/requirements.adoc b/docs/provisioning_guide/src/asciidoc/_chapters/requirements.adoc index 1cfa12b88f..62ebbf4b95 100644 --- a/docs/provisioning_guide/src/asciidoc/_chapters/requirements.adoc +++ b/docs/provisioning_guide/src/asciidoc/_chapters/requirements.adoc @@ -131,7 +131,7 @@ The following table lists the default ports used by the different {project-name} | 4201 | rest-site.xml | trafodion.rest.https.port | Yes | 1 | HTTPS | {project-name} REST Server (HTTPS). | 23400 | dcs-site.xml | dcs.master.port | Yes | _n_ | binary | Start of {project-name} DCS port range. (37800 for {project-name} 1.1) | 24400 | dcs-site.xml | dcs.master.info.port | Yes | 1 | HTTP | DCS master web GUI. (40010 for {project-name} 1.1) -| 24410 | dcs-site.xml | dcs.server.info.port | Yes | _n_ | HTTP | Start of range for DCS server web GUIs. (40020 for {project-name} 1.1) +| 24410 | dcs-site.xml | dcs.server.info.port | Yes | _n_ | HTTP | Start of range for DCS server web GUIs. (40030 for {project-name} 1.1) | 50030 | mapred-site.xml | mapred.job.tracker.http.address | No | 1 | HTTP | MapReduce Job Tracker web GUI. | 50070 | hdfs-site.xml | dfs.http.address | No | 1 | HTTP | HDFS Name Node web GUI. | 50075 | hdfs-site.xml | dfs.datanode.http.address | No | 1 | HTTP | HDFS Data Node web GUI. From f7f1ee957ae07bd2cfbd38d6984876bbdedd6fed Mon Sep 17 00:00:00 2001 From: Anuradha Hegde Date: Tue, 25 Oct 2016 20:16:48 +0000 Subject: [PATCH 3/3] Updates to documentation --- .../src/main/asciidoc/_chapters/apis.adoc | 124 +----------------- .../main/asciidoc/_chapters/architecture.adoc | 6 +- .../asciidoc/_chapters/configuration.adoc | 26 ++-- .../asciidoc/_chapters/troubleshooting.adoc | 6 +- .../java/org/trafodion/rest/Constants.java | 2 +- .../asciidoc/_chapters/troubleshooting.adoc | 2 +- 6 files changed, 26 insertions(+), 140 deletions(-) diff --git a/core/rest/src/main/asciidoc/_chapters/apis.adoc b/core/rest/src/main/asciidoc/_chapters/apis.adoc index 21980b47f6..ceffd32b61 100644 --- a/core/rest/src/main/asciidoc/_chapters/apis.adoc +++ b/core/rest/src/main/asciidoc/_chapters/apis.adoc @@ -31,133 +31,19 @@ :icons: font :experimental: -The terms "representational state transfer" and "REST" were introduced in 2000 in the doctoral dissertation of -Roy Fielding, one of the principal authors of the Hypertext Transfer Protocol (HTTP) specification. In a nutshell - -A GET to an resource requests a copy of the information. - -A PUT to an resource replaces the resource. - -POST adds resources. - -DELETE eliminates resources. - [[rest]] -== Resource Identifiers +== REST APIs + The URIs for the REST-based web services have the following syntax: http://{hostname:port}/{version}/{resourcepath} The elements in this syntax are as follows: - {hostname} - The http address of the service to get information about. - Currently supported are the Trafodion DTM, RMS and DCS components. - {version} - The version of the APIs. In this release, the version is v1. - {resourcepath} - A path that defines a singleton resource or a collection of resources. + {hostname} - The http address of the service to get information about. + {version} - The version of the APIs. In this release, the version is v1. + {resourcepath} - A path that defines a singleton resource or a collection of resources. -== HTTP Requests -To invoke a REST API, your application calls an HTTP operation on the URI associated with a resource. - -.Headers -This release ignores Accept and Accept-Encoding headers. - -== HTTP Responses -The following sections describe the syntax of HTTP Responses. - -.Compression -This release does not support compression. - -.Response Formats -This release of the REST APIs supports responses in JSON format only. - -.Response Examples - -.JSON response with single resource - -HTTP Request: ----- -GET http://{hostname:4200}/v1/servers ----- - -Response Status Line: ----- -HTTP/1.1 200 OK ----- - -Response Header: ----- - HTTP/1.1 200 OK - Cache-Control: no-cache - Content-Type: application/json - Transfer-Encoding: chunked ----- - -Response Body: ----- -{ - "STATE":"UP", - "SUBSTATE":"OPERATIONAL", - "PROCESSES": - [ - { - "PROCESS":"DTM", - "CONFIGURED":2, - "ACTUAL":2, - "DOWN":""}, - { - "PROCESS":"RMS", - "CONFIGURED":4, - "ACTUAL":4, - "DOWN":"" - }, - { - "PROCESS":"DCSMASTER", - "CONFIGURED":2, - "ACTUAL":2, - "DOWN":"" - }, - { - "PROCESS":"MXOSRVR", - "CONFIGURED":4, - "ACTUAL":4, - "DOWN":"" - } - ] -} ----- - -.JSON response with Error response - -Here we request information about DCS client connections when DCS is stopped. - -HTTP Request: ----- -GET http://{hostname:4200}/v1/servers/dcs/connections ----- - -Response Status Line: ----- -HTTP/1.1 404 Not Found ----- - -Response Header: ----- - HTTP/1.1 404 Not Found - Content-Type: application/json - Transfer-Encoding: chunked ----- - -Response Body: ----- -{ - "RemoteException" : { - "javaClassName" : "org.trafodion.rest.NotFoundException", - "exception" : "NotFoundException", - "message" : "DCS connection resources not found" - } -} ----- -== Supported REST APIs There are many ways/languages to use the REST API's. The following examples use the curl command line interface to do the REST calls. [cols="15%,10%,40%,35%"] diff --git a/core/rest/src/main/asciidoc/_chapters/architecture.adoc b/core/rest/src/main/asciidoc/_chapters/architecture.adoc index 0272cb3e03..7891223b1b 100644 --- a/core/rest/src/main/asciidoc/_chapters/architecture.adoc +++ b/core/rest/src/main/asciidoc/_chapters/architecture.adoc @@ -64,7 +64,7 @@ HTTP and HTTPS requests. It's a 100% java implementation. [[server-startup]] === Startup Behavior -The server is started/stopped via the scripts found in the _/bin_ directory. During startup it opens a connection to ZooKeeper. +The server is started/stopped via the scripts found in the _$REST_INSTALL_DIR/bin_ directory. During startup it opens a connection to ZooKeeper. [[server-threads]] === Threads @@ -76,11 +76,11 @@ is configured but this may be changed in the configuration by modifying the _res [[server-processes-script-manager]] ==== ScriptManager -The script manager thread is responsible for reading and compiling the Python scripts found in _/bin/scripts_ directory. It +The script manager thread is responsible for reading and compiling the Python scripts found in _$REST_INSTALL_DIR/bin/scripts_ directory. It can detect a change in any script found there. If any script changes it will recompile it. ==== JDBC Type 4 An embedded driver is available to execute Trafodion SQL queries by connecting to the DCS service. ==== JDBC Type 2 -An embedded driver is available to execute Trafodion SQL queries. \ No newline at end of file +An embedded driver is available to execute Trafodion SQL queries. diff --git a/core/rest/src/main/asciidoc/_chapters/configuration.adoc b/core/rest/src/main/asciidoc/_chapters/configuration.adoc index 7b99b28eb2..3ad7d3f4aa 100644 --- a/core/rest/src/main/asciidoc/_chapters/configuration.adoc +++ b/core/rest/src/main/asciidoc/_chapters/configuration.adoc @@ -37,7 +37,7 @@ a thorough read of this chapter will help with non-standard configurations. Plea requirements have been satisfied. Failure to do so will cause you grief debugging strange errors. Trafodion REST uses the same configuration mechanism as Apache Hadoop. -All configuration files are located in the _conf/_ directory. +All configuration files are located in the _$REST_INSTALL_DIR/conf/_ directory. [TIP] ==== @@ -48,7 +48,7 @@ ensure well-formedness of your document after an edit session. .Keep Configuration In Sync Across the Cluster [WARNING] ==== -After you make an edit to any configuration file, make sure you copy the content of the _conf_ directory to all nodes of the cluster. +After you make an edit to any configuration file, make sure you copy the content of the _$REST_INSTALL_DIR/conf_ directory to all nodes of the cluster. The server will not do this for you. Use +rsync+, +scp+, or another secure mechanism for copying the configuration files to your nodes. A restart is needed for servers to pick up changes. ==== @@ -89,7 +89,7 @@ This `rest.zookeeper.quorum` property defaults to a single ensemble member at `l == Configuration Files === _rest-site.xml_ and _rest-default.xml_ -You add site-specific configuration to the file _conf/rest-site.xml_. For the list of configurable properties, +You add site-specific configuration to the file _$REST_INSTALL_DIR/conf/rest-site.xml_. For the list of configurable properties, see <> below or view the raw _rest-default.xml_ source file in the source code at _src/main/resources_. @@ -108,7 +108,7 @@ include::../../../../target/asciidoc/rest-default.adoc[] === _rest-env.sh_ Set server environment variables in this file. Examples include options to pass the JVM on start of the server such as heap size and garbarge collector configs. You can also set configurations for server configuration, log directories, -niceness, ssh options, where to locate process pid files, etc. Open the file at _conf/rest-env.sh_ and peruse its content. +niceness, ssh options, where to locate process pid files, etc. Open the file at _$REST_INSTALL_DIR/conf/rest-env.sh_ and peruse its content. Each option is fairly well documented. Add your own environment variables here if you want them read by the server on startup. Changes here will require a restart for the server to notice the change. @@ -121,7 +121,7 @@ Changes here will require a restart for the server to notice the change. [[rest.keystore]] === _rest-keystore_ -This file will only be present if the property _rest.https.password_ has been set in _conf/rest-site.xml_. +This file will only be present if the property _rest.https.password_ has been set in _$REST_INSTALL_DIR/conf/rest-site.xml_. Please see <> for more detail. [[important.configurations]] @@ -133,7 +133,7 @@ The default value is 4200. This is the port the embedded Jetty server binds to waiting for client HTTP connections. The value may need to be changed if this port number conflicts with other ports in use on your cluster. -To change this configuration, edit _conf/rest-site.xml_, copy the changed file around the cluster and restart. +To change this configuration, edit _$REST_INSTALL_DIR/conf/rest-site.xml_, copy the changed file around the cluster and restart. === `rest.https.port` The default value is 4201. This is the port the embedded Jetty server binds to @@ -141,13 +141,13 @@ waiting for client HTTPS connections. The value may need to be changed if this port number conflicts with other ports in use on your cluster. === `rest.ssl.password` -This property is not present by default in _conf/rest-site.xml_. Typically the Trafodion +This property is not present by default in _$REST_INSTALL_DIR/conf/rest-site.xml_. Typically the Trafodion installer sets this property to an obfuscated password string. If this property is present then the server will setup HTTPS in the embedded Jetty server. To create an obfuscated password for this property use the following command: ---- -java -classpath $REST_HOME/lib/jetty-9.2.10.v20150310.jar:$REST_HOME/lib/jetty-util-9.2.10.v20150310.jar org.eclipse.jetty.util.security.Password} +java -classpath $REST_INSTALL_DIR/lib/jetty-9.2.10.v20150310.jar:$REST_INSTALL_DIR/lib/jetty-util-9.2.10.v20150310.jar org.eclipse.jetty.util.security.Password} ---- The output of this command is similar to: @@ -157,16 +157,16 @@ MD5:{obfuscated password string} ---- Copy/paste the entire string including "OBF:" into this property. -The server will use this property when creating the _/conf/rest-keystore_ directory. +The server will use this property when creating the _$REST_INSTALL_DIR/conf/rest-keystore_ directory. -To change this configuration, edit _conf/rest-site.xml_, copy the changed file around the cluster and restart. +To change this configuration, edit _$REST_INSTALL_DIR/conf/rest-site.xml_, copy the changed file around the cluster and restart. [TIP] ==== To decrypt the obfuscated string in `rest.ssl.password` do the following: ---- -java -classpath $REST_HOME/lib/jetty-9.2.10.v20150310.jar:$REST_HOME/lib/jetty-util-9.2.10.v20150310.jar org.eclipse.jetty.util.security.Password {obfuscated password string} +java -classpath $REST_INSTALL_DIR/lib/jetty-9.2.10.v20150310.jar:$REST_INSTALL_DIR/lib/jetty-util-9.2.10.v20150310.jar org.eclipse.jetty.util.security.Password {obfuscated password string} ---- The output of this command is similar to: @@ -179,7 +179,7 @@ CRYPT:{obfuscated password string} ==== === `dcs.master.port` -The default value is 37800. This is the port the embedded JDBC Type 4 driver +The default value is 23400. This is the port the embedded JDBC Type 4 driver uses to connect to Trafodion DCS. -To change this configuration, edit _conf/rest-site.xml_, copy the changed file around the cluster and restart. +To change this configuration, edit _$REST_INSTALL_DIR/conf/rest-site.xml_, copy the changed file around the cluster and restart. diff --git a/core/rest/src/main/asciidoc/_chapters/troubleshooting.adoc b/core/rest/src/main/asciidoc/_chapters/troubleshooting.adoc index da0882158d..edc2182850 100644 --- a/core/rest/src/main/asciidoc/_chapters/troubleshooting.adoc +++ b/core/rest/src/main/asciidoc/_chapters/troubleshooting.adoc @@ -34,8 +34,8 @@ == Logs The key process logs are as follows...(replace with the user that started the service, for the server instance and for the machine name) -* $REST_HOME/logs/rest---rest-.log -* $REST_HOME/logs/rest---rest-.out +* $REST_INSTALL_DIR/logs/rest---rest-.log +* $REST_INSTALL_DIR/logs/rest---rest-.out The logs are your best resource when troubleshooting the REST server. @@ -70,4 +70,4 @@ The commands (and arguments) are: addauth scheme auth delete path [version] setquota -n|-b val path ----- \ No newline at end of file +---- diff --git a/core/rest/src/main/java/org/trafodion/rest/Constants.java b/core/rest/src/main/java/org/trafodion/rest/Constants.java index 52b210eb75..08fa1d7a33 100644 --- a/core/rest/src/main/java/org/trafodion/rest/Constants.java +++ b/core/rest/src/main/java/org/trafodion/rest/Constants.java @@ -48,7 +48,7 @@ public final class Constants { public static final String DCS_MASTER_PORT = "dcs.master.port"; /** Default value for DCS master port */ - public static final int DEFAULT_DCS_MASTER_PORT = 37800; + public static final int DEFAULT_DCS_MASTER_PORT = 23400; /** Name of ZooKeeper quorum configuration parameter. */ public static final String ZOOKEEPER_QUORUM = "rest.zookeeper.quorum"; diff --git a/dcs/src/main/asciidoc/_chapters/troubleshooting.adoc b/dcs/src/main/asciidoc/_chapters/troubleshooting.adoc index 9f948530a2..814e74bd06 100644 --- a/dcs/src/main/asciidoc/_chapters/troubleshooting.adoc +++ b/dcs/src/main/asciidoc/_chapters/troubleshooting.adoc @@ -159,7 +159,7 @@ On Linux cluster, if you run into issues please check dcs log files located in $ Validate that the interace is set up correctly. This command should only show one additional interface for HA configuration ---- -pdsh $MY_NODES "/sbin/ip addr show |grep 23400" +pdsh $MY_NODES "sudo /sbin/ip addr show |grep 23400" ---- Validate to get the list of all the DcsMaster that are configured and started in the cluster