- 浏览: 2539141 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Play Raspberry Pi(8)Cassandra in Docker
1 Installation Cassandra
Exception:
Cassandra 3.0 and later require Java 8u40 or later.
Solution:
Install JDK8 with arm version there, I am using 32 bit.
> java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) Client VM (build 25.91-b14, mixed mode)
Exception:
bin/cqlsh localhost 9042
No appropriate python interpreter found.
Solution:
On my master machine on Local MAC OS
>python -V
Python 2.7.10
> java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
Install latest cassandra on my master machine as well.
> wget http://mirror.cc.columbia.edu/pub/software/apache/cassandra/3.7/apache-cassandra-3.7-bin.tar.gz
> sudo ln -s /Users/carl/tool/apache-cassandra-3.7 /opt/cassandra-3.7
> sudo ln -s /opt/cassandra-3.7 /opt/cassandra
> cat ~/.profile
PATH="/opt/cassandra/bin:$PATH"
Exception:
Exception (org.apache.cassandra.exceptions.ConfigurationException) encountered during startup: If rpc_address is set to a wildcard address (0.0.0.0), then you must set broadcast_rpc_address to a value other than 0.0.0.0
If rpc_address is set to a wildcard address (0.0.0.0), then you must set broadcast_rpc_address to a value other than 0.0.0.0
ERROR 21:30:19 Exception encountered during startup: If rpc_address is set to a wildcard address (0.0.0.0), then you must set broadcast_rpc_address to a value other than 0.0.0.0
ERROR 22:15:18 Exception encountered during startup
java.lang.RuntimeException: Unable to gossip with any seeds
at org.apache.cassandra.gms.Gossiper.doShadowRound(Gossiper.java:1386) ~[apache-cassandra-3.7.jar:3.7]
at org.apache.cassandra.service.StorageService.checkForEndpointCollision(StorageService.java:561) ~[apache-cassandra-3.7.jar:3.7]
Solution:
I have an IP for docker container, one IP for the master machine. So the final configuration will be as follow:
Dockerfile
cat Dockerfile
#Set up Cassandra in Docker
#Prepre the OS
FROM resin/rpi-raspbian:jessie
MAINTAINER Carl Luo <luohuazju@gmail.com>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update
RUN apt-get -y dist-upgrade
#prepare env
RUN mkdir /tool/
ADD install/jdk-8u91-linux-arm32-vfp-hflt.tar.gz /tool/
RUN update-alternatives --install /usr/bin/java java /tool/jdk1.8.0_91/bin/java 1
#Install the application
WORKDIR /tool/
ADD install/apache-cassandra-3.7-bin.tar.gz /tool/
RUN mkdir /tool/apache-cassandra-3.7/logs
RUN mkdir /tool/apache-cassandra-3.7/data
ADD conf/cassandra.yaml /tool/apache-cassandra-3.7/conf/
#Start the Application
# 7000: intra-node communication
# 7001: TLS intra-node communication
# 7199: JMX
# 9042: CQL
# 9160: thrift service
EXPOSE 7000 7001 7199 9042 9160
RUN mkdir -p /app/
ADD start.sh /app/
WORKDIR /app
CMD [ "./start.sh" ]
Makefile
cat Makefile
IMAGE=sillycat/public
TAG=raspberrypi-cassandra
NAME=raspberrypi-cassandra
prepare:
wget http://apache.claz.org/cassandra/3.7/apache-cassandra-3.7-bin.tar.gz -P install/
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-arm32-vfp-hflt.tar.gz" -P install/
mkdir logs
mkdir data
docker-context:
build: docker-context
# docker build --no-cache -t $(IMAGE):$(TAG) .
docker build -t $(IMAGE):$(TAG) .
run:
docker run -d -p 7000-7001:7000-7001 -p 7199:7199 -p 9042:9042 -p 9160:9160 -v /opt/cassandra/data:/tool/apache-cassandra-3.7/data -v /opt/cassandra/logs:/tool/apache-cassandra-3.7/logs --name $(NAME) $(IMAGE):$(TAG)
debug:
docker run -ti -p 7000-7001:7000-7001 -p 7199:7199 -p 9042:9042 -p 9160:9160 -v /opt/cassandra/data:/tool/apache-cassandra-3.7/data -v /opt/cassandra/logs:/tool/apache-cassandra-3.7/logs --name $(NAME) $(IMAGE):$(TAG) /bin/bash
clean:
docker stop ${NAME}
docker rm ${NAME}
logs:
docker logs ${NAME}
publish:
docker push ${IMAGE}:${TAG}
fetch:
docker pull ${IMAGE}:${TAG}
Some important part in cassandra.yaml
> cat conf/cassandra.yaml
seed_provider:
# Addresses of hosts that are deemed contact points.
# Cassandra nodes use this list of hosts to find each other and learn
# the topology of the ring. You must change this if you are running
# multiple nodes!
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
# seeds is actually a comma-delimited list of addresses.
# Ex: "<ip1>,<ip2>,<ip3>"
- seeds: "192.168.0.198"
listen_address: 172.17.0.3
broadcast_address: 192.168.0.198
rpc_address: 0.0.0.0
broadcast_rpc_address: 192.168.0.198
> cat start.sh
#!/bin/sh -ex
#start the cassandra
/tool/apache-cassandra-3.7/bin/cassandra -Dcassandra.config=file:///tool/apache-cassandra-3.7/conf/cassandra.yaml -R
It works
> cqlsh 192.168.0.198 9042
> cqlsh raspberrypi1 9042
one way to pass the parameters is -e in the command line in Makefile, then in start.sh, we can write the value to YAML file before we start the cassandra DB
>sed -ri 's/(- seeds:).*/\1 "'"$CASSANDRA_SEEDS"'"/' "$CASSANDRA_CONFIG/cassandra.yaml"
Issues with the disk, I guess there is some issues with that because of I am using an external USB driver.
ERROR 18:03:18 Fatal exception during initialization
org.apache.cassandra.exceptions.ConfigurationException: Found system keyspace files, but they couldn't be loaded!
at org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:921) ~[apache-cassandra-3.7.jar:3.7]
at org.apache.cassandra.service.StartupChecks$9.execute(StartupChecks.java:325) ~[apache-cassandra-3.7.jar:3.7]
Finally, found that it may not be a good choice for me, because I want to store the data in USB driver. My main storage on raspberryPI is 8G sd card. I do not want to store my data on SD card.
It may relate to this one
http://www.tuxera.com/community/open-source-ntfs-3g/
Some other DB options
http://www.raspberrypiblog.com/2012/11/getting-started-with-databases-on-pi.html Sqlite3
https://github.com/orientechnologies/orientdb orientDB
References:
Cassandra 1 ~ 8
http://sillycat.iteye.com/blog/1870661 v1.2.4 installation and client check
http://sillycat.iteye.com/blog/2011524 source installation and hector java driver
http://sillycat.iteye.com/blog/2011525 hector scala implementation
http://sillycat.iteye.com/blog/2011526 kryo, convert Objects to bytes, bytes to Object
http://sillycat.iteye.com/blog/2011991 v2.0.4 Csql and datastax driver, example easycassandraserver
http://sillycat.iteye.com/blog/2011992 multinode Cluster, ccm
http://sillycat.iteye.com/blog/2213029
http://sillycat.iteye.com/blog/2170328 v2.1.2 and OpsCenter 5.0.2
http://sillycat.iteye.com/blog/2213025 cassandra sync issues
docker
https://hub.docker.com/_/cassandra/
https://github.com/docker-library/cassandra
cassandra client
https://docs.datastax.com/en/cql/3.1/cql/cql_using/start_cql_linux_t.html
https://docs.datastax.com/en/cassandra/3.x/cassandra/tools/toolsCUtility.html
http://stackoverflow.com/questions/29121904/cassandra-cqlsh-connection-refused
http://stackoverflow.com/questions/26892330/cassandra-datastax-enterprise-using-amazon-elastic-ip
https://github.com/docker-library/docs/tree/master/cassandra
1 Installation Cassandra
Exception:
Cassandra 3.0 and later require Java 8u40 or later.
Solution:
Install JDK8 with arm version there, I am using 32 bit.
> java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) Client VM (build 25.91-b14, mixed mode)
Exception:
bin/cqlsh localhost 9042
No appropriate python interpreter found.
Solution:
On my master machine on Local MAC OS
>python -V
Python 2.7.10
> java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
Install latest cassandra on my master machine as well.
> wget http://mirror.cc.columbia.edu/pub/software/apache/cassandra/3.7/apache-cassandra-3.7-bin.tar.gz
> sudo ln -s /Users/carl/tool/apache-cassandra-3.7 /opt/cassandra-3.7
> sudo ln -s /opt/cassandra-3.7 /opt/cassandra
> cat ~/.profile
PATH="/opt/cassandra/bin:$PATH"
Exception:
Exception (org.apache.cassandra.exceptions.ConfigurationException) encountered during startup: If rpc_address is set to a wildcard address (0.0.0.0), then you must set broadcast_rpc_address to a value other than 0.0.0.0
If rpc_address is set to a wildcard address (0.0.0.0), then you must set broadcast_rpc_address to a value other than 0.0.0.0
ERROR 21:30:19 Exception encountered during startup: If rpc_address is set to a wildcard address (0.0.0.0), then you must set broadcast_rpc_address to a value other than 0.0.0.0
ERROR 22:15:18 Exception encountered during startup
java.lang.RuntimeException: Unable to gossip with any seeds
at org.apache.cassandra.gms.Gossiper.doShadowRound(Gossiper.java:1386) ~[apache-cassandra-3.7.jar:3.7]
at org.apache.cassandra.service.StorageService.checkForEndpointCollision(StorageService.java:561) ~[apache-cassandra-3.7.jar:3.7]
Solution:
I have an IP for docker container, one IP for the master machine. So the final configuration will be as follow:
Dockerfile
cat Dockerfile
#Set up Cassandra in Docker
#Prepre the OS
FROM resin/rpi-raspbian:jessie
MAINTAINER Carl Luo <luohuazju@gmail.com>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update
RUN apt-get -y dist-upgrade
#prepare env
RUN mkdir /tool/
ADD install/jdk-8u91-linux-arm32-vfp-hflt.tar.gz /tool/
RUN update-alternatives --install /usr/bin/java java /tool/jdk1.8.0_91/bin/java 1
#Install the application
WORKDIR /tool/
ADD install/apache-cassandra-3.7-bin.tar.gz /tool/
RUN mkdir /tool/apache-cassandra-3.7/logs
RUN mkdir /tool/apache-cassandra-3.7/data
ADD conf/cassandra.yaml /tool/apache-cassandra-3.7/conf/
#Start the Application
# 7000: intra-node communication
# 7001: TLS intra-node communication
# 7199: JMX
# 9042: CQL
# 9160: thrift service
EXPOSE 7000 7001 7199 9042 9160
RUN mkdir -p /app/
ADD start.sh /app/
WORKDIR /app
CMD [ "./start.sh" ]
Makefile
cat Makefile
IMAGE=sillycat/public
TAG=raspberrypi-cassandra
NAME=raspberrypi-cassandra
prepare:
wget http://apache.claz.org/cassandra/3.7/apache-cassandra-3.7-bin.tar.gz -P install/
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-arm32-vfp-hflt.tar.gz" -P install/
mkdir logs
mkdir data
docker-context:
build: docker-context
# docker build --no-cache -t $(IMAGE):$(TAG) .
docker build -t $(IMAGE):$(TAG) .
run:
docker run -d -p 7000-7001:7000-7001 -p 7199:7199 -p 9042:9042 -p 9160:9160 -v /opt/cassandra/data:/tool/apache-cassandra-3.7/data -v /opt/cassandra/logs:/tool/apache-cassandra-3.7/logs --name $(NAME) $(IMAGE):$(TAG)
debug:
docker run -ti -p 7000-7001:7000-7001 -p 7199:7199 -p 9042:9042 -p 9160:9160 -v /opt/cassandra/data:/tool/apache-cassandra-3.7/data -v /opt/cassandra/logs:/tool/apache-cassandra-3.7/logs --name $(NAME) $(IMAGE):$(TAG) /bin/bash
clean:
docker stop ${NAME}
docker rm ${NAME}
logs:
docker logs ${NAME}
publish:
docker push ${IMAGE}:${TAG}
fetch:
docker pull ${IMAGE}:${TAG}
Some important part in cassandra.yaml
> cat conf/cassandra.yaml
seed_provider:
# Addresses of hosts that are deemed contact points.
# Cassandra nodes use this list of hosts to find each other and learn
# the topology of the ring. You must change this if you are running
# multiple nodes!
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
# seeds is actually a comma-delimited list of addresses.
# Ex: "<ip1>,<ip2>,<ip3>"
- seeds: "192.168.0.198"
listen_address: 172.17.0.3
broadcast_address: 192.168.0.198
rpc_address: 0.0.0.0
broadcast_rpc_address: 192.168.0.198
> cat start.sh
#!/bin/sh -ex
#start the cassandra
/tool/apache-cassandra-3.7/bin/cassandra -Dcassandra.config=file:///tool/apache-cassandra-3.7/conf/cassandra.yaml -R
It works
> cqlsh 192.168.0.198 9042
> cqlsh raspberrypi1 9042
one way to pass the parameters is -e in the command line in Makefile, then in start.sh, we can write the value to YAML file before we start the cassandra DB
>sed -ri 's/(- seeds:).*/\1 "'"$CASSANDRA_SEEDS"'"/' "$CASSANDRA_CONFIG/cassandra.yaml"
Issues with the disk, I guess there is some issues with that because of I am using an external USB driver.
ERROR 18:03:18 Fatal exception during initialization
org.apache.cassandra.exceptions.ConfigurationException: Found system keyspace files, but they couldn't be loaded!
at org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:921) ~[apache-cassandra-3.7.jar:3.7]
at org.apache.cassandra.service.StartupChecks$9.execute(StartupChecks.java:325) ~[apache-cassandra-3.7.jar:3.7]
Finally, found that it may not be a good choice for me, because I want to store the data in USB driver. My main storage on raspberryPI is 8G sd card. I do not want to store my data on SD card.
It may relate to this one
http://www.tuxera.com/community/open-source-ntfs-3g/
Some other DB options
http://www.raspberrypiblog.com/2012/11/getting-started-with-databases-on-pi.html Sqlite3
https://github.com/orientechnologies/orientdb orientDB
References:
Cassandra 1 ~ 8
http://sillycat.iteye.com/blog/1870661 v1.2.4 installation and client check
http://sillycat.iteye.com/blog/2011524 source installation and hector java driver
http://sillycat.iteye.com/blog/2011525 hector scala implementation
http://sillycat.iteye.com/blog/2011526 kryo, convert Objects to bytes, bytes to Object
http://sillycat.iteye.com/blog/2011991 v2.0.4 Csql and datastax driver, example easycassandraserver
http://sillycat.iteye.com/blog/2011992 multinode Cluster, ccm
http://sillycat.iteye.com/blog/2213029
http://sillycat.iteye.com/blog/2170328 v2.1.2 and OpsCenter 5.0.2
http://sillycat.iteye.com/blog/2213025 cassandra sync issues
docker
https://hub.docker.com/_/cassandra/
https://github.com/docker-library/cassandra
cassandra client
https://docs.datastax.com/en/cql/3.1/cql/cql_using/start_cql_linux_t.html
https://docs.datastax.com/en/cassandra/3.x/cassandra/tools/toolsCUtility.html
http://stackoverflow.com/questions/29121904/cassandra-cqlsh-connection-refused
http://stackoverflow.com/questions/26892330/cassandra-datastax-enterprise-using-amazon-elastic-ip
https://github.com/docker-library/docs/tree/master/cassandra
发表评论
-
Update Site will come soon
2021-06-02 04:10 1672I am still keep notes my tech n ... -
Stop Update Here
2020-04-28 09:00 310I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 465NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 361Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 362Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 328Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 419Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 428Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 364Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 444VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 376Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 462NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 413Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 330Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 242GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 443GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 320GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 306Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 310Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 284Serverless with NodeJS and Tenc ...
相关推荐
In our opinion, you will certainly adore the Raspberry Pi 4. Ultra-small, affordable, even cheaper than most video games, you can use the Pi to build robots, learn coding and create all sorts of...
In his spare time, he is an Internet of Things enthusiast and has spoken on the wonders of the Raspberry Pi at conferences and user groups. He loves his Raspberry Pis. He has also built his own 3D ...
《Wiley Learning Python with Raspberry Pi 2014》是一本专为初学者设计的教程,旨在引导读者通过树莓派这一小型计算机平台学习Python编程。这本书由2014年出版,当时Python已是编程界的热门语言,而树莓派因其低...
rpi-hubot-docker-template Raspberry Pi上的Hubot Docker容器模板如何在Raspberry Pi上使用Docker 上安装。 请参阅以设置环境。用法克隆此仓库 $ git clone https://github.com/knjcode/rpi-hubot-docker-template$...
《Raspberry Pi探险记(第三版)》是由Carrie Anne Philbin撰写,首次出版于2017年,并由John Wiley & Sons, Inc.出版。这本书旨在向读者介绍Raspberry Pi——一种由Raspberry Pi基金会推出的低成本、信用卡大小的...
《Raspberry Pi快速入门指南》是一本面向初学者的实用手册,由Maik Schmidt撰写,国内译者王峰、王江伟、王汝波共同翻译。该书为读者详细介绍了Raspberry Pi这一款迷你Linux计算机的使用方法,并指导用户如何通过...
Blinking LED is a popular ... a digital clock, a traffic light controller, a remote light controller, and an LED-based Internet of Things, so you get more practice in the art of Raspberry Pi development.
Raspberry Pi Zero is half the size of Raspberry Pi A, only with twice the utility. At just three centimeters wide, it packs in every utility required for full-fledged computing tasks. This practical ...
raspberrypi-rstudio:用于Raspberry Pi的RStudio-Docker构建和运行时环境
The world of Raspberry Pi is evolving quickly, with many new interface boards and software libraries becoming available all the time. In this cookbook, prolific hacker and author Simon Monk provides ...
Any experience in using the Raspberry Pi would be an added advantage. In Detail Revolutionize the way you interact with your home and become part of the rapidly growing group of hobbyists and ...
In this book, we explore Raspberry Pi 2's hardware through a number of projects in a variety of programming languages. We will start by exploring the various hardware components in detail, which will ...
### 基于Raspberry Pi实现的智能家居 #### 1.1 课题背景与意义 随着信息技术的发展,智能家居成为越来越多人关注的焦点。本课题旨在探索利用Raspberry Pi这一低成本且功能强大的微型计算机来实现智能家居控制系统...
在Linux世界中,Raspberry Pi是一款非常受欢迎的微型计算机,常用于各种DIY项目和教育用途。Chromium OS,作为Google Chrome OS的基础源代码,是一个轻量级的操作系统,主要设计用于快速启动和运行网络应用。本文将...
docker-arm_20.10.6 资源
CHAPTER 1: INTRODUCTION TO RASPBERRY PI THE EVOLUTION OF RASPBERRY PI 2 THE UNIQUE FEATURES: MODEL A MODEL A+ MODEL B MODEL B+ SHOULD YOU BUY THE LATEST RASPBERRY PI 2, IF YOU HAVE PREVIOUS MODELS? ...