You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@usergrid.apache.org by Martin Harris <ma...@cloudsoftcorp.com> on 2014/04/30 12:13:18 UTC

Usergrid properties file

Hi Folks,

I'm having a little trouble getting usergrid to pick up the properties
file. If I build the .war from the latest code on github then it only gets
picked up if I copy it to lib/usergrid-custom.properties[1] (but not to
lib/usergrid.properties or lib/usergrid-deployment.properties). If I
download the war from maven (as suggested by Ed), then it doesn't seem to
get picked up from lib/usergrid.properties, lib/usergrid-custom.properties
or lib/usergrid-deployment.properties

I'm assuming that the problem is that the properties file isn't being
picked up, the actual problem is as follows:

   - Building the .war from github and using
   lib/usergrid-custom.properties, everthing works fine on both localhost and
   a pair of cloud hosts
   - Using the same deployment mechanism[2], and .war, if I deploy to the
   cloud with the properties file in lib/usergrid-custom.properties the status
   shows as cassandraAvailable: false, however if I deploy locally
   cassandraAvailable is true, but the login and password in the properties
   file don't work. I'm assuming the cassandra URL defaults to localhost:9160
   if no properties file is loaded?
   - If I use the .war from maven, cassandraAvailable is false on both
   localhost and the cloud, and with the properties file in both -custom and
   -deployment

I hope this makes sense... any help would be appreciated

Cheers

[1]:
https://github.com/usergrid/usergrid/blob/master/stack/config/README.txt
[2]: https://github.com/cloudsoft/brooklyn-usergrid (WIP!)

-- 
Martin Harris
Lead Software Engineer
Cloudsoft Corporation Ltd
www.cloudsoftcorp.com

Re: Usergrid properties file

Posted by Martin Harris <ma...@cloudsoftcorp.com>.
Hi Ed,

Thanks for your feedback. Sorry for the late reply, I was caught up with
another issue yesterday. When 'deploying to cloud', the processes I was
following was as follows:

*Manually:*

   - Checkout and build latest code from github[1]

*Using brooklyn[2]:*

   - Provision 2 Ubuntu machines on Softlayer
   - One the first machine, download install and launch Cassandra
   - On the second machine, download and install (but not launch) tomcat
   - Copy over the properties file (based on [3]) to the tomcat's lib
   folder, replacing the cassandra URL with the appropriate URL for the
   cassandra machine, and the localhost URLs with the URL of the tomcat server
   - Copy the stack/rest/target/ROOT.war from step 1 to ROOT.war on the
   tomcat server
   - Start tomcat

The issues that I was having was that if the properties file is named
usergrid-deployment.properties as suggested in [2], it doesn't seem to get
picked up, if the properties file is named usergrid-custom.properties, then
it is picked up. However, if I use the .war file from maven as you
suggested in an earlier email, then the properties file isn't picked up no
matter what it's named

For an automated deployment, as you said, it's not desirable for a build to
be a necessary step in the process, so it would be nice to be able to
download the .war from somewhere such as maven

Cheers


[1]: https://github.com/usergrid/usergrid
[2]: https://github.com/cloudsoft/brooklyn-usergrid
[3]: https://usergrid.incubator.apache.org/docs/deploy-local/


On 30 April 2014 16:51, Ed Anuff <ed...@anuff.com> wrote:

