ElasticSearch 8: is there a "conf.d" folder to change settings without editing elasticsearch.yml? - elasticsearch

I'd like to edit a few ElasticSearch 8 settings (for example: network.host), but I don't want to edit /etc/elasticsearch/elasticsearch.yml directly. What I'd like to do is to add my settings to my own file and put it in an hypothetical /etc/elasticsearch/conf.d folder, do be included automatically.
This approach is widespread with multiple other software I use (Nginx, Apache, MySQL, PHP just to name a few).
ElasticSearch already does what i need with /etc/elasticsearch/jvm.options.d, but that folder is just for the the JVM options, not for ES own settings.
What am I missing here?

You can override the config path via env variables:
ES_PATH_CONF=/path/to/my/config ./bin/elasticsearch
https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html
There is an old discussion about doing what you are asking about but didn't make it this way:
https://github.com/elastic/elasticsearch/issues/11362

Related

IntelliJ disable usage statistics / data sharing via configuration file

The Option to disable data sharing can be changed at any time by the user:
I want to disable this setting by default for a managed installation of IntelliJ IDEA, ideally via configuration file or registry setting.
How can I do this? I could not find any registry setting or configuration setting so far.
This option is already disabled by default.
The state of the option is stored in the /consentOptions/accepted file under the data directory which is platform specific.
On Windows that would be C:\Users\<user>\AppData\Roaming\JetBrains\consentOptions\accepted.
When the option is enabled, the file will contain something like this:
thrd.plugins:1.0:0:1525589497351;rsch.send.usage.stat:1.1:1:1551998109388
and the following with the option disabled:
thrd.plugins:1.0:0:1525589497351;rsch.send.usage.stat:1.1:0:1551998064076
The format is as follows:
rsch.send.usage.stat:<version>:<enabled>:<timestamp>
You can learn more from the ConsentOptions.java source code.

Clone development environment on an office server to use locally

Situation:
As a developer I'd like to "clone" our development environment (on an office server) so we can use it locally (for example when no/limited internet access is available). We've decided to give Vagrant a try.
What did I do?
First I used PuPHPet to create a basic config including nginx, php (incl modules), composer, git, memcached etc. You can find my config here. I also added a nginx vhost for our website.dev. This is where I run into the first problem.
We use a few additional config settings to the location block. A rewrite, a fastcgi_pass and a include. This is not available so I searched a lot online and I found out I could use the following statement (was more a try/fail/retry).
location_cfg_append:
{ rewrite: ".* /dispatch.php break", include: "fastcgi-params.conf", fastcgi_pass: "127.0.0.1:9000" }
First question:
This does work, however is this the way to do this? I'm not sure if I should be editing this config file (the file generated by PuPHPet) directly.
Second question:
How should I 'upload' the fastcgi-params.conf file I want to include? I did not find a way to do this in the config.yaml but there is a way to run some scripts. For now I've added a echo [contents] > /etc/nginx/fastcgi-params.conf that does work. However...
Third question:
When the VM is provisioned the nginx config is created. When that is done nginx is restarted. However at that moment the fastcgi-params.conf file does not exist yet (this is created AFTER the provisioning).
When nginx reloads this will fail, trigger an error and the machine can not finish the provision sequence (so it will never create the config file).
I can create this file on the next boot (and then nginx will work) but this cannot be the correct way to do this. So: how can I (before nginx 'installation') create / deploy a file to the VM? Or more generic (question 2): How can I upload a file to the VM?
If this is totally not the way to go please let me know! This are our first steps into creating a locally development machine so other/better methods are welcome.
First question: This does work, however is this the way to do this? I'm not sure if I should be editing this config file (the file generated by PuPHPet) directly.
Yes, I encourage this.
Second question: How should I 'upload' the fastcgi-params.conf file I want to include?
Place it inside one of your shared folders. It'll be available within the VM and you can reference it that way.
Third question
The above answer fixes this issue.

In odoo 8 server "--auto-reload" when work

