Is there a way to change the /etc/default/elasticsearch file for elasticsearch 7? - elasticsearch

In the documentation for elasticsearch 7 it says explicitly
For the package distributions, the config directory location defaults
to /etc/elasticsearch . The location of the config directory can also
be changed via the ES_PATH_CONF environment variable, but note that
setting this in your shell is not sufficient. Instead, this variable
is sourced from /etc/default/elasticsearch (for the Debian package)
and /etc/sysconfig/elasticsearch (for the RPM package). You will need
to edit the ES_PATH_CONF=/etc/elasticsearch entry in one of these
files accordingly to change the config directory location.
Is there a way to specify my own path for a different /etc/default/elasticsearch file for a package distribution installation? I already tried by adding the following in my systemd service file which uses the EnvironmentFile I want, but it still uses /etc/default/elasticsearch when the service is comming up.
[Service]
...
EnvironmentFile=-/etc/default/elasticsearch-development

The answer to this (at least for version 7.7.0) is that you can't do it seamlessly with any option or environment variable because it is not provided. However it is possible to edit the file /usr/share/elasticsearch/elasticsearch-env that comes with the package installation and replace line 81 with the following:
if [ ! -z "$ES_DEFAULT" ]; then
source $ES_DEFAULT
else
source /etc/default/elasticsearch
fi
Then it is possible to set ES_DEFAULT in the system service file to point to a different /etc/default file.
[Service]
...
Environment=ES_DEFAULT=/etc/default/elasticsearch-development

Related

CLI Go Config.toml file location

I am attempting to test a Golang application hauser locally on via -bash CLI before deploying on a VM.
Per the documentation, I compiled locally and copied the example-config.toml file. I then mapped to the GOPATH and opened hauser.exe to open config.toml file. However, when I execute, it returns open config.toml: no such file or directory
C02Z30ANLVDV:~ pmcgin2$ $GOPATH/bin/hauser -c Documents/go/bin/config.toml
2020/08/14 18:05:23 Cannot find folder , make sure it exists
C02Z30ANLVDV:~ pmcgin2$ open Documents/go/bin/config.toml
No application knows how to open /Users/pmcgin2/Documents/go/bin/config.toml.
Is there an alternative command I can execute to override the default config.toml location for an application like this?
There are two possibilities to solve your issue:
give an absolute path as argument:
$GOPATH/bin/hauser -c /Users/pmcgin2/Documents/go/bin/config.toml
give a relative path from the binary location:
$GOPATH/bin/hauser -c config.toml
Generally, it is easier to use absolute paths.

How does one properly edit the clickhouse-server config.xml file?

The ClickHouse quick start guide says that when modifying config.xml: "It's not really handy to directly edit config.xml file considering package updates. Recommended way is to override the config elements in files of config.d directory."
I am new to ClickHouse (as well as daemon configuration). What does that statement mean? Where is the config.d directory? What files should go into that directory and what should the contents be?
It means that it's recommended to create a separate configuration file in the config.d directiory (that is located in the same path as the current configuration file; so /etc/clickhouse-server/config.d/ by default).
"considering package updates" means that if you update your clickhouse-server package, it may rewrite the /etc/clickhouse-server/config.xml, so you shouldn't put any changes in there - it'll be rewritten and lost.
It says so in the documentation:
The main server config file is 'config.xml'. It resides in the /etc/clickhouse-server/ directory.
Certain settings can be overridden in the *.xml and *.conf files from the 'conf.d' and 'config.d' directories next to the config.
So, you should create a /etc/clickhouse-server/config.d/ directory; then, create a configuration file there (like config.xml, my_config.conf or whatever else). There you should do all your custom settings, the ones that differ from the original /etc/clickhouse-server/config.xml file.
For instance, you could change the HTTP port from 8123 to 8663:
# cat /etc/clickhouse-server/config.d/test.xml
<?xml version="1.0"?>
<yandex>
<http_port>8663</http_port>
</yandex>
Please make sure to restart the daemon (if you're using Ubuntu, it's sudo service clickhouse-server restart) for the configuration changes to apply.

Error installing WebLogic server using Console mode in windows 8.1

Hi i have been trying to install the server weblogic of oracle on windows 8.1 but I obtain the follow when I run the configure.cmd file:
ERROR: You must set MW_HOME and it must point to a directory where an
installation of WebLogic exists. Ensure you point this variable to the
extract location of the zip distribution.
How do I correct this error?
There's a readme file linked from the product download page http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html although your experience would suggest that defining MW_HOME isn't optional! ...
1. Extract the contents of the zip to a directory (eg: /home/myhome/mywls)
This will create a base directory named wls12130 under /home/myhome/mywls
MW_HOME will be the entire directory including the base directory.
(eg: MW_HOME will be /home/myhome/mywls/wls12130).
2. Setup JAVA_HOME and optionally, MW_HOME variables in the current shell as required
for the target platform.
Windows
> set JAVA_HOME=C:\home\myhome\myjavahome
> set MW_HOME=C:\home\myhome\mywls\wls12130
3. Run the installation configuration script in the MW_HOME directory.
This step is required to be run only once. If you move the installation to
another location/machine, you need to rerun this step.
Windows
> configure.cmd
Environment variables are not set properly.
1.- Create product directory
mkdir E:\weblogic\wls << I'm sure you did it and Weblogic binaries are already installed.
2.- set environment variables properly
set JAVA_HOME=_path_to_\jdk1.7.0
set MW_HOME=E:\weblogic\wls
(change above settings according to your installation)
3.- Run configure.cmd

