Ambari plugin development - ambari

I would like to develop Ambari plugin for deploying some services (something like this https://github.com/tzolov/elasticsearch-yarn-ambari-plugin).
I would like to ask for good practices for developing/debugging.
Currently we do delete and copy new files to AMBARI_SERVER_SERVICE_PATH/services/ and then ambari-agent stop && ambari-server stop && ambari-server reset --silent && ambari-server start && ambari-agent start and I don't feel it like nice solution.
Do you have any good tips, recommendations, links?

The proper term is Ambari Custom Service and not plugin.
The following sequence is the best approach I've found so far in developing custom services. Lets say you're developing custom service 'FOO'.
1) Extract your foo service to the stack you're developing for. For this eg. I will assume HDP 2.4:
tar -xzvf foo_service.tgz -C /var/lib/ambari-server/resources/stacks/HDP/2.4/services/FOO
2) Restart ambari-server to pick up the stack changes
sudo ambari-server restart
3) Use the Ambari UI service install wizard to install your custom service.
4) Do your testing and debugging, make any changes to your custom service descriptor files.
5) Stop your service and all of its components using the Ambari UI.
6) Uninstall your service from Ambari using something similar to the remove-service.sh script below.
7) Re-install your modified service, starting at step 1. Rinse and Repeat.
remove-service.sh:
#!/usr/bin/env bash
host=localhost
cluster=hdp
port=8080
user=admin
password='admin'
echo "Deleting the FOO service..."
curl -i -H "X-Requested-By: ambari" -u $user:$password -X DELETE http://$host:$port/api/v1/clusters/$cluster/services/FOO
NOTE: Sometimes this approach will not work if you're custom service fails to install correctly. In that scenario you sometimes have to make corrections to your descriptor files, restart ambari-server, and then use the ambari rest API to re-install your service. Using the service install wizard to re-install will not work in this scenario. See the ambari wiki for more details on how to use the rest api to re-install the service.
A lot of useful information can be found on developing custom ambari services and the ambari rest api on the Ambari Wiki.

Related

Building Docker images with GitLab CI/CD on existing git-runner

I have to build and push docker image via gitlab-ci. I have gone through the official document.
https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
I want to adopt shell method but my issue is I already had a working gitrunner on my server machine. So what the procedure for it. If I tried to re-register the git runner on the same machine. will it impact the old one?
Thanks in advance.
Assuming that you installed gitlab-runner as a system service and not inside a container, you can easily register another shell runner on your server using the command gitlab-ci-multi-runner register.
This is indirectly confirmed by the advanced configuration documentation, which states that the config.toml of the gitlab-runner service may contain multiple [[runner]] sections.
Note: To allow the shell runner to build docker images, you will need to add the gitlab-runner user to the docker group, e.g.:
sudo gpasswd --add gitlab-runner docker

RabbitMQ setUp Issue In windows

I am beginner to RabbitMQ. For the first time I am trying to configure RabbitMQ in my windows machine.I followed the steps given on official site www.rabbitmq.com/install-windows-manual.html.But the problem I am facing is when I run "services.msc" command, I am not able to see RABBITMQ_SERVICENAME .
What could be the issue?
Shivangi,
When you say "I am not able to see RABBITMQ_SERVICENAME", does it mean you don't see the RabbitMQ service in the list of services ?
What I usually do when RabbitMQ service fails to install correctly, I use the rabbitmq-service script located in the "sbin" installation folder and run the 2 following commands in a command prompt:
rabbitmq-service remove
rabbitmq-service install

Getting Chef to install, configure and run RabbitMQ

I am trying to get a simple, single instance of RabbitMQ running via this RabbitMQ-chef recipe. Essentially, I have an Ubuntu machine, and I’d like Chef to take care of all the heavy lifting necessary to install, configure and get RabbitMQ running on it.
The documentation isn’t really written for beginners, but I went ahead and started by downloading the cookook:
knife cookbook site download rabbitmq
WARNING: No knife configuration file found
Downloading rabbitmq from the cookbooks site at version 4.1.2 to /Users/myuser/sandbox/chef/0.6.2/rabbitmq-4.1.2.tar.gz
Cookbook saved: /Users/myuser/sandbox/chef/0.6.2/rabbitmq-4.1.2.tar.gz
However now I’m at a complete loss as to what I need to script/configure in order to add this cookbook to my Chef server, such that when I SSH onto my target Ubuntu machine, I can bootstrap that machine with Chef and then run something to turn the Ubuntu machine into a RabbitMQ server. Any ideas?

