DevOps(7)Spark Deployment on VM with Kafka

DevOps(7)Spark Deployment on VM with Kafka
 
1. Install the zookeeper
 
> sudo ln -s /home/carl/tool/zookeeper-3.4.6 /opt/zookeeper-3.4.6
> sudo ln -s /opt/zookeeper-3.4.6 /opt/zookeeper
 
Add it to the path
> cp conf/zoo_sample.cfg conf/zoo.cfg
 
Start the server
> zkServer.sh start zoo.cfg
 
Connect to the server
> zkCli.sh -server localhost:2181
 
Stop the server
 
2. Install kafka
 
Build the source
> ./gradlew -PscalaVersion=2.10.0 releaseTarGz -x signArchives
 
Find the binary file here
> cd core/build/distributions/
 
Place the binary file to working directory and add it to the path.
 
Adjust the config file  vi config/server.properties 
 
Command to start kafka
nohup bin/kafka-server-start.sh config/server-dev2.properties &
 
Install the kafka monitor
 
Build and generate the assembly jar 
> sbt clean update
> sbt assembly
 
Similar command to start that
> java -cp /opt/kafka-monitor/lib/*.jar com.quantifind.kafka.offsetapp.OffsetGetterWeb --zk ubuntu-dev1,ubuntu-dev2 --port8082--refresh 10.seconds --retain 2.days
 
Tip:
Some Mysql Timezone Config
> mysql_tzinfo_to_sql /usr/share/zoneinfo/ | mysql -u root -p mysql
 
Or
 
mysql_tzinfo_to_sql /usr/share/zoneinfo/ > mysql.sql
 
Fix the too long string manually
> cat mysql.sql | mysql -u root -p mysql
 
3. Install rabbitMQ
http://sillycat.iteye.com/admin/blogs/2183555
http://sillycat.iteye.com/blog/1565771
 
Install erlang from source
>sudo apt-get install build-essential libncurses5-dev openssl libssl-dev fop xsltproc unixodbc-dev
 
 
Install rabbitmq from source
 
Command to start rabbitmq
>sudo RABBITMQ_NODE_PORT=5672 RABBITMQ_SERVER_START_ARGS="-rabbitmq_management listener [{port,15672}]" RABBITMQ_NODENAME=rabbit1 sbin/rabbitmq-server -detached
 
When I use guest/guest to login, I get this error message:
=ERROR REPORT==== 5-Feb-2015::13:14:08 ===
webmachine error: path="/api/whoami"
"Unauthorized"
 
Solution:
That is a new feature, I need to solve it like this
 
Creating User, set group, set permission
> rabbitmqctl -n rabbit1 add_user sillycat xxxxx
> rabbitmqctl -n rabbit1 set_user_tags sillycat administrator
> rabbitmqctl -n rabbit1 set_permissions -p / sillycat ".*" ".*" ".*"
 
Start the App and Visit the console
cd /opt/rabbitmq
sudo RABBITMQ_NODE_PORT=5672 RABBITMQ_SERVER_START_ARGS="-rabbitmq_management listener [{port,15672}]" RABBITMQ_NODENAME=rabbit2 sbin/rabbitmq-server -detached

enable cluster

sudo sbin/rabbitmqctl -n rabbit2 stop_app
sudo sbin/rabbitmqctl -n rabbit2 join_cluster rabbit1@ubuntu-dev1
sudo sbin/rabbitmqctl -n rabbit2 start_app

visit page
 
References:
http://sillycat.iteye.com/blog/2166583
http://sillycat.iteye.com/blog/2167216
 
http://sillycat.iteye.com/blog/2015175
 
http://sillycat.iteye.com/blog/2066116
 
 

相关推荐