So you can't directly update a single item, but must get the entire config group associated with.
What I have done is:
# read the tag of target config i want
curl -u $USERNAME:$PASSWORD -H "X-Requested-By: ambari" -X GET $BASE_URI?fields=Clusters/desired_configs > .temp_json
# download my configs
curl -u $USERNAME:$PASSWORD -H "X-Requested-By: ambari" -X GET "$BASE_URI/configurations?type=$CONFIG_TYPE&tag=$TARGET_TAG" > .configs_to_update
# update configs here > UPDATED_FILE_HERE
# ??? (upload the configs)
The next step is to upload the configs to the server then restart the services. I can't seem to figure out the API call to upload the configs. Does anyone know how I can upload the configs with the Ambari REST API?
I am not sure if this helps your situation, but check out this command I use to make an adjustment to a single config:
python /var/lib/ambari-server/resources/scripts/configs.py -u admin -p admin -n HDP3 -l c7404.ambari.apache.org -t 8080 -a set -c cluster-env -k ignore_groupsusers_create -v true
Related
I use the below curl command to disable the alert which works fine.
curl -k -u admin:password https://URL -X POST
But i am trying to hide the username and password in the below shell script but getting unauthorized exception,
SCRIPT_DIR=/tmp
USER=$(cat $SCRIPT_DIR/.nonprodusr.txt)
PWD=$(cat $SCRIPT_DIR/.nonprod.txt)
curl -k -u $USER:$PWD https://url -X POST
You can use a netrc file : https://everything.curl.dev/usingcurl/netrc
/tmp/netrc :
login admin
password Passw0rd
And use it with this option :
curl -k --netrc-file /tmp/.netrc https://url -X POST
One can use a configuration file to add user/password as well as other configurations.
curl --config /home/me/curl-configuration.txt <url>
Contents of "/home/me/curl-configuration.txt":
--user <username>#<password>
I'm trying to login on my local Splunk server using curl bash command but without success, so far I have tried the following:
curl -u admin:changeme -k http://192.168.1.103:8000/en-US/account/login
curl -u admin:changeme -k http://192.168.1.103:8000/en-US/account/login -d"username=admin&password=changeme"
Any help would be very appreciated,
Thanks.
Are you trying to do REST calls? You need to hit port 8089
I know, that there is a way to enable or disable jenkins job by using commands
curl -u user:password -X POST http://server/job/jobname/enable
curl -u user:password -X POST http://server/job/jobname/disable
But what I need - is to get the status of job "enabled/disables" and write it to the bash $status variable.
Is there a way to do it?
You can check if job is enabled or disabled using the API
http://server:port/job/jobname/api/xml?xpath=*/buildable
So, with crumb, you can use something like this:
CRUMB=$(curl -s 'http://USER:PASSWORD#SERVER:PORT/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)')
myStatus=$(curl -X POST -H "$CRUMB" "http://USER:PASSWORD#SERVER:PORT/job/jobname/api/xml?xpath=*/buildable")
And in variable myStatus you get
<buildable>true</buildable>
or
<buildable>false</buildable>
I have installed Couchbase Server 3.0 on Mac OSX 1.9.5 using the package from couchbase, installed using all defaults, and I am not able to locate cbdocloader in the expected folder
/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/tools
The only tools available are:
cbanalyze-core
vbucketkeygen
vbuckettool
I do not see any information about the deprecation of this tool or an alternative approach to load data.
You are looking in the wrong folder, it's in bin and not tools:
[user:~] $ /Applications/Couchbase\ Server.app/Contents/Resources/couchbase-core/bin/cbdocloader -h
Usage: cbdocloader [options] <directory>|zipfile
Example: cbdocloader -u Administrator -p password -n 127.0.0.1:8091 -b mybucket -s 100 gamesim-sample.zip
Options:
-h, --help show this help message and exit
-u Administrator Username
-p password Password
-b mybucket Bucket
-n 127.0.0.1:8091 Node address
-s 100 RAM quota in MB
I need to change my varnish param cli_buffer to bigger value than the default one (8192).
In the github thread https://github.com/nexcess/magento-turpentine/issues/136
they've already mentioned the following way to do this
start Varnish instance with "-p cli_buffer 10000"
i tried with the following command but i cant change
varnishd -p cli_buffer=10000
i guess i need to use vcl.inline, but am not sure how to do that (as i am developer and just a beginner with server stuff like this.)
I have Sudo access to start and stop the varnish and change the varnish config.
Can you help me how to do this ?
Thanks,
Jerome
Ok got it,
To change varnish params do the following:
Assumed that you're logged in to shell as a super user and has permission to change varnish configuration and start and stop the varnish services
use command varnishadm
varnishadm
After that change the param as shown below
varnish> param.set cli_buffer 10000
To verify its changed use the command below
param.show cli_buffer
You are done !
Seems cli_buffer need add to
/lib/systemd/system/varnish.service
like
ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -p feature=+esi_ignore_other_elements -p vcc_allow_inline_c=on -p cli_buffer=16384 -s malloc,256m