Here is how to backup using REST:

http://docs.marklogic.com/REST/POST/manage/v2/databases/%5Bid-or-name%5D#BackupDB

I'm not sure about renaming a forest.

-Danny

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Thursday, October 08, 2015 3:01 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

I'm going through documentation and it doesn't seem like it's possible to 
simply rename forest.
There are tons of options (clear | merge | restart | attach | detach | retire | 
employ | delete) but no simple rename like I have this xquery:


xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin";
      at "/MarkLogic/admin.xqy";

let $config := admin:forest-rename(admin:get-configuration(), 
988693167592881111, "forest-name")
return admin:save-configuration($config)

Is that true that you can't rename forest using REST API?
It doesn't seem like that there's a corresponding REST API call to xquery 
function: forest-rename or maybe I'm missing something?
I thought that maybe this will just work and based on "PUT 
/manage/v2/forests/{id|name}/properties" I tried:

$ cat forest-name.xml
<forest-properties xmlns="http://marklogic.com/manage";>
 <name>blaaaaaaaaaa</name>
</forest-properties>

$ curl --anyauth --user user:password -X PUT -d @./forest-name.xml -i -H 
"Content-type: application/xml" 
http://127.0.0.1:8002/manage/v2/forests/forest-name/properties
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="public", qop="auth", 
nonce="16f0b33722bdc4ec775e5afca46da21d", opaque="16f244e1594b02d7"
Content-type: application/xml
Server: MarkLogic
Content-Length: 173
Connection: Keep-Alive
Keep-Alive: timeout=5

HTTP/1.1 400 Bad Request
Content-type: application/xml
Server: MarkLogic
Content-Length: 311
Connection: Keep-Alive
Keep-Alive: timeout=5

<error xmlns="http://marklogic.com/manage";>
  <status-code>400</status-code>
  <status>Bad Request</status>
  <message-code>MANAGE-INVALIDPAYLOAD</message-code>
  <message>MANAGE-INVALIDPAYLOAD: (err:FOER0000) Payload has errors in 
structure, content-type or values. Cannot validate payload.</message>
</error>

User/password is correct because this call works fine:

$ curl -s --anyauth --user user:password -X GET -H "Accept: application/xml" 
http://localhost:8002/manage/v2/forests/forest-name

I tried all 8** ports and localhost as well. I'm stumped.
It doesn't seem like there are API calls for issuing backups of databases. 
(Creating, deleting but not simply backup).
Is it possible to use our xqueries as input to REST API calls, for example?
   .... -d @xquery-file.file .... http://..../manage/xquery




Ernest Gulik

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Thursday, October 08, 2015 1:14 PM
To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

Nice,
This seems very promising.
I'll dig into that then.
I have to say that I'm surprised from the speed of responses here, really!
I really appreciate your support. This is awesome!
Thank you!


Ernest Gulik

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Danny Sokolsky
Sent: Thursday, October 08, 2015 1:01 PM
To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

If what you want to do is script admin tasks, I would recommend using the REST 
API:

http://docs.marklogic.com/REST/management

You can then call that from a shell script using curl or something similar, 
including all of your favorite scripting languages.  The REST api has all of 
the best practices built in.

-Danny

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Gulik, Ernest
Sent: Thursday, October 08, 2015 7:23 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

Thank you for all your responses.
Installation is straight from ML ec2 template, so nothing complicated.
I was trying to figure it out how to script db backups (and other maintenance 
tasks) using command line.
Scripted, because I have a little more control/monitoring in that way.
I have few xqueries that are working fine from qconsole but I want to do as 
less manual tasks as possible.

I might just play around curl with POST and authentication and see how that 
goes since cqsh is not maintain anymore.
Is there command line tool for MarkLogic that is maintained and working? :)
What built-in tools I could use to automate backups, user creation & assigning 
roles, renaming forest?
These exact tasks I'm doing with xqueries (super simple) and just wanted them 
automated.


Ernest Gulik

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Geert Josten
Sent: Thursday, October 08, 2015 1:47 AM
To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

A simple curl --anyauth --user {user}:{pass} http://localhost:8001 might be a 
good test as well.

Are you sure you are running the command from the same server on which you 
installed MarkLogic? You can typically check that using something like `sudo 
service MarkLogic status`. That will also tell you whether MarkLogic service is 
up and running.

Kind regards,
Geert

From: 
<general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>>
 on behalf of Danny Sokolsky 
<danny.sokol...@marklogic.com<mailto:danny.sokol...@marklogic.com>>
Reply-To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Date: Thursday, October 8, 2015 at 12:51 AM
To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

Also, cqsh is a super-old project that has not been touched in a very long time.

What is it you are trying to do?  You might try some of the built-in marklogic 
tools or a newer project.

-Danny

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of David Lee
Sent: Wednesday, October 07, 2015 3:36 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux

You do not want to use the elb, just checking you were not.
What your issue is could be many things , as many as there are ways to 
configure AWS x ML

If you provide some details on how exactly Howe you installed ML, ec2, and what 
your ec2 configuration is like,( vpc, network interfaces, using cluster manager 
or not , mounted devices  )  plus any errors or success logs from 
/var/log/messages and ErrorLog.txt , results from the admin GUI that may help.






Sent from my iPad
David A Lee
d...@marklogic.com<mailto:d...@marklogic.com>


On Oct 7, 2015, at 2:55 PM, Gulik, Ernest 
<egu...@aha.org<mailto:egu...@aha.org>> wrote:
Thank you for the quick reply.
Not to ELB,
I'm connecting to private ip address of ec2.
I deployed ML on ec2, downloaded & configured cqsh and followed the guide to 
execute the command.
I can't imagine that this would have to be done through ELB since daemon is 
listening on 0.0.0.0.



Ernest Gulik

From: 
general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of David Lee
Sent: Wednesday, October 07, 2015 4:45 PM
To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Failed to connect to Mark Logic. Invalid 
connection information. - cqsh with ML7 on Amazon Linux


are you connecting to the elb or the ec2 up?

Sent from my iPhone

On Oct 7, 2015, at 2:16 PM, Gulik, Ernest 
<egu...@aha.org<mailto:egu...@aha.org>> wrote:
Hi All,
I'm trying to test cqsh tool with ML7 on Amazon Linux ec2 but for some reason I 
get invalid connection Error and did try all combinations that I can came up 
with but still nothing.
Normally I can access query console on port 8000 but not through this cli:

$ cqsh -u <username> -p <password> -H <local-ipaddress> -P 8000
Failed to connect to Mark Logic. Invalid connection information.
Error: Connection failed
Goodbye.

I tried localhost, loopback ip and all ports 8001-..9 ports that are used by 
the application but no luck.
Can someone point me as to what could be the issue here?


Thank you,
Ernest Gulik

_______________________________________________
General mailing list
General@developer.marklogic.com<mailto:General@developer.marklogic.com>
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
General@developer.marklogic.com<mailto:General@developer.marklogic.com>
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to