> When you say "deploy to cloud", what do you mean?  The properties file
> is loaded by Spring from the local environment or the classpath and
> for deployments to a Tomcat, the custom properties are typically
> bundled into the WAR file.  Since you're taking the approach of
> building a WAR and deploying it to a Tomcat, your options would be to
> include the custom properties into the WAR build or to somehow place
> the properties into Tomcat (not sure how that's done).  For the
> latter, the Spring config might need to be changed to reflect where
> those properties are to be found.  Since it seems not to be desirable
> for a build to be a necessary step in a deploy, I'd love to see a way
> that the properties can be loaded from another location. Ideally Todd
> or someone else familiar with the current property loading can chime
> in.
>
> Ed
>
> > On Apr 30, 2014, at 3:13 AM, Martin Harris <
> martin.harris@cloudsoftcorp.com> wrote:
> >
> > Hi Folks,
> >
> > I'm having a little trouble getting usergrid to pick up the properties
> > file. If I build the .war from the latest code on github then it only
> gets
> > picked up if I copy it to lib/usergrid-custom.properties[1] (but not to
> > lib/usergrid.properties or lib/usergrid-deployment.properties). If I
> > download the war from maven (as suggested by Ed), then it doesn't seem to
> > get picked up from lib/usergrid.properties,
> lib/usergrid-custom.properties
> > or lib/usergrid-deployment.properties
> >
> > I'm assuming that the problem is that the properties file isn't being
> > picked up, the actual problem is as follows:
> >
> >   - Building the .war from github and using
> >   lib/usergrid-custom.properties, everthing works fine on both localhost
> and
> >   a pair of cloud hosts
> >   - Using the same deployment mechanism[2], and .war, if I deploy to the
> >   cloud with the properties file in lib/usergrid-custom.properties the
> status
> >   shows as cassandraAvailable: false, however if I deploy locally
> >   cassandraAvailable is true, but the login and password in the
> properties
> >   file don't work. I'm assuming the cassandra URL defaults to
> localhost:9160
> >   if no properties file is loaded?
> >   - If I use the .war from maven, cassandraAvailable is false on both
> >   localhost and the cloud, and with the properties file in both -custom
> and
> >   -deployment
> >
> > I hope this makes sense... any help would be appreciated
> >
> > Cheers
> >
> > [1]:
> > https://github.com/usergrid/usergrid/blob/master/stack/config/README.txt
> > [2]: https://github.com/cloudsoft/brooklyn-usergrid (WIP!)
> >
> > --
> > Martin Harris
> > Lead Software Engineer
> > Cloudsoft Corporation Ltd
> > www.cloudsoftcorp.com
>



-- 
Martin Harris
Lead Software Engineer
Cloudsoft Corporation Ltd
www.cloudsoftcorp.com
Mobile: +44 (0)7989 047-855

Re: Usergrid properties file

Posted by Ed Anuff <ed...@anuff.com>.
When you say "deploy to cloud", what do you mean?  The properties file
is loaded by Spring from the local environment or the classpath and
for deployments to a Tomcat, the custom properties are typically
bundled into the WAR file.  Since you're taking the approach of
building a WAR and deploying it to a Tomcat, your options would be to
include the custom properties into the WAR build or to somehow place
the properties into Tomcat (not sure how that's done).  For the
latter, the Spring config might need to be changed to reflect where
those properties are to be found.  Since it seems not to be desirable
for a build to be a necessary step in a deploy, I'd love to see a way
that the properties can be loaded from another location. Ideally Todd
or someone else familiar with the current property loading can chime
in.

Ed

> On Apr 30, 2014, at 3:13 AM, Martin Harris <ma...@cloudsoftcorp.com> wrote:
>
> Hi Folks,
>
> I'm having a little trouble getting usergrid to pick up the properties
> file. If I build the .war from the latest code on github then it only gets
> picked up if I copy it to lib/usergrid-custom.properties[1] (but not to
> lib/usergrid.properties or lib/usergrid-deployment.properties). If I
> download the war from maven (as suggested by Ed), then it doesn't seem to
> get picked up from lib/usergrid.properties, lib/usergrid-custom.properties
> or lib/usergrid-deployment.properties
>
> I'm assuming that the problem is that the properties file isn't being
> picked up, the actual problem is as follows:
>
>   - Building the .war from github and using
>   lib/usergrid-custom.properties, everthing works fine on both localhost and
>   a pair of cloud hosts
>   - Using the same deployment mechanism[2], and .war, if I deploy to the
>   cloud with the properties file in lib/usergrid-custom.properties the status
>   shows as cassandraAvailable: false, however if I deploy locally
>   cassandraAvailable is true, but the login and password in the properties
>   file don't work. I'm assuming the cassandra URL defaults to localhost:9160
>   if no properties file is loaded?
>   - If I use the .war from maven, cassandraAvailable is false on both
>   localhost and the cloud, and with the properties file in both -custom and
>   -deployment
>
> I hope this makes sense... any help would be appreciated
>
> Cheers
>
> [1]:
> https://github.com/usergrid/usergrid/blob/master/stack/config/README.txt
> [2]: https://github.com/cloudsoft/brooklyn-usergrid (WIP!)
>
> --
> Martin Harris
> Lead Software Engineer
> Cloudsoft Corporation Ltd
> www.cloudsoftcorp.com

Re: Usergrid properties file

Posted by Martin Harris <ma...@nakomis.com>.
Hi Malaka,

I've had a look at the link you sent, and the authentication details are
set up correctly in the properties file. I think the problem is that the
properties file isn't being picked up

Cheers

Martin


On Wed, Apr 30, 2014 at 4:31 PM, Malaka Mahanama <
malaka.open.source@gmail.com> wrote:

> Hi Martin,
>
> Since you see ' cassandraAvailable is false' maybe there is an
> authentication issue? Just check if
> https://issues.apache.org/jira/browse/USERGRID-126 relates to your issue.
> If so the suggested option at the end might help.
>
>
> Thanks and Regards,
> Malaka Mahanama
> Virtusa ~ Sri-Lanka
>
>
> On Wed, Apr 30, 2014 at 3:43 PM, Martin Harris <
> martin.harris@cloudsoftcorp.com> wrote:
>
> > Hi Folks,
> >
> > I'm having a little trouble getting usergrid to pick up the properties
> > file. If I build the .war from the latest code on github then it only
> gets
> > picked up if I copy it to lib/usergrid-custom.properties[1] (but not to
> > lib/usergrid.properties or lib/usergrid-deployment.properties). If I
> > download the war from maven (as suggested by Ed), then it doesn't seem to
> > get picked up from lib/usergrid.properties,
> lib/usergrid-custom.properties
> > or lib/usergrid-deployment.properties
> >
> > I'm assuming that the problem is that the properties file isn't being
> > picked up, the actual problem is as follows:
> >
> >    - Building the .war from github and using
> >    lib/usergrid-custom.properties, everthing works fine on both localhost
> > and
> >    a pair of cloud hosts
> >    - Using the same deployment mechanism[2], and .war, if I deploy to the
> >    cloud with the properties file in lib/usergrid-custom.properties the
> > status
> >    shows as cassandraAvailable: false, however if I deploy locally
> >    cassandraAvailable is true, but the login and password in the
> properties
> >    file don't work. I'm assuming the cassandra URL defaults to
> > localhost:9160
> >    if no properties file is loaded?
> >    - If I use the .war from maven, cassandraAvailable is false on both
> >    localhost and the cloud, and with the properties file in both -custom
> > and
> >    -deployment
> >
> > I hope this makes sense... any help would be appreciated
> >
> > Cheers
> >
> > [1]:
> > https://github.com/usergrid/usergrid/blob/master/stack/config/README.txt
> > [2]: https://github.com/cloudsoft/brooklyn-usergrid (WIP!)
> >
> > --
> > Martin Harris
> > Lead Software Engineer
> > Cloudsoft Corporation Ltd
> > www.cloudsoftcorp.com
> >
>



-- 
Martin Harris

Re: Usergrid properties file

Posted by Malaka Mahanama <ma...@gmail.com>.
Hi Martin,

Since you see ' cassandraAvailable is false' maybe there is an
authentication issue? Just check if
https://issues.apache.org/jira/browse/USERGRID-126 relates to your issue.
If so the suggested option at the end might help.


Thanks and Regards,
Malaka Mahanama
Virtusa ~ Sri-Lanka


On Wed, Apr 30, 2014 at 3:43 PM, Martin Harris <
martin.harris@cloudsoftcorp.com> wrote:

> Hi Folks,
>
> I'm having a little trouble getting usergrid to pick up the properties
> file. If I build the .war from the latest code on github then it only gets
> picked up if I copy it to lib/usergrid-custom.properties[1] (but not to
> lib/usergrid.properties or lib/usergrid-deployment.properties). If I
> download the war from maven (as suggested by Ed), then it doesn't seem to
> get picked up from lib/usergrid.properties, lib/usergrid-custom.properties
> or lib/usergrid-deployment.properties
>
> I'm assuming that the problem is that the properties file isn't being
> picked up, the actual problem is as follows:
>
>    - Building the .war from github and using
>    lib/usergrid-custom.properties, everthing works fine on both localhost
> and
>    a pair of cloud hosts
>    - Using the same deployment mechanism[2], and .war, if I deploy to the
>    cloud with the properties file in lib/usergrid-custom.properties the
> status
>    shows as cassandraAvailable: false, however if I deploy locally
>    cassandraAvailable is true, but the login and password in the properties
>    file don't work. I'm assuming the cassandra URL defaults to
> localhost:9160
>    if no properties file is loaded?
>    - If I use the .war from maven, cassandraAvailable is false on both
>    localhost and the cloud, and with the properties file in both -custom
> and
>    -deployment
>
> I hope this makes sense... any help would be appreciated
>
> Cheers
>
> [1]:
> https://github.com/usergrid/usergrid/blob/master/stack/config/README.txt
> [2]: https://github.com/cloudsoft/brooklyn-usergrid (WIP!)
>
> --
> Martin Harris
> Lead Software Engineer
> Cloudsoft Corporation Ltd
> www.cloudsoftcorp.com
>