how do I change the location of the httpd.conf for Apache on windows?

I am working on setting up a load balancing cluster on windows server 2012 and have a shared drive where I want the configuration files for Apache to exist at. This way each member of the LB can load the exact same config files. How do I change where the config file is located independently of where the ServerRoot is?
Start the Apache process with the -d parameter and give your alternative ServerRoot as an argument, though I'd imagine it would be a much better idea for you to use some mechanism to sync the files locally to each server.
Also read http://httpd.apache.org/docs/2.4/mod/core.html#mutex, as it's advised if you're running from a networked file system.
If you just want to specify the main config file, start the process with the -f parameter and the path to the config file as an argument.

hadoop 1.1.2 installation on windows

I am trying to install hadoop 1.1.2 on window machine with cygwin.
From on-line videos and tutorials, I have set up all most everything.
Now problem is when i try to create folder with commands
cd /usr/local/hadoop-1.1.2/bin --> this works proper and set proper path then
./hadoop dfs -mkdir input --> when this execute i get error
in error i get issue related to JAVA_HOME path is not set proper also show me text like /Java/jre7/bin/bin/java which looks wrong path.
but i have set JAVA_HOME path properly its here,
I have set same path with /bin in path variable.
I don't know where i have made mistake.
EDIT
full Error
./hadoop: line 320: C:/Java/jre7/bin/bin/java: No such file or directory
./hadoop: line 390: C:/Java/jre7/bin/bin/java: No such file or directory
./hadoop: line 390: exec: C:/Java/jre7/bin/bin/java: cannot execute: No such file or directory
problems with its solution
1. JAVA PATH ISSUE
first is JAVA_PATH issue
Note: Have to use JDK not JRE.
For Hadoop try to use folder name without space
In Environment variable
JAVA_HOME = C:\Java\jdk1.7.0_25
In path variable add below code with othres with ;sepration
%JAVA_HOME%\bin
In hadoop-env.sh file (you can find this file from C:\cygwin\usr\local\hadoop-1.1.2\conf if you are using windows machine).
Note that, remove # from starting of line and USE \\ twice in file
export JAVA_HOME=C:\\Java\\jdk1.7.0_25
if everything OK with JAVA_PATH you can check from CYGWIN consol
try below code to get javaPath which hadoop will use
echo $JAVA_HOME
here you will get java version path
also can set JAVAPATH from runtime,try below code on CYGWIN treminal
export JAVA_HOME=C:/JAVA/Jdk1.7.0_25
2. USER ISSUE
first of all Note that when you start with hadoop installation use same USER for MASTER and SALVE.
If you have different user then have to generate one extra file with name config(without extension)
if your MASTER's machine name is jubin-pc and username is jubinp and SLAVES machine name is trainees11 and username is trainees(have to do vice-verse for both)
config file(for MASTER) Location C:\cygwin\home\jubinp\.ssh\
Host trainees11
User trainees
config file(for SLAVE) Location C:\cygwin\home\trainees\.ssh\
Host jubin-pc
User jubinp
Solution for hadoop-2.6.0 and early:
Be sure that path to JDK does not contain backspaces.
(my variant C:\Java\jdk1.8.0_25)
Add JAVA_HOME to path
My Computer -> Properties -> Advanced -> Environment Variables -> Create
JAVA_HOME
C:\Java\jdk1.8.0_25
Add ;%JAVA_HOME%\bin to system Path
Open hadoop-env.sh (It located in C:\hadoop-2.6.0\etc\hadoop for my hadoop-2.6.0)
and add line export JAVA_HOME=C:/Java/Jdk1.8.0_25
Quit Cygwin.
Your path to the bin folder of JAVA contains is in another folder named bin ? I don't think so.
Install a JDK (not a JRE) properly in a Path with no blanks. For example : C:\jdk1.7.0_21
In Windows :
Add an environnement variable JAVA_HOME to C:\jdk1.7.0_21
Then, add the JAVA_HOME/bin to your PATH.
Edit hadoop/conf/hadoop-env.sh : Uncomment the JAVA_HOME Export. For my example :
export JAVA_HOME=/cygdrive/c/jdk1.7.0_21/

Resources