Oozie : Schedule task (Python script) - scheduled-tasks

how to schedule a local task on hadoop by using Oozie ?

Yes this can be accomplished by making use of ssh action.ssh to the edgenode and execute the command locally.In the ssh action you need to supply the host and the command to be executed.
https://oozie.apache.org/docs/3.2.0-incubating/DG_SshActionExtension.html
Also note that the oozie user should have passwordless ssh access to the node where you are executing the commands

Related

MongoDB init script doesn't run on Docker run by Jenkins SSH agent

I have a Docker container with MongoDB, with a /docker-entrypoint-initdb.d/... script with my initial mongo config.
The problem is that it doesn't get executed when run by Jenkins (through docker-compose up via SSH). When I start the container "manually" (same command through console, also SSH) - all is fine.
I'm a newbie at Jenkins, I think that's the case - the Jenkins SSH agent ceates a workspace that differs from the dir that Docker uses when run by me through terminal. But all the required files are there.. maybe it has sth to do with the script being executed only on initial startup? I tried removing it from the agent's workspace to be initialized again, but still no luck..

Rundeck - Execute ansible playbook on a remote ansible server

New in Rundeck
What i'm trying to achieve with rundeck is the following -
to let a windows user connect rundeck and execute predefined ansible playbooks that are located on a remote ansible server. Doing this will not require the user to connect the ansible server (i dont need to share password) and only approved user that can login to rundeck can run the scripts
Is it possible to install Rundeck on a windows machine and execute ansible scripts that are located on a remote ansible server?
Can i see the playbook output on rundeck UI?
If not, should I run rundeck on the local ansible server?
Can i have all the above using the community Rundeck version ?
By design Rundeck and Ansible must coexist in the same server to use the Ansible plugin but, you can dispatch Ansible commands (ansible-playbook) on remote servers using the command step.

Alternatives for PsExec which works in standard user

I am using psexec to execute commands on remote server. Here is my command,
PsExec.exe" -u user \\server -h run.bat
I am entering the password manually. here I am using standard user account due to security issues. When I run the command I am getting the error,
"Make sure that the default admin$ share is enabled"
I read here that it cannot be done without admin privileges.
But when I test the same command in LAN it works in standard user.
How it works in LAN not in Remote server ?
Is there any alternative tools which will work in standard user ?
Please help me.
As an alternate tool, you can use Powershell and WinRM. Powershell allows you to execute a command, or an interactive session, on the remote windows server.
An example of executing a command is available here:
How to programmatically/remotely execute a program in EC2 Windows instance
If you need an interactive session, look at the Powershll command 'Enter-PSSession': https://technet.microsoft.com/en-us/library/hh849707.aspx

Jenkins and PowerShell

I have a linux machine with Jenkins installed on it. It executes variety of different jobs on other linux machines.
Now - I would like to connect to a Windows machine and execute a PS script. Is it possible to do that from the Linux Jenkins by installing PS plugin (note that I do not want to execute a PS script on a local linux machine but execute all that on remote hosts)? If not, what is the proper way of doing that?
Yes you can run jobs on slave windows machine with Linux master.
Add windows machine as a new node(slave), give it a distinct label. The following link can help you in adding new slaves (https://wiki.jenkins-ci.org/display/JENKINS/Step+by+step+guide+to+set+up+master+and+slave+machines)
Go to job where you want to run PS script on windows machine and check the option "Restrict where this project can be run". Enter name of your windows machine label here.
To execute all jobs on remote machines, you can give all of them a separate label and use the step 2 to only use them for your jobs.
To execute job on local host you can enter "master" in the restrict run editbox.

Mongos auto start script for Linux

I have two mongos server in a production environment. I want to start mongos automatically when the server reboots. I tried several options to achieve this, but couldn't. I have three config servers.
This is the easiest way to get it accomplished.
If you are using Linux , it should have 'crontab' installed – a utility which runs cron job.
You need to execute the following command (only once) to automate run of mongos on every start/re-start of your linux machine. Here we are editing the crontab to add a cron job(run script) on every reboot/boot event.
sudo crontab -e
Add a line like this to it:
#reboot /path/to/script
The script should invoke path/to/mongo/bin/mongos -options