If your Spring Boot application uses MonogDB, Spring Boot will automatically provide a health check endpoint that includes whether MonogDB is "healthy". But what exactly does this check? What does the check showing that MonogDB is "up" mean? What kinds of faults can cause it to be "down".
The MongoHealthIndicator does this:
#Override
protected void doHealthCheck(Health.Builder builder) throws Exception {
Document result = this.mongoTemplate.executeCommand("{ buildInfo: 1 }");
builder.up().withDetail("version", result.getString("version"));
}
That is, it attempts to execute the MonogoDB command buildInfo: 1. That command "returns a build summary", which is mostly version IDs.
The health check therefore indicates that your application can connection to MonogoDB and execute a simple command in a reasonable time. MonogDB probably incorporates all the information it needs to respond to that command in the executable itself; it does not need to perform a query of the data-store. So the check is unlikely to indicate that the data-accesses can be done OK and will be performant.
Related
I am writing restful API with Yii, but I am getting an SQL error in create function. My purpose is to add new data to the news table, but it asks me for the author_id. How can I do it without crushing the default create method?
Solution 1. Run this below query on mysql/phpmyadmin and restart server
SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION';
Solution 2.
Open the my.ini or my.cnf file for editing (the file you have depends on whether you are running Windows or Linux).
Find the following line:
sql_mode = "STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
Replace it with the line below:
If the line is not found, insert the line under the [mysqld] section (if there is no [mysqld] section, create it).
sql_mode= ""
Restart the MySQL service for the change to take effect.
If restarting is not a feasible option at the moment, you may log into the database server and execute the below command for the changes to take effect immediately. However, the change will be discarded the next time the MySQL service restarts unless the above process is performed.
set global sql_mode='';
How to establish the connection with mongo dB using jmeter with JSR223 sampler? Whenever i am trying to establish connection it is failing without any response.I am suspecting this is due to auth mechanism.
Any help with necessary changes needs to be done on jmeter is much appreciated
Whenever you face an issue with your script always check jmeter.log file, it should normally contain the root cause or at least enough information to guess it.
If you're looking for a built-in JMeter way of load testing MongoDB you will need to add the next line to user.properties file:
not_in_menu
This way you will have MongoDB Source Config back and will be able to specify your MongoDB host, port and other connection parameters. Later in JSR223 Sampler you will be able to get db object like:
def db = MongoDBHolder.getDBFromSource('sourceName', 'databaseName')
or if you need to supply the credentials:
def db = MongoDBHolder.getDBFromSource('sourceName', 'databaseName', 'username', 'password')
More information: How to Load Test MongoDB with JMeter
Im new to chef and trying to understand why this code does not return any error while if i do the same with 'start' i will get an error for such service does not exist.
service 'non-existing-service' do
action :stop
end
# chef-apply test.rb
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* service[non-existing-service] action stop (up to date)
Don't know which plattform you are running on if you are running on Windows it should at least log
Chef::Log.debug "#{#new_resource} does not exist - nothing to do"
given that you have debug as log level.
You could argue this is the wrong behaviour, but if the service dose not exist it for sure isen't running.
Source code
https://github.com/chef/chef/blob/master/lib/chef/provider/service/windows.rb#L147
If you are getting one of the variants of the init.d provider, they default to getting the current status of a service by grepping the process table. Because Chef does its own idempotence checks internally before calling the provider's stop method, it would see there is no such process in the table and assume it was already stopped.
Two part question:
I need to setup test case where one bean/fact has collection of items - is it possible to do with workbench editor, I picked Guided list and for each item I was trying to do new Item('sku', 'name') .. but when it tries to compiled it it has can not find Item class. Item class is imported.
After deploying artifact to execution server and testing rules with SOAP UI where I did not specify session in the tag - it seems like by default execution server uses statefull session which affect subsequent rule executions.
I went to project properties created "stateless" session
ksession, default=yes, state=stateless, clock=realtime
Now however if I try to execute by test cases in the workbench I get:
Unable to complete your request. The following exception occurred: Cannot find a default KieSession.
Any ideas???
Apologies in advance for any failing with my terminology and understanding with Meteor/Mongo, I've just started learning and developing with it.
I am trying to connect my local meteor app to a remote mongodb which is hosted elsewhere.
My code looks like this:
Bills = new Mongo.Collection("bills");
if (Meteor.isClient) {
Meteor.subscribe("bills");
// This code only runs on the client
Template.body.helpers({
documentContent: function () {
return Bills.find();
}
});
Template.documentBody.helpers({
documentContent: function ()
{
var thingy = Bills.find();
console.log(thingy);
return Bills.find({_id: "784576346gf874"});
}
});
}
I have connected to the DB via the shell using the following:
$ MONGO_URL="mongodb://mysite.net:27017/legislation" meteor
In my browser I receive no errors and within my defined template I see [object Object]. The console shows a local miniCollection but doesn't return any of my documents from the subscribed collection.
I guess what I am asking is; if you were connecting to a remote MongoDB within your local app, how would you do it?
Thank you for taking the time to read, any helps is massively appreciated.
Rex, If you're not seeing errors in the output on the browser, or in the console where you're running the server then you may be setup ok. That's exactly how I'm doing it.
Run meteor list in server directory and look for insecure and autopublish
You should understand these two packages They are for rapid prototyping. If they are present, then keep digging into MongoDB and the connection.
I recommend Robomongo for viewing documents directly in MongoDB.
If they are absent, then you need to go about publishing data (getting it from the server to the client) and securing it (letting clients only modify their data).
I recommend these two packages for that.
reywood:publish-composite
ongoworks:security
If you haven't read an introduction to meteor book, it's really worth the time. I've been developing for some time and learned meteor recently. It was invaluable.