WSO2 AM and WSO2 BAM configuration issues on Windows - wso2

I am on Windows are trying to configure WSO2 BAM Dashboard to see API statics.
I am using WSO2 API Manager 1.5.0 (latest) for some time and it works well on port 9443.
Also I am able to start BAM 2.4.0 (latest) server.
But as soon as I go to my WSO2 AM Publisher interface and try to see All Statistics it says
- Refer our wiki to configure BAM correctly
This is what I see in my BAM logs -
INFO {org.wso2.carbon.analytics.hive.task.HiveScriptExecutorTask} - Running script executor task for script am_stats_analyzer_253.
{org.wso2.carbon.analytics.hive.task.HiveScriptExecutorTask}
TID: [0] [BAM] ERROR {org.apache.hadoop.hive.ql.exec.ExecDriver} - Exception: Cannot run program "C:\Program" (in directory "C:\wso2bam-2.4.0"): CreateProcess error=2, The system cannot find the file specified {org.apache.hadoop.hive.ql.exec.ExecDriver}
TID: [0] [BAM] ERROR {org.apache.hadoop.hive.ql.Driver} - FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MapRedTask {org.apache.hadoop.hive.ql.Driver}
TID: [0] [BAM] ERROR {org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl} - Error while executing Hive script.
Query returned non-zero code: 9, cause: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MapRedTask {org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl}
java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MapRedTask
I am not able to execute the Hive script on windows.
I have installed cygwin also - not sure what is going wrong.
I have followed all the documentation.

This could be due the BAM cannot execute cywin commands. Please try to install Cywin into C drive and make sure no space in file path and add "C:\cygwin64\bin" to the windows PATH, also make sure BAM running user has rights to run cygwin commands ( in default nothing to do in windows, unless you may set some special permission ).

Please makes sure you have appended value "C:\cygwin\bin" correctly to PATH variable "Environment variable configuration" section in Windows.
Reason for this scenario could be due to windows command line is looking for cygwin in a different path.

Related

How to change the default ports of WSO2 3.2.0 APIM?

I'm using WSO2 3.2.0 APIM on Windows platform and have a need to change the default HTTP/HTTPS ports from 9443/9763 to 9080/9090. This means that the offset won't work for me. I did some searching here and got some hits. However, some answers are quite old and some answers don't seem to work with 3.2.0.
The most promising answer is to update the connectors in <API-M_HOME>/repository/conf/tomcat/catalina-server.xml. I tried it, but it didn't work. When I started up WSO2, the bootstrap showed messages on the console that it detected the configuration changes and the ports got reverted back to the default ones.
The messages on the console look like this
C:\Programs\wso2am-3.2.0\bin>wso2server.bat --run
JAVA_HOME environment variable is set to C:\Java\openjdk-1.8.0.191-1.b12.redhat
CARBON_HOME environment variable is set to C:\Programs\WSO2AM~1.0\bin\..
[2021-04-26 22:22:18,514] WARN {org.wso2.config.mapper.ConfigParser} - Configurations Changed in :repository\conf\tomcat\catalina-server.xml
[2021-04-26 22:22:18,514] WARN {org.wso2.config.mapper.ConfigParser} - Overriding files in configuration directory C:\Programs\WSO2AM~1.0\bin\..
[2021-04-26 22:22:19,802] INFO {org.wso2.config.mapper.ConfigParser} - Writing Metadata Entries...
andes [org.wso2.andes.wso2.internal.QpidBundleActivator] INFO : Setting BundleContext in PluginManager
callhome [org.wso2.carbon.callhome.internal.CallHomeActivator] DEBUG : Activating CallHome agent
[2021-04-26 22:22:29,530] INFO - CarbonCoreActivator Starting WSO2 Carbon...
...
Any thoughts or ideas?
From API Manager v3.0 onwards, you only need to change the deployment.toml file which resides in the wso2am-3.2.0/repository/conf location. You can't change any xml files that reside in the conf directory. To change the ports, you can add the following config in the deployment.toml
[transport.https.properties]
port = 9080
[transport.http.properties]
port = 9090
The port offset will append to these base values.

