DevOps(7)Spark Deployment on VM with Kafka
DevOps(7)Spark Deployment on VM with Kafka
1. Install the zookeeper
I pick up this version http://apache.mirrors.lucidnetworks.net/zookeeper/stable/zookeeper-3.4.6.tar.gz.
> 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
> zkServer.sh stop
2. Install kafka
I pick up this version http://www.carfab.com/apachesoftware/kafka/0.8.1.1/kafka-0.8.1.1-src.tgz
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"
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
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
相关推荐
Kafka 2020-09-18
yanghuashuiyue 2020-11-14
liuxingen 2020-11-13
wangying 2020-11-13
王谦 2020-11-03
huangwei00 2020-10-14
shenzhenzsw 2020-10-09
guicaizhou 2020-09-30
jiaomrswang 2020-09-23
jyj0 2020-09-21
guicaizhou 2020-09-15
hannuotayouxi 2020-08-20
amwayy 2020-08-03
yangyutong00 2020-08-01
weikaixxxxxx 2020-08-01
PoppyEvan 2020-08-01
guicaizhou 2020-08-01
PoppyEvan 2020-07-29