设为首页 收藏本站
查看: 1416|回复: 0

[经验分享] DevOps(7)Spark Deployment on VM with Kafka

[复制链接]

尚未签到

发表于 2017-5-23 18:24:17 | 显示全部楼层 |阅读模式
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
> git clone https://github.com/quantifind/KafkaOffsetMonitor.git
 
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
 
http://www.erlang.org/download/otp_src_17.4.tar.gz
 
Install rabbitmq from source
http://www.rabbitmq.com/releases/rabbitmq-server/v3.4.3/rabbitmq-server-generic-unix-3.4.3.tar.gz
 
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
http://stackoverflow.com/questions/22850546/cant-access-rabbitmq-web-management-interface-after-fresh-install
 
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

http://ubuntu-dev2:15672
 
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
 
 

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-379974-1-1.html 上篇帖子: linkedin高吞吐量分布式消息系统kafka使用手记 下篇帖子: kafka_2.9.2-0.8.1.1分布式集群搭建
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表