Usergrid is failed to start. usergrid.cluster_name property must be set - usergrid

I am trying to setup Usergrid 2.1.0. I downloaded binaries and trying to setup with tomcat, cassandra and elasticsearch. I am following this. i created 'usergrid-default.properties' and saved in my 'tomcat_home/lib' folder. when i going to start the server, it is throwing the exception
1) Error injecting constructor, java.lang.IllegalArgumentException: usergrid.cluster_name property must be set.
at org.apache.usergrid.persistence.core.guice.SettingsValidationCluster.<init>(SettingsValidationCluster.java:17)
at org.apache.usergrid.persistence.core.guice.CommonModule.configure(CommonModule.java:98) (via modules: org.apache.usergrid.corepersistence.CoreModule -> org.apache.usergrid.persistence.core.guice.CommonModule)
while locating org.apache.usergrid.persistence.core.guice.SettingsValidationCluster
i have added a property 'usergrid.cluster_name' but it is still not working. can some one help me?

Resolve this issue. as i had properties file 'usergrid-default'. It should be 'usergrid-deployment'. I renamed and things are working.

Related

Is it required to set `packageVersion` of PackageIdentifier instance for DataFlowTemplate.streamOperations().updateStream(..) method?

I am instantiating PackageIdentifier class to pass it to DataFlowTemplate.streamOperations().updateStream(..) method, I set properties repositoryName and packageName, but I want to know if packageVersion is required property? Because I can see that it works without it.
It is just, I had an exception, but not able to reproduce it again, and was wondering if packageVersion is the cause of this problem?:
Caused by: org.springframework.cloud.dataflow.rest.client.DataFlowClientException: Can not find package 'input-to-event-message-channel', version 'null'
at org.springframework.cloud.dataflow.rest.client.VndErrorResponseErrorHandler.handleError(VndErrorResponseErrorHandler.java:65) ~[spring-cloud-dataflow-rest-client-2.0.2.RELEASE.jar:2.0.2.RELEASE]
The packageVersion is not required as far as there is a package with the desired name (in this case the "stream name") that exists in Skipper database.
See: Stream.java#L112-L114.
As for the error, it could be that you were using H2 instead of a persistent database for Skipper, and upon a restart, perhaps your client/test continued to attempt an upgrade on the transient database that doesn't have any footprint anymore.

Grails 3 (GORM) datasource properties not loading from Spring Cloud Config Server

I am trying to use Spring Cloud Config Server to externalize my Grails 3 (personnel) application configuration, but I cannot seem to set the dataSource properties.
Currently, I can load other properties (sample.message) into my Grails 3 (personnel) application and retrieve them using grailsApplication.config.sample.message without an issue. And hitting the REST endpoint on the Config Server (localhost:8888/personnel/master) is showing the configuration information I want, so I'm a bit confused.
I have tried each of the following in my personnel.properties file in my Git repo:
datasource.user=example
datasource.password=example
grails.datasource.user=example
grails.datasource.password=example
spring.datasource.user=example
spring.datasource.password=example
But none of them work. I continue to see error messages saying sa#localhost (using password: no) suggesting that the datasource properties, in particular, are not working.
I know it is possible with spring-boot-starter-data-jpa, so I'm wondering:
Is it possible with GORM?
If so, do I need to manually create the datasource bean?
What property names do I use datasource.user, grails.datasource.user, spring.datasource.user, etc?
After Shashank's edit, I realized that it was an issue with my property settings. datasource should have been dataSource and user should be username. Once those corrections were made, the application (personnel) worked perfectly. So,
Yes it is possible.
No, you don't need to create the bean manually
Property names are:
personnel.properties
dataSource.username=example
dataSource.password=example
dataSource.url=jdbc:mysql://localhost:3306/personnel

Grails Elasticsearch plugin creates index on startup? How do I stop it?

I need to put a new ES index in place to switch over to at some point in the future. I've been using aliases to do this, by having my app reference an alias, and using the HTTP API to point the alias at either the existing or new index as needed. Unfortunately, when the app gets re-started it complains that the index already exists as an alias. See stacktrace:
org.elasticsearch.indices.InvalidIndexNameException: [redacted] Invalid index name [redacted], already exists as alias
at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:174)
at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate(MetaDataCreateIndexService.java:510)
at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$100(MetaDataCreateIndexService.java:86)
at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:209)
at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:328)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
Anyone got any idea why this is happening and how I can prevent it?
This appears to have been fixed, coincidentally, by the release of v0.0.4.0 the plugin today
https://noamt.github.io/elasticsearch-grails-plugin/guide/single.html#history

Error executing script CreateAuthDomains: null\scripts\Init.groovy (The system cannot find the path specified)

