I have setup usergrid following this guide.
Steps I have done include:
1. Setup Cassandra (nodetool status
shows me one healty node and I can log in with cqlsh
).
2. Setup ElasticSearch (curl localhost:9200
gives me a nice .json back, everything ok.)
3. Built the usergrid app with mvn clean install
and moved the built ROOT.war
to CATALINA_BASE
4. Created usergrid-deployment.properties
to CATALINA_HOME
at /usr/share/tomcat7
When I start tomcat7 service everything goes ok, no errors in catalina logs. Last line is "Server Startup".
In catalina.out
log I have the line:
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu) Mar 08, 2016 9:33:25 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/ROOT.war
Mar 08, 2016 10:02:50 AM org.apache.catalina.util.SessionIdGenerator createSecureRandom INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [5$
Mar 08, 2016 10:02:50 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"] Mar 08, 2016 10:02:50 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5561 ms
So the usergrid app should be running.
I can browse to localhost:8080
and see the Tomcat7"It works" - page.
However, when I try to setup the usergrid database like this:
curl -X PUT http://localhost:8080/system/database/setup -u [user]:[password]
I get a 403 error:
Access to the specified resource has been forbidden.
I am sure that my credentials match those that I have defined in usergrid-deployment.properties
in CATALINA_HOME
as usergrid sysadmin.login
credentials.
In tomcat7 localhost_access_log
I have the following output:
0:0:0:0:0:0:0:1 - - [08/Mar/2016:12:27:43 +0200] "PUT /system/database/setup HTTP/1.1" 403 979
However (number2), when I try curl -v localhost:8080/status
to see the status of the usergrid app, I get
404 - requested resource is not available
So, any help as to what I might do to: a) be sure that the usergrid app is deployed correctly with tomcat (as there are no errors in logs b) to solve the 403 issue?
Thank you for any help!
EDIT:
I noticed that my CATALINA_BASE
(/var/lib/tomcat/
) didn't have the WEB_INF
directory inside webapps
at all. In the guide I made reference to, we are only instructed to copy the ROOT.war
file to webapps
directory. Is this correct? Should I also copy the WEB-INF files from the usergrid stack?
Here is what the guide says:
The next step is to deploy the Usergrid Stack software to Tomcat. There are a variey of ways of doing this and the simplest is probably to place the Usergrid Stack ROOT.war file into the Tomcat webapps directory, then restart Tomcat.
I tried copying the WEB-INF
files to CATALINA_BASE
but that resulted in multiple errors and tomcat7 was unable to start:
This:
21:25:49,923 WARN Slf4jConnectionPoolMonitorImpl:31 - BadRequestException: [host=localhost(127.0.0.1):9160, latency=16(38), attempts=1]InvalidRequestException(why:You have not logged in)
And:
INFO transport:93 - [node-1] bound_address {inet[0.0.0.0/0.0.0.0:9301]}, publish_address {inet[/XX.XXX.XXX.XXX:9301]} 21:25:51,892 INFO discovery:85 - [node-1] elasticsearch/RIaKYgv1R-yTKJ_aknZOuw 21:25:51,905 WARN netty:620 - [node-1] exception caught on transport layer [[id: 0xc1bc7fca]], closing connection java.net.UnknownHostException: localhost:9200
EDIT 2: I was adviced that only Elasticsearch v 1.4.4 works (I tried with 2.2.0) and for Cassandra 1.2.x and 2.1.x versions (I tried with 3.0.3). I havent yet tried with these versions, I'll update this question if I get it to work.