Up and Running with Obsidian Scheduler in 5 Minutes
Join the DZone community and get the full member experience.
Join For Freeone of the best things about obsidian scheduler is how quick and easy it is to get it running jobs. with other tools, you might have to set aside an afternoon to get it going, but with obsidian, trust me, it won’t take long at all.
to show you how easy it really is, i’m going to walk you through an example of a setting up a simple job that will do a basic health check to make sure our
website
is working.
.
step 1 – download and run the installer
elapsed time: 0 minutes
- first, just grab the latest obsidian installation package from our download page .
- extract the zip file, and double-click on the obsidian-install-x.x.x.jar file. (we assume you have java installed.)
- go through the installer, make sure the winstone installation option is checked, and then fill in your basic database connection info. you should point it to a database that already exists. the screenshots below show the winstone option and a sample mysql database connection.
step 2 – start obsidian
elapsed time: 2 minutes
- navigate to the installation directory you selected in step 1, and run the following on the command line, and obsidian will be merrily on its way.
webobsidian.sh scheduler start .. or for our windows friends webobsidian.bat scheduler start
step 3 – log in
elapsed time: 3 minutes
- navigate in your browser to http://localhost:8080 and enter admin and changeme for the login credentials.
- congrats! you have a functioning obsidian instance that you can execute jobs in!
step 4 – configure our health check job
elapsed time: 3.5 minutes
- click on the jobs tab, then on add job right below that.
-
configure your health check job by filling in the following fields:
- nickname: website health check
- job class: com.carfey.ops.job.script.groovyjob
-
defined parameters > script:
jobcontext.savejobresult('url', url) new url(url).gettext()
-
custom parameters > click add custom parameter, then enter:
- name: url
- value: http://obsidianscheduler.com (or some other url)
- initial schedule > schedule: * * * * * (this will run every minute, and you can omit the effective and end times)
- click save. after you save it will look something like the screenshot below.
- the job will start running every minute! easy huh?
step 5 -you’re done! monitor your job
elapsed time: 5 minutes
- click on the job history tab, and refresh now and then to see your jobs running!
all that’s left to do is watch your jobs execute! below are what a success case and a failure might look like.
of course, we could do a lot better than this as far as messaging goes, but we’ll leave that to you. we could also add some conditional notifications to get alerted of any job failures (which would require setting up smtp).
so there it is: we do everything we can to make your lives easier, but some things like writing the jobs you’ll unfortunately have to do yourself!
happy scheduling!
Published at DZone with permission of Carey Flichel, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
Top 10 Engineering KPIs Technical Leaders Should Know
-
Structured Logging
-
How To Use Pandas and Matplotlib To Perform EDA In Python
-
Transactional Outbox Patterns Step by Step With Spring and Kotlin
Comments