WSO2 APIM 3.0.0 REFUSED TO START AFTER EDITING master-datasources.xml file

I installed wso2am-3.0.0 as a service on linux machine and i changed the default database to mysql by editing the master-datasources.xml file. However, when i start the service by running sudo service wso2am-3.0.0 start, I got stucked here as shown below:
TID: [2020-02-19 00:16:22,738] INFO {org.wso2.config.mapper.ConfigParser} - Applying Configurations upon new Templates {org.wso2.config.mapper.ConfigParser}
TID: [2020-02-19 00:16:22,739] WARN {org.wso2.config.mapper.ConfigParser} - Configurations Changed in :repository/conf/datasources/master-datasources.xml {org.wso2.config.mapper.ConfigParser}
TID: [2020-02-19 00:16:22,739] WARN {org.wso2.config.mapper.ConfigParser} - Configurations Changed in :repository/conf/carbon.xml {org.wso2.config.mapper.ConfigParser}
TID: [2020-02-19 00:16:22,739] WARN {org.wso2.config.mapper.ConfigParser} - Overriding files in configuration directory /usr/lib/wso2/wso2am/3.0.0 {org.wso2.config.mapper.ConfigParser}
And nothing else happens
From API Manager v3.0.0, we have introduced a new configuration model where now you have a deployment.toml to configure. You don't need to touch any xml config files. deployment.toml can be found in repository/conf location. Although you change the configs in xml files, those will be overridden when server starts up.
Please refer how you can change databases to mysql - https://apim.docs.wso2.com/en/3.0.0/InstallAndSetup/SettingUpDatabases/ChangingDefaultDatabases/changing-to-mysql/

SBT buid error:[error] Server access Error: Received fatal alert: access_denied

I have been getting server access denied error.Unable to find the fix.Investigated through web.But none of them worked well.I am using windows7.
C:\Users\thathine>sbt
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; sup
port was removed in 8.0
[info] Loading project definition from C:\Users\thathine\project
[info] Updating {file:/C:/Users/thathine/project/}thathine-build...
[info] Resolving org.scala-lang#scala-library;2.11.8 ...
[error] Server access Error: Received fatal alert: access_denied url=https://rep
o.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-library/2.11.8/ivys/iv
y.xml
[error] Server access Error: Received fatal alert: access_denied url=https://rep
o.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-lang/scala-library/2.11.8
/ivys/ivy.xml
my buld.sbtis as follows:
name := "spark_codebase"
version := "1.0"
scalaVersion := "2.11.8"
I am in need to fix this as soon as possible. Please suggest any solution.Thanks in advance.
Please find the versions of scala, java, sbt:
C:\Users\thathine>javac -version
javac 1.8.0_131
C:\Users\thathine>scala -version
Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL
and sbt version is sbt-0.13.15.
After some struggle, found that this issue is because of our company network used some proxy to give restricted access to employees like a firewall. As i was behind a proxy, Maven would fail to download any dependencies.
I got the proxy setings from my companie's IT helpdesk. After using them, It worked finally.I am using windows 7.use the following command line options before using sbt for that session,by replacing [your-ProxyServer] and <port-number> with your actual proxy server and port details.
set JAVA_OPTS=-Dhttp.proxySet=true -Dhttp.proxyHost=[your-ProxyServer] -Dhttp.proxyPort=<port-number> -Dhttps.proxyHost=[your-ProxyServer] -Dhttps.proxyPort=<port-number> -Dftp.proxyHost=[your-ProxyServer] -Dftp.proxyPort=<port-number>
If you are using IDE like IntelliJ or Eclipse:
use the same options under -VM parameters while creating/importing the project.

Web deploy issue with sitecore media files

