Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Sunday, November 17, 2019

Docker Compose Getting Started with JAVA RocketMQ


Motivation

Just want to try Docker Compose...

Prerequisites

Install Docker Compose on Ubuntu 18.04
https://ben-bai.blogspot.com/2019/11/install-docker-compose-on-ubuntu-1804.html

JAVA JMS: RocketMQ NameServer Broker Cluster
https://ben-bai.blogspot.com/2019/10/java-jms-rocketmq-nameserver-broker.html


Simple Note

Go to Dockerfile folder,

Add the docker-compose.yml below into it
https://github.com/benbai123/JSP_Servlet_Practice/blob/master/Practice/JAVA/JMS/RocketMQ/RocketMQCluster/docker-compose.yml

then run docker-compose up

Docker Compose will build image and run container with specified config value

Testing Video
https://youtu.be/QHQEacrtU9k

Shortly,

Dockerfile define "how to create the container"

docker-compose.yml describe "how to config/run containers"


References

Get started with Docker Compose
https://docs.docker.com/compose/gettingstarted/

Compose file version 3 reference
https://docs.docker.com/compose/compose-file/

Thursday, November 14, 2019

Install Docker Compose on Ubuntu 18.04


Simple Note

Just several lines of commands

# Run this command to download the current stable release of Docker Compose
# To install a different version of Compose, substitute 1.24.1 with the version of Compose you want to use.
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

# Apply executable permissions to the binary:
sudo chmod +x /usr/local/bin/docker-compose

# Test the installation.
docker-compose --version

# done


Reference

Install Docker Compose

Monday, October 7, 2019

Install Docker on Ubuntu 18.04


Motivation

I want to try RocketMQ Cluster with Multi-NameServers/Brokers, but it seems change port of NameServer is not supported...

So want to run 2 NameServers in 2 Docker Containers and bind to different ports for testing.

Simple Note

Install Docker on Ubuntu 18.04 running in VirtualBox

# Uninstall old versions
sudo apt-get remove docker docker-engine docker.io containerd runc

# SET UP THE REPOSITORY
## Update the apt package index
sudo apt-get update

## Install packages to allow apt to use a repository over HTTPS
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

## Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

## Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.
sudo apt-key fingerprint 0EBFCD88

## Use the following command to set up the stable repository
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"


# INSTALL DOCKER ENGINE - COMMUNITY
## Update the apt package index.
sudo apt-get update

## Install the latest version of Docker Engine - Community and containerd, or go to the next step to install a specific version:
sudo apt-get install docker-ce docker-ce-cli containerd.io

## Verify that Docker Engine - Community is installed correctly by running the hello-world image.
sudo docker run hello-world




Reference

Get Docker Engine - Community for Ubuntu

RocketMQ not support modify nameServer port

Monday, March 14, 2016

Install Spark 1.6.0 on Ubuntu 14.04


Environment:

Ubuntu 14.04 installed in VirtualBox

Steps:

1. Install JDK 8

###
# install oracle jdk 8
###
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get -y update
sudo apt-get -y install oracle-java8-installer

# find out the path of your Java installation:
sudo update-alternatives --config java

# for me it returns
# There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-oracle/jre/bin/java

# edit /etc/environment
sudo gedit /etc/environment

# add this line into it, save and close
# JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre/bin/java"
#
# then reload /etc/environment
source /etc/environment


2. Install scala 2.10

download scala 2.10.6 from http://www.scala-lang.org/download/2.10.6.html

extract it somewhere (I extract it to ~/Things/scala/scala-2.10.6)

again edit /etc/environment

add SCALA_HOME and PATH

after this the /etc/environment as below

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/benbai/Things/scala/scala-2.10.6/bin"
JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre/bin/java"
SCALA_HOME="/home/benbai/Things/scala/scala-2.10.6"


reload /etc/environment and check scala

source /etc/environment
scala -version
# for me it returns
# Scala code runner version 2.10.6 -- Copyright 2002-2013, LAMP/EPFL


3. Get Spark 1.6.0

download spark from http://spark.apache.org/downloads.html

I choose 1.6.0 pre-build for hadoop 2.6 and later

extract it somewhere (I extract it to ~/Things/spark/spark-1.6.0-bin-hadoop2.6)

go to spark directory and test it

cd ~/Things/spark/spark-1.6.0-bin-hadoop2.6
./bin/spark-shell
# then test some command


Testing result:



References:

How To Install Java on Ubuntu with Apt-Get

Scala Download Page

Scala Getting Started

Spark Quick Start