how to update elastix openfire to 3.8.2 version

I have install Elastix 2.4.0 and i want to update openfire version to 3.8.2. First i just download the rmp and make the update
rpm -Uvf
it works but nothing appear in elastix administration.
Somebody can help me?
To update Openfire you must download rpm package and run following command:
rpm -Uvf openfire-3.9.3-1.i386.rpm
After update up to 3.9.3 sometimes(on 64bit systems) you need install mo libraries to start java.
Try it with the following command:
yum install glibc.i686
After that start openfire service from elastix web panel.
You are dear Alexey,
a simple way is to login webshell as root, then type:
# wget http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire-3.9.3-1.i386.rpm
# rpm -Uvf openfire-3.9.3-1.i386.rpm
if you use a 64bits system, please Java will need some additional libreries, install them by typing
# yum install glibc.i686
# reboot
After reboot your Elastix Flavour, start openfire service from elastix web panel, this may redirect your web link to http://yourip.address:9090
replace this IP by yours.
in that case, logout from Elastix GUI and login again..
Then Find your Openfire Server web GUI into Elastix Web configurator.
Happy hacking
CokoTracy

Apache Web Development on Cygwin

I'm trying to get an Apache server running on my Cygwin setup to follow the Java Ranch Cattle Drive tutorials online (basically, to learn Java EE web page development that uses a MySQL back end.)
I used the Cygwin Setup program to install httpd (which is how I installed most other dev tools I use on cygwin) and it says install complete, yet when I run 'httpd' it cannot find the command. It also appears the expected install directory (/usr/local/apache...) doesn't exist.
Does anyone have any experience using this setup, and if so, you could walk me through the initial steps of getting the server up and running and getting a browser to display the server's default page?
To keep answers focused, I didn't want to discus the drawbacks of running Apache on a Windows system - this is just for learning purposes. Thanks in advance.
Looking at the Cygwin Package Listing for httpd, you can see that the executable is installed under /usr/sbin.
So, if /usr/sbin is not on your PATH (it isn't on mine, not by default anyhow), you would actually run:
/usr/sbin/httpd
And btw, if you would like to list the files installed for a certain package, you can use cygcheck:
cygcheck -l httpd
cygrunsrv -I Apache -p /usr/sbin/httpd -a "-X"
This will solve the problem. This assumes you already have cyrunsrv set up. The reason httpd fails with cygrunsrv if you leave out the -X is that the process disconnects from the terminal and cygrunsrv considers that a failure. The -X option for httpd is the debug or terminal mode.
I couldn't find any detailed information on how to get Apache working on Cygwin, so here it is if someone's interested:
Install the httpd-* and httpd-mod_* packages you need. Note that the packages named "Apache" are deprecated. You need the ones named "httpd" (which are actually Apache).
Install cygrunsrv (normally this is a default Cygwin package)
Run /usr/bin/cygserver-config as admin. This is needed because Apache requires an IPC server running.
Open services.msc, then go to the CYGWIN Cygserver. Right-click on it and start it. If you don't do this, you'll probably get errors like "AH00023: Couldn't create the proxy mutex".
Finally, start Apache by running /usr/sbin/apachectl restart
Config is in /etc/httpd/.
Some information about running Apache on Cygwin:
http://httpd.apache.org/docs/1.3/cygwin.html
http://www.issociate.de/board/goto/895433/apache2_does_not_start_in_cygwin.html
http://www.cygwin.com/ml/cygwin-apps/2005-02/msg00085.html
Personally, I would recommend installing WAMPServer or other WAMP stack and do it that way. There is no difference, except that you'll need to control Apache through Windows commands [net start, net stop], not Cygwin's ones.