I am trying to build an app that makes use of the acegi and multitenant-plugin in grails. I am following the instructions from this tutorial:
http://ridingthetiger.wikia.com/wiki/Creating_a_Secure,_Multi-Tenant_Web_App_with_Grails
however when I get to this instruction:
grails create-auth-domains org.racetrack.User org.racetrack.Role Requestmap
I get this error:
Running script C:\Users\roise\.grails\1.3.7\projects\racetrack\plugins\acegi-0.5.2\scripts\CreateAuthDomains.groovy
Error executing script CreateAuthDomains: null\scripts\Init.groovy (The system cannot find the path specified)
java.io.FileNotFoundException: null\scripts\Init.groovy (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at gant.Gant$_closure1.doCall(Gant.groovy:128)
at gant.Gant$_closure1.call(Gant.groovy)
at _SecurityTargets_groovy.run(_SecurityTargets_groovy:25)
at _SecurityTargets_groovy$run.call(Unknown Source)
at CreateAuthDomains.run(CreateAuthDomains:23)
at CreateAuthDomains$run.call(Unknown Source)
at gant.Gant.prepareTargets(Gant.groovy:606)
Error executing script CreateAuthDomains: null\scripts\Init.groovy (The system cannot find the path specified)
I have tried to follow the tutorial to the last comma. The only thing that is different is that i am developing in STS and I cannot run the create-app command from the command line, I actually have to create a new app from the New menu. The other three commands I have got up to so far - I have entered and executed exactly as shown.
The problem here is that "GRAILS_HOME" environment variable is not set.
From the Grails documentation:
On Windows this is typically a matter of setting an environment variable under My Computer/Advanced/Environment Variables
I believe that #arcdegree is right that the problem is because a script cannot figure out what GRAILS_HOME is but in my case that environment variable was set correctly and I was still experiencing the problem.
What I found to fix my problem and I believe will fix your problem is that the command you are trying to run (create-auth-domains ) is accessing a script (CreateAuthDomains.groovy) within the acegi plugin that needs updating. Now, this question is quite old with no accepted answers so I'm not sure if you are still experiencing this problem but I do think this answer will help anyone else looking into a similar problem. Mine stems from trying to use an old plugin for jsecurity that has been replaced with a newer plugin but I was intent on using the same thing a document I was referring to had used.
Your script in this case, CreateAuthDomains, probably uses an old reference to grailsHome and includeTargets that should be replaced with a single line that calls grailsScript("Init") instead. So, comment out these lines:
grailsHome = Ant.project.properties."environment.GRAILS_HOME"
includeTargets << new File ("${grailsHome}/scripts/Init.groovy")
then add this one line
includeTargets << grailsScript("Init")
Save the file and try your command again.

How do I fix 'Setup project with custom action file not found' exception?

I am trying to create a setup project for a Windows Service. I've followed the directions at http://support.microsoft.com/kb/816169 to create the setup project with no trouble.
I want to be able to get a value during the installation in order to update the app.config with the user's desired settings. I added a Textboxes (A) dialog to retrieve the values. I set the Edit1Property property to "TIMETORUN", and in my Primary Output action's CustomActionData property I put in the following: /TimeToRun="[TIMETORUN]\". So far so good. Running the setup I can retrieve the TimeToRun value from the Context.Parameters collection without issue.
In order to locate the app.config I need to also pass in the value of the TARGETDIR Windows Installer Property to my custom action. This is where things begin to fall apart. In order to achieve this, the above CustomActionData must be altered like so: /TimeToRun="[TIMETORUN]\" /TargetDir="[TARGETDIR]\". Now when I run the setup I get the following error message:
Error 1001. Exception occurred while initializing the installation.
System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\SysWOW64\Files' or one of its dependencies. The system cannot
find the file specified.
If you google this problem you will inevitably find people having tremendous success by simply adding the trailing slash to the /TargetDir="[TARGETDIR]\" portion of the CustomActionData. This unfortunately does not solve my issue.
I tried so many different variations of the CustomActionData string and none of them worked. I tried logging to a file from my overridden Install method to determine where the breakage was, but no log file is created because it's not even getting that far. As the error indicates, the failure is during the Initialization step.
I have a hunch that it could be one of the dependencies that the setup project is trying to load. Perhaps somehow something is being appended to the CustomActionData string and isn't playing well with the TARGETDIR value (which contains spaces, i.e. "C:\Program Files\My Company\Project Name"). Again, this is another hunch that I cannot seem to confirm due to my inability to debug the setup process.
One further thing to mention, and yes it's another hunch, could this be an issue with Setup Projects on 64-bit version of Windows? I'm running Windows 7 Professional.
I'll provide names of the dependencies in case it helps:
Microsoft .NET Framework
Microsoft.SqlServer.DtsMsg.dll
Microsoft.SqlServer.DTSPipelineWrap.dll
Microsoft.SqlServer.DTSRuntimeWrap.dll
Microsoft.SQLServer.ManagedDTS.dll
Microsoft.SqlServer.msxml6_interop.dll
Microsoft.SqlServer.PipelineHost.dll
Microsoft.SqlServer.SqlTDiagM.dll
As you may glean from the dependencies, the Windows Service is scheduling a call to a DTSX package.
Sorry for the long rant. Thanks for any help you can provide.
The answer is so maddeningly simple. If the last argument in the CustomActionData is going to contain spaces and thus you have to surround it with quotes and a trailing slash, you must also have a space following the trailing slash, like this:
/TimeToRun="[TIMETORUN]\" /TargetDir="[TARGETDIR]\ "
The solution and explanation can be found here.
Had a similar issue. In my case, it was odd because my installer had ran successfully once, then I uninstalled my app via Add/Remove Programs successfully, did some coding (did NOT touch my CustomActionData string), and rebuilt my project and setup project. It was when I re-ran my MSI that I got this error.
The coding I had done was to bring in more values of more parameters I had been specifying in my CustomActionData string. That syntax for getting the parameter values (i.e. string filepath = Context.Paramenters["filepath"]), which was in my Installer class, was actually fine, but as I found out, the syntax of the later parameters I was now trying to get from my CustomActionData string had not been correct, from the very beginning. I had failed to add a second quote around one of those parameters, so nothing else could be obtained.
I was using the "Textboxes (A)" and "Textboxes (B)" windows in the User Interface section. A has 1 box, EDITA1, where I get the path to a file, and B has 2 boxes, EDITB1 and EDITB2, for some database parameters. My CustomActionData string looked like this:
/filepath="[EDITA1]" /host="[EDITB1] /port="[EDITB2]"
It should have been:
/filepath="[EDITA1]" /host="[EDITB1]" /port="[EDITB2]"
(closing quote on [EDITB1])

Resources