Rundeck Introduction
Rundeck is an open source software that automates programs in your daily business in a data center or cloud environment. Rundeck provides a number of features that can reduce laborious manual labor. Teams can collaborate, share how to automate processes, view business activities, or perform tasks. Rundeck allows you to run any number of nodes from a Web-based task or command-line interface. Rundeck also includes other features that make it easy to scale, and your automation efforts include: Access control, workflow building, scheduling, logging, and integration with external source nodes and option data. The specific flowchart refers to the following official website:
installation
Rundeck is the server application of your host system you designate a central administrative control center. Internally, Rundeck stores the job definition and execution history in the relational database. The output is saved on disk from commands and work executions, but can be forwarded to remote storage such as Logstash.
Rundeck distributed execution uses the default SSH but plug-in allows you to use other means such as mcollective, Salt, WinRM, or a custom method of pluggable node execution layer commands. The Rundeck server configuration includes settings that define the outbound users of the allowed remote hosts. The remote computer does not need to be sent back to the server for connectivity.
1. Installing the JDK
Rundeck is a Java-based Servlet server and therefore requires support for the Java Runtime Environment
#java-versionjava Version "1.7.0_79" Java (tm) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot (tm) 64-bit Server VM (Build 24.79-b02, Mixed mode)
2, installation Rundeck
Here is the use of Rundeck jar package installation, the reader can also use RPM package installation, here to see personal preferences, version is the latest version, http://rundeck.org/downloads.html
Rundeck-launcher-2.6.3.jar
#vim/etc/profile Add export rdeck_base=/opt/programs/rundeck_2.6.3 installation directory at the end you can define your own #source/etc/profile#echo $RDECK _base /opt/programs/rundeck_2.6.3
#mkdir-P $RDECK _base
#cp Rundeck-launcher-2.6.3.jar $RDECK _base
#cd $RDECK _base#java-xx:maxpermsize=256m-xmx1024m-jar Rundeck-launcher-2.6.3.jar
2010-11-19 13:35:51.127::info:started [Email protected]:4440
When the message appears, indicating that the current service started successfully, the port listens on the default port 4440, the initial user and password are both admin
After successful startup, we can see the following directories in the Rundeck directory:
#ls etc Libext projects Rundeck-launcher-2.6.3.jar Server Tools var
after the jar package is initialized, the next startup and shutdown can do the following:
Startup
$RDECK _BASE/SERVER/SBIN/RUNDECKD Start
Shutdown
$RDECK _BASE/SERVER/SBIN/RUNDECKD Stop
I use the ordinary user Apprun login, RPM package default is the Rundeck user, the reader can define the user to start, specifically modified as follows:
#vim/$RDECK _base/etc/framework.propertiesframework.ssh.keypath =/home/apprun/.ssh/id_rsa # SSH authenticated user's key storage directory Framework.ssh.user = apprun #启动默认用户 #chown apprun:apprun rundeck_2.6.3/-R #修 When you're done, don't forget to modify the host of the Rundeck directory.
Simple to use Rundeck
1. Several basic concepts
role-basedaccess control policies:rundeck access controls policy grants users and user groups certain permissions to execute permissions to restrict access to rundeck resources, such as projects, work, nodes, commands, and APIs.
Projects : A project is a place to manage activities separately. All Rundeck activities occur within the context of the project. Multiple items can be kept on the same Rundeck server.
jobs: A sequence of job encapsulation steps, job options, and where the node executes the steps.
Nodes : A node is a resource that is a physical or virtual instance of a network access host. A resource model is a node representation in a project.
Commands : The command executes a single executable string on a node. Rundeck invokes the command through the executor of the node and computes the command string to execute on its node.
executions : Execution is an activity that represents a running or completed command or work. About the implementation of data in Rundeck to monitor progress in work or order and subsequent reports on what happened.
Most of the Plugins :rundeck is done through one of its plugins. The presence of a plug-in executes commands on a node, steps in execution, sends notifications about the status of a job, collects information about hosts in your network, copies a file to a remote server, stores and streams logs, or refers to a user directory.
Before you begin, briefly describe my environment.
Rundeck-server:bd-stg-test-97
Rundeck-node1: bd-stg-test-98
Rundeck-node2:bd-stg-test-99
SSH authentication is done, Apprun on 97 can avoid password login to 98 and 99
2. Add Project
3. Add node
After you create a project, under Rundeck's home directory, save one of its configurations, and add the following nodes in the node's configuration file:
#vim /opt/programs/rundeck_2.6.3/projects/rundeck_test/etc/resources.xml <?xml version= "1.0" encoding= "UTF-8"? ><project> <node name= "bd-stg-test-97" description= " Rundeck server node " tags=" " hostname=" bd-stg-test-97 " osarch=" AMD64 " osFamily=" Unix " osname=" Linux " osversion=" 2.6.32-573.el6.x86_64 " username=" Apprun "/> < Node name= "bd-stg-test-98" description= "Rundeck client node1" tags= "" hostname= " 172.16.57.98 " osarch=" AMD64 " osfamily=" Unix " osname=" Linux " osversion=" 2.6.32-573.el6.x86_ " username=" Apprun "/> <node name=" bd-stg-test-99 " description=" Rundeck Client node2 " tags=" " hostname=" 172.16.57.99 " osarch=" AMD64 " osfamily=" UNIX " Osname= "Linux" osversion= "2.6.32-573.el6.x86_64" username= "Apprun"/></project>
after adding, you do not need to restart the service, after the refresh, you can see that the node information has appeared on the Web interface:
Let's take a test to see if we can remotely control the operation of two node on the Web interface, which is similar to Saltstack:
The execution of the command is very simple, each execution result is also clearly shown, indicating that the configuration between the server and the node has been completed, if there is an SSH authentication error, but also to re-check the directory permissions and SSH authentication configuration there is no error.
4. Add Job
The basic usage of Rundeck is here first, and the specific usage will be updated in the future.
Rundeck Deployment and Basic use