I am using File system for media and trying to get Web Deploy to work between CM and CD but running into issue when I try to publish media item.
My WebDeploy.config looks like this:
<targetDatabase>web</targetDatabase>
<targetServer>cd-site</targetServer>
<userName>Administrator</userName>
<password>pwd</password>
<localRoot>C:\inetpub\wwwroot\CM\Website</localRoot>
<remoteRoot>C:\inetpub\wwwroot\CD\Website</remoteRoot>
<items hint="list:AddPath">
<media>App_Data/MediaFiles</media>
</items>
I cant seem to get pass this error in sitecore after publish, any ideas?:
5652 02:01:11 INFO Job started: Publish to 'web'
ManagedPoolThread #13 02:01:11 INFO MSDEPLOY: Performing synchronization for App_Data/MediaFiles
ManagedPoolThread #13 02:01:11 ERROR MSDEPLOY: Failed to synchronize folder App_Data/MediaFiles. Please verify that the folder exists and is accessible.
Exception: Microsoft.Web.Deployment.DeploymentAgentUnavailableException: Remote agent (URL http://cd-site/MSDEPLOYAGENTSERVICE) could not be contacted. Make sure the remote agent service is installed and started on the target computer. ---> Microsoft.Web.Deployment.DeploymentException: An unsupported response was received. The response header 'MSDeploy.Response' was '' but 'v1' was expected. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponse(HttpWebRequest request)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at Microsoft.Web.Deployment.AgentClientProvider.GetHttpResponse(HttpWebRequest request)
at Microsoft.Web.Deployment.AgentClientProvider.CreateStatusThread(DeploymentSyncContext syncContext)
at Microsoft.Web.Deployment.AgentClientProvider.RemoteDestSync(DeploymentObject sourceObject, DeploymentSyncContext syncContext)
at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable)
at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)
at Sitecore.Publishing.WebDeploy.DeploymentTaskRunner.Execute()
I fixed this by installing Web Deploy from WebPI. For some reason when I only installed Web Deploy 3.6 independently the services were not registered properly. After installing via WebPI the publishing job instantly started working.

Spark cluster fails after running and no exception thrown

I'm trying to run a stand-alone Spark application on EC2 Yarn command line. I'm submitting the following spark-submit script:
./bin/spark-submit --class PageRankGraphX --master yarn-cluster --properties-file spark-defaults.conf.2 --executor-memory 2G --total-executor-cores 5 ./SparkPageRank-assembly-1.0.jar s3://linkfilefull/full/links_small.txt s3://conansoutputbucket/smalloutput.txt 10 0.15 2
This is the output - there is no exception or error thrown, the job simply fails after running:
15/04/15 21:27:03 INFO yarn.Client: Application report from ASM:
application identifier: application_1429126831428_0027
appId: 27
clientToAMToken: null
appDiagnostics:
appMasterHost: ip-172-31-1-67.eu-west-1.compute.internal
appQueue: default
appMasterRpcPort: 0
appStartTime: 1429133214320
yarnAppState: RUNNING
distributedFinalState: UNDEFINED
appTrackingUrl: http://172.31.10.227:9046/proxy/application_1429126831428_0027/
appUser: hadoop
15/04/15 21:27:04 INFO yarn.Client: Application report from ASM:
application identifier: application_1429126831428_0027
appId: 27
clientToAMToken: null
appDiagnostics:
appMasterHost: ip-172-31-1-67.eu-west-1.compute.internal
appQueue: default
appMasterRpcPort: 0
appStartTime: 1429133214320
yarnAppState: FINISHED
distributedFinalState: FAILED
appTrackingUrl: http://172.31.10.227:9046/proxy/application_1429126831428_0027/A
appUser: hadoop
Does anyone know what could be causing this or how I could investigate? When I try to access the yarn logs, it says logs are disabled or not ready.
Check out Amazon's documentation on enabling access to the web UI of Hadoop. Once in the UI, you can check the stderr output for the application, where the exception will most likely be. As others mentioned, this log will also be available on S3.