Using Jmx Exporter on multiple targets - cassandra

Is it possible to use https://github.com/prometheus/jmx_exporter on multiple targets or i need to run multiple instance of the jmx exporter ?
I'am using run_sample_httpserver.sh script.

You have to run one instance per target, as this keeps the responsibility of scheduling and service discovery with Prometheus. It's also recommended to use the java agent.

This worked for me you can check once may if of any help, just that it needed multiple config files to be created.Link

Related

Background service in ServiceStack

I've got an application w. AppHost (inside Startup.cs) and also a Configure.Db.cs file.
I want to run a background service (Timer based) to routinely do some things, in addition to serving services.
If I add the timer inside Apphost's Configure(), which is run before the Configure.Db, I get into a problem as the background service is dependent on the Db to be configured.
Edit: I just found that it is possible to specify order of Modular startup: https://docs.servicestack.net/modular-startup#modular-startup-prioritization which means I can force the Configure.db to run before Apphost.
Anyway, am I going about this wrong? Should I perhaps have a separate AppHost just for the background job?
I would recommend configuring a Background MQ Service for executing Services in the background.
You can look at how to do this with hangfire by adding the mix
x mix hangfire-postgres
This will allow you to add services that fire in the background on a cron schedule.
To make it work without a database you need to change the postgres provider to the in-memory provider: https://github.com/perrich/Hangfire.MemoryStorage

Tigase external component as a single jar

I've implemented tigase component with certain functionality and now trying to figure out how to use it as an external component.
For now it seems I have to set up separate tigase server with my component on it and then configure main tigase server to refer to that separate server as an external component.
What I would like to do is to assemble that external tigase into a single jar in order to be able to run it with one line command without installing tigase upfront.
Question is is it possible at all?
It seems that tigase needs database to run and administration guide encourages to use shared main server's database for external components. I'm not sure if tigase can start without database which makes it rather hard to run with simple java -jar command.
For now it seems I have to set up separate tigase server with my component on it and then configure main tigase server to refer to that separate server as an external component.
This is correct. Tigase XMPP server follows XEP-0114: Jabber Component Protocol and XEP-0225: Component Connections in this regard. Please refer to
External Component Configuration for details how to configure it in Tigase.
What I would like to do is to assemble that external tigase into a single jar in order to be able to run it with one line command without installing tigase upfront.
Question is is it possible at all?
You could create an "uber jar" - yes, that's possible. One of the possible solutions would be to create your component as a separate maven project, configure tigase-server as dependency and then take advantage of jar-with-dependencies of Apache Maven Assembly Plugin. It will pull all required, configured dependencies and place them in single jar file. Please note however, that for example database drivers won't be included.
It seems that tigase needs database to run and administration guide encourages to use shared main server's database for external components. I'm not sure if tigase can start without database which makes it rather hard to run with simple java -jar command.
Database is indeed required - this has the benefit of keeping your configuration consistent of many nodes that may run your external component (you need to updated only once on one node and all remaining nodes will update it automatically), but you don't have to use the main server database. Please see Usage with a separate database for details.
If you are using only single, local instance of your external component then you can create a simple derby database and place your configuration in etc/externalComponentItems file
Yes, the Tigase component Framework/API requires Tigase Server core to run. And you only load the Tigase server core with your custom component.
Shared database between Tigase main XMPP Server and component instance is recommended for simplicity but not mandatory. I think the external component instance could be even run with dummy DB connector, if DB is really not needed.

how to run multiple elastic search (2.2) nodes as processes on the same server

i was wondering if you help me out here;
am trying to run multiple elasticsearch processes on the same (CentOS) server, but i have been un-successful so far.
and i have not enabled the service wrapper. and Elasticsearch has been installed using the .rpm package
the requirements are:
every instance belongs to a different cluster (cluster.name)
every instance uses a different port, 9201, 9202, 9203, etc.
every instance should be parameterised with different ES_HEAP_SIZE
the elasticsearch.yml file is attached where all parameters are described.
and the questions are:
how to set a different configuration file per instance when Des.config seems to be deprecated in 2.2
how to set a custom ES_HEAP_SIZE (-Xmx=24G -Xms=24G) when
# bin/elasticsearch -Des.config=config/IP-spotlight.RRv4/elasticsearch.yml [2016-02-14 19:44:02,858][INFO ][bootstrap ] es.config is no longer supported. elasticsearch.yml must be placed in the config directory and cannot be renamed.
please help ..
You have two solutions:
download elasticsearch archive from the site and run it from different paths with different configs. You can monitor each running instance with a method like supervisor. The main page for Elasticsearch downloads is here
run each instance inside a docker container. This is the right way to do, because it is easier to deploy and manage. You can find a Elasticsearch docker image here

How to remove instance of accumulo?

I have created a instance while initializing accumulo by calling accumulo init
But now i want to remove that instance and as well i want to create a new instance.
Can any one help to do this?
Remove the directory specified by the instance.dfs.dir property in $ACCUMULO_HOME/conf/accumulo-site.xml from HDFS.
If you did not specify an instance.dfs.dir in accumulo-site.xml, the default is "/accumulo".
You should then be able to call accumulo init with success.
I don't have enough rep to answer your follow-up comment.
Make sure you restarted the monitor process since reiniting. Furthermore, make sure the node you're running your monitor on has the same configuration as the rest of the instance, as well as the same configuration for Hadoop on the classpath based on HADOOP_HOME.

Codeigniter CLI As Daemon

I am creating a queue system where I need a set of workers to run jobs. For the queue I am planning on using Amazon's SQS. For my workers I would like to run instances of Codeigniter because the core application will also use Codeigniter and I would like to share the models of the workers with that of the core application.
I see that it is possible to hit a controller method using CI's CLI (http://codeigniter.com/user_guide/general/cli.html). However, these workers should continually run, unless I kill them. I have looked into this article about setting up daemons using php: http://kevin.vanzonneveld.net/techblog/article/create_daemons_in_php/ This method requires that I use this class: https://github.com/kvz/system_daemon.
I am not sure if I should be calling and running System Daemon inside my controller in CI to spawn the entire CI instance as a daemon? Or is there a command-line approach where I can establish my call to the CI method as a daemon and then avoid using the 'System Daemon' class altogether? Any considerations I should be aware of? I have never created a running daemon, I have only used the cron tab to restart processes but that will not work in my case.
I dont know if anyone has daemonized properly codeigniter (I read that many had tried).
I had a similar situation with yours and I ended up using the System Daemon class which constantly checks SQS and then calling a CLI codeigniter via system() passing the message as a parameter.
My approach works for ~10 months without having any issues and serves ~30-40k messages per day.

Resources