Do I have to start Elastic search? - linux

If Elastic Search is always running on port:9200, do I have to start it each time I use it?
I am using Linux, MAC and Windows, in a nut shell I run command "bin/elastic" or another variation based on OS commands and it usually "starts" Elastic Search.
I just want to know why its always running on port:9200 and if I need too start Elastic each time I boot up a Operation System.

you download elasticsearch.zip and unzip it and run with "bin/elasticsearch"
you can download deb (for Debian or Ubuntu Linux) or rpm (for redhat or centos) version and install it as service for example in centos:
sudo wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.0.rpm
sudo rpm -ivh elasticsearch-6.0.0.rpm
sudo systemctl start elasticsearch.service
sudo systemctl enable elasticsearch.service // for running after boot
if you want to change the default port of elastic you must edit the elasticsearch.yml file. you can find this file in the manual running in config/elasticsearch.yml and in installation as service in centos in the /etc/elasticsearch/elasticsearch.yml
you can uncomment this line:
#http.port: 9200
and change port for example:
http.port: 9900

Related

how can i get systemd files to work on wls ubuntu 20.04

I created a service file named pointless.service but when I run
sudo systemctl start pointless it returned
System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down
when I also tried sudo service pointless start
but it returned pointless: unrecognized service.
i am using wsl ubuntu 20.04
the above commands work for installed software like Nginx, Redis e.t.c. but it isn't working for any of my files

How to setup the Rippled server in my local?

Any body Please tell me how to setup the rippled server in my local system and how to call the API's for generating address and doing the transactions with out using the Rippled public server(s1.ripple.com ).
Thanks in advance
Here is simple steps to setup ripple mainnet server in your system
You can also go through the link as below -
https://developers.ripple.com/install-rippled.html
Minimum System Requirements
A rippled server should run comfortably on commodity hardware, to make it inexpensive to participate in the network. At present, we recommend the following minimum requirements:
Operating System:
Production: CentOS or RedHat Enterprise Linux (latest release) or Ubuntu (16.04+) supported
Development: Mac OS X, Windows (64-bit), or most Linux distributions
CPU: 64-bit x86_64, 2+ cores
Disk: Minimum 50GB SSD recommended (1000 IOPS, more is better) for the database partition
RAM:
Testing: 8GB+
Production: 32 GB
Amazon EC2's m3.large VM size may be appropriate depending on your workload. A fast network connection is preferable. Any increase in a server's client-handling load increases resources needs.
Installation on CentOS/Red Hat with yum
This section assumes that you are using CentOS 7 or Red Hat Enterprise Linux 7.
Install the Ripple RPM repository:
$ sudo rpm -Uvh https://mirrors.ripple.com/ripple-repo-el7.rpm
Install the rippled software package:
$ sudo yum install --enablerepo=ripple-stable rippled
Configure the rippled service to start on system boot:
$ sudo systemctl enable rippled.service
Start the rippled service
$ sudo systemctl start rippled.service
Installation on Ubuntu with alien
This section assumes that you are using Ubuntu 15.04 or later.
Install yum-utils and alien:
$ sudo apt-get update
$ sudo apt-get install yum-utils alien
Install the Ripple RPM repository:
$ sudo rpm -Uvh https://mirrors.ripple.com/ripple-repo-el7.rpm
Download the rippled software package:
$ yumdownloader --enablerepo=ripple-stable --releasever=el7 rippled
Verify the signature on the rippled software package:
$ sudo rpm --import https://mirrors.ripple.com/rpm/RPM-GPG-KEY-ripple-release && rpm -K rippled*.rpm
Install the rippled software package:
$ sudo alien -i --scripts rippled*.rpm && rm rippled*.rpm
Configure the rippled service to start on system boot:
$ sudo systemctl enable rippled.service
Start the rippled service
$ sudo systemctl start rippled.service
Postinstall
It can take several minutes for rippled to sync with the rest of the network, during which time it outputs warnings about missing ledgers. After that, you have a fully functional stock rippled server that you can use for local signing and API access to the XRP Ledger.
You can use the rippled commandline interface as follows:
$ /opt/ripple/bin/rippled
Additional Configuration (Must needs to do according your IP)-
rippled should connect to the XRP Ledger with the default configuration. However, you can change your settings by editing the rippled.cfg file (located at /opt/ripple/etc/rippled.cfg when installing rippled with yum). You must change the IP setting with your own entered IP and then connected with this setup server using java script code.
See the rippled GitHub repository for a description of all configuration options.
Changes to the [debug_logfile] or [database_path] sections may require you to give the rippled user and group ownership to your new configured path:
$ chown -R rippled:rippled <configured path>
Restart rippled for any configuration changes to take effect:
$ sudo service rippled restart
For more dig into ripple RPC and command kindly go through below link
https://developers.ripple.com/admin-rippled-methods.html
https://developers.ripple.com/public-rippled-methods.html
Hope this will help..

