how to set flink statsd reporter? - apache-flink

I read the doc and it can't work well,
I set the conf/flink-conf.yaml like that:
metrics.reporters: StatsDReporter
metrics.reporter.StatsDReporter.class: org.apache.flink.metrics.statsd.StatsDReporter
metrics.reporter.StatsDReporter.host: www.example.com
metrics.reporter.StatsDReporter.port: 8125
but I don't know and can't get where to import the statsDReporter?
is there some example to set it?

Related

How can we change value openSearcher=true from JAVA Code?

I am trying to insert data to SOLR using HardCommit. By default value of openSearcher=false in solrConfig.xml. I want to change openSearcher=true through JAVA code. Donot want to make change to SOLR.config.xml. Is there any way to do that??
Thanks
You should be able to do that with Config API. You could check current configuration by firing GET request at /config endpoint. E.g
http://localhost:8983/solr/collection-name/config
and set some property with command like this:
curl http://localhost:8983/solr/collection-name/config
-H 'Content-type:application/json' -d
'{
"set-property": {
"updateHandler.autoCommit.openSearcher": true
}
}'
This could be of course done in Java code, by using some popular HTTP client or by firing your implementation of abstract SolrRequest in SolrJ

Symfony Sonata SortableBehaviorBundle other DB connection

I have successfully installed the SortableBehaviorBundle in the Sonata-Admin. Now i'm not using only the default DB-connection, but some different for different bundles.
in config.yml
doctrine:
dbal:
default_connection: mysql
connections:
mysql:
driver: "%mysql_database_driver%"
...
geobundle:
driver: "%geo_database_driver%"
...
in vendor/pixassociates/sortable-behavior-bundle/Pix/SortableBehaviorBundle/Resources/config/services.yml
there ist the definition of
...
arguments:
- "#doctrine.orm.entity_manager"
if I change this to
- "#doctrine.orm.geobundle_entity_manager"
I get the sorted data from my geobundle-DB. If I try to override the setting by my own app/config/services.yml, I get a:
Attempted to call an undefined method named "get" of class
"Macrocom\GeoAdminBundle\Entity\AppAccessServiceprovider". Did you
mean to call e.g. "getAppAccess", "getConfig", "getCreatedAt",
"getId", "getIsActive", "getPosition", "getServiceprovider" or
"getUpdatedAt"?
but when I leave this on original setting I get
An exception has been thrown during the rendering of a template ("The
class 'ACME\GeoAdminBundle\Entity\AppAccessServiceprovider' was
not found in the chain configured namespaces
ACME\ApiBundle\Entity, ACME\CrmSyncBundle\Entity").
witch seems to try to access the mysql-DB and namespace.
As I dont wat to change the SortableBehaviorBundle everytime I deploy or update teh project to the server, is there a way to override the default-DB for this bundle only.
Best regards
RJ

How to disable 301 redirection in plesk for Domain-Alias via API

I using https://example.com:8443/enterprise/control/agent.php to call plesk Api using some Xml content, what I do is create and manage my domains and sites.
For some reason I need Create a Site-Alias(domain-alias) for my domain without 301 redirection.I can do it from plesk panel as I note in Image attached. But I don't know how to set it with xml.
This my xml that I post via API :
<packet version="1.6.7.0">
<site-alias>
<create>
<pref>
<web>1</web>
<mail>0</mail>
<tomcat>0</tomcat>
</pref>
<site-id>104</site-id>
<name>mysub.myotherexample.com</name>
</create>
</site-alias>
</packet>
Note that I have two domain name, example.com and myotherexample.com .I want add domain-alias mysub.myotherexample.com which is an alias for example.com.
I need some setting like what you see in Image.But my xml also enabled 301 redirection.
There is a seo-redirect option https://docs.plesk.com/en-US/17.0/api-rpc/reference/managing-site-aliases/site-alias-settings.33538/ :
<packet version="1.6.7.0">
<site-alias>
<create>
<pref>
<web>1</web>
<mail>0</mail>
<tomcat>0</tomcat>
<seo-redirect>0</seo-redirect>
</pref>
<site-id>104</site-id>
<name>mysub.myotherexample.com</name>
</create>
</site-alias>
</packet>

Access to shared_path in deploy.rb

I try to set command map using shared_path like that:
SSHKit.config.command_map[:composer] = "php #{shared_path.join('composer.phar')}"
But the path is /var/www/xxx not using the path I set on :deploy_to deploy/staging.rb.
I guess this is because staging.rb is loaded after.
What the right way then?
I had the same issue and although I don't think I have found the best way. I have found a way.
My default :deploy_to in deploy.rb points to '/var/www/my_app'. And I have a development stage where the server uses the same path. But my production server uses '/home/httpd/something/else' so I put :deploy_to in production.rb expecting it to deploy to that path. And everything works except the composer command. The composer.phar file is downloaded to the correct shared path and the files are deployed correctly. But when composer runs it tries to find it in '/var/www/my_app/shared'.
What I did was instead of putting the SSHKit.config.command_map by it self in deploy.rb, put it in a task. Something like:
namespace :deploy do
before :starting, :map_composer_command do
on roles(:app) do |server|
SSHKit.config.command_map[:composer] = "#{shared_path.join("composer.phar")}"
end
end
...
end
It feels like SSHKit.config.command_map runs "to early" or something. This seems to help. It works for me at least. And I had the exact same issue.
Edit:
I got some help from an issue I posted on capistrano/composer.

Apache vhost_alias

I have a question about vhost_alias
I got it working, it does the following job:
vhost.subdomain.domain.com -> sends to /var/www/vhost
using virtualdocumentroot and %1
But I don't like that I can access the same content also like this
vhost.vhost.subdomain.domain.com
since I have ServerAlias to *.subdomain.domain.com
How can I force that only vhost.subdomain.domain.com works?
The aim is to have many vhosts like this, for exmaple vhost1, vhost2, etc.
Thanks,
David
One solution you could try is to add a fixed subdomain in your ServerAlias, before your actual dynamic subdomain:
Example:
ServerAlias www.*.subdomain.domain.com
This will ensure that
vhost.vhost.subdomain.domain.com
does not redirect, however, you will be forced to always add www. before your name.

Resources