Actually In the command of start odoo 8 server.
It will provide "--auto-reload" option
But actually i don't know how it works and when to work.
Please if give me some guideline for that
Normally if you change your python code means, you need to restart the server in order to apply the new changes.
--auto-reload parameter is enabled means, you don't need to restart the server. It enables auto-reloading of python files and xml files without having to restart the server. It required pyinotify. It is a Python module for monitoring filesystems changes.
Just add --auto-reload in your configuration file. By default the value will be "false". You don't need to pass any extra arguments. --auto-reload is enough. If everything setup and works properly you will get
openerp.service.server: Watching addons folder /opt/odoo/v8.0/addons
openerp.service.server: AutoReload watcher running
in the server log. Don't forget to install pyinotify package.
I found this looking for the same thing, but for odoo 10. Someone will follow the same route, so:
This has been changed in odoo 10 to --dev=reload. BUT you can't specify that in /etc/init.d/odoo itself. Only from the command line.

ElasticSearch Templates

I'm running ElasticSearch on Ubuntu 14.04 and I can't seem to get ES to find a template for a specific index. The documentation is confusing in that it says you should put a templates directory under /etc/elasticsearch/config/, but then later in the documentation it says that configuration should be under /etc/elasticsearch, like the yaml file is at /etc/elasticsearch.
The reason I know its not finding it is I can do a:
curl -XGET 'http://localhost:9200/_template/my_template?pretty'
and get an empty JSON object back.
According to the config notes for Templates:
Index templates can also be placed within the config location (path.conf) under the templates directory (note, make sure to place them on all master eligible nodes).
In your case, if your main configuration directory is /etc/elasticsearch then you may place templates inside a folder called /etc/elasticsearch/templates. You'll need to place that file onto all of the servers which are running master-eligible nodes. (E.g., for a small cluster, onto all nodes.)
In my experience, it's a little more common to simply POST templates using the HTTP API. That way you can add and remove templates without having to worry about managing and deploying configurations on your servers.
Index Templates

Vagrant - Global Setup among many sites + domain aliases

Coming from a MAMP Pro background, I loved the ability to have a "base" folder (/Sites in this case), have all of my projects underneath it and set custom server names/aliases with it. With Vagrant, it looks like I can accomplish the name/alias part with vagrant-hostsupdater, but if I really did just want to have the Vagrant files in /Sites and then all of them use the same config, what's the best way to specify a subfolder disk location with those custom host names?
I'm most likely over-thinking this, have just been a sucker for GUI interfaces and would love to know how to accomplish this. Thanks as always!
Clarification
What I'm used to
I used to use MAMP Pro, which allows you to setup custom host additions with their GUI interface. So, within my ~/Sites directory, I have several different projects going on, all in subfolders. The screen shot below shows how I can set a server name and specify a disk location, all from this central location.
What I'd like to do with Vagrant
Now I do know of (and used vagrant-hostsupdater), but what I was wondering is if I can set my Vagrant file in my ~/Sites directory (which is kind of like the root of the server; since all of my projects require the same setup) and then have individual host names setup for each project - so instead of having to access a subfolder like local.dev/project-1 or local.dev/project-2 I could setup server names such aslocal.project-1.comandlocal.project-2.com` from within that top-level Vagrant file and specify the subfolder it should attach that rewrite rule too.
The reason I'd like to do this is so I only have to run one vagrant up and I can then access all of my projects from one Vagrant instance as well as only keep track of one Vagrant file. Thanks!
You need to tell vagrant what hostnames you would like to use.
Directory based hostnames
Assuming you set you would like to set your hostnames based on the directory name; you can get all of the hostnames with ruby and pass them to the hostsupdater configuration.
SITES_DIR = "~/Sites"
config.hostsupdater.aliases = Dir["#{SITES_DIR}/*/"].map { |d| d.chomp('/') }
Configuration based hostnames
Alternatively you can mock up some sort of configuration that is desirable to you and what you are trying to do and evaluate/process it in ruby within the Vagrantfile.

Resources