Linux - Install manually a service at startup - GitBlit server on Synology NAS

I used GitBlit on windows but I purchased a Synology NAS.
http://gitblit.com (An open source "GitHub like" server)
The NAS works with a custom distribution of linux.
I installed the ubuntu version of GitBlit It works great.
But I can't install the GitBlit service. I would like to start the server at startup.
But I try to launch the install-service-ubuntu.sh but there is no update.rc file on this Linux distribution.
#!/bin/bash
sudo cp service-ubuntu.sh /etc/init.d/gitblit
sudo update-rc.d gitblit defaults
So I would like to install the service manually but don't know the Linux system.
Thanks.

How to auto start elasticsearch in Centos 6.5?

I have installed elasticsearh on a server based on Cent OS 6.5. To start it:
# cd /usr/share/elasticsearch/elasticsearch-1.5.2]
# ./bin/elasticsearch &
But when I close the terminal, the process is killed. How can I set it to automatically start as a service?
Try using the "nohup" command with elastic search.
$ nohup ./bin/elasticsearch
Now what the nohup does? In the following example, it starts the program abcd in the background in such a way that the subsequent logout does not stop it.
$ nohup abcd &
$ exit
Hope that helped.
As #DerStoffel said, you have to start elasticsearch as a service (sudo service elasticsearch start). This is highly recommended in production settings. Also add the service to start in case of reboot (sudo /sbin/chkconfig --add elasticsearch)
It depends the distribution of linux you use:
Debian/Ubuntu
sudo update-rc.d elasticsearch defaults 95 10
sudo /etc/init.d/elasticsearch start
https://www.elastic.co/guide/en/elasticsearch/reference/1.6/setup-service.html#_debian_ubuntu
RPM based distributions like Centos
sudo /sbin/chkconfig --add elasticsearch
sudo service elasticsearch start
https://www.elastic.co/guide/en/elasticsearch/reference/1.6/setup-service.html#_rpm_based_distributions
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo /bin/systemctl start elasticsearch.service

How to use pm2 startup command on Debian platform?

Here is the link to the documentation on GitHub:
https://github.com/Unitech/pm2#startup-script-generation--pm2-startup
It is setup to work with Ubuntu/CentOS/Redhat. I need it to work with my Dreamhost VPS which is a Debian machine.
Can someone advise me on how I might tweak the init script to make it work on a Debian box? Thanks!!
If your vps is running the Jessie release (>8) then Jessie uses systemd not init.d (as ubuntu and older releases of debian do). Thus using the default ubuntu pm2 startup script won't work.
So if this is your case then all I did for this to work on my Jessie VM was
$ pm2 startup systemd
then pm2 start the node apps I want to start at bootup.
then
$ pm2 save
then give it a try.
$ shutdown -r now
of course do these from root
more details here.
http://pm2.keymetrics.io/docs/usage/startup/
Try ubuntu solution. Since ubuntu is a debian fork, it should work there.
as the output suggests, you have to execute it as sudo:
sudo pm2 startup ubuntu
You can just add a cronjob like:
#reboot cd /path/to/app && pm2 start app.js
Remember to install the cron in the user that will run the daemon, NOT ROOT.
If you user can't install the cron, just install the cron where you prefer and add the parameter -u to specify the daemon runner user.

Resources