ubuntu安装zookeeper和ruby
安装zookeeper服务
- 下载zookeeper包
- wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.12/zookeeper-3.4.12.tar.gz
- 解压拷贝进/usr/local下
- sudo cp zoo_sample.cfg zoo.cfg
- 修改zoo.cfg配置
- 在/var/lib/zookeeper建myid文件。在myid文件中输入1表示为server.1。 输入2则表示server.2
- 在/usr/local/ zookeeper-3.4.12/bin下,最好是整个zookeeper目录赋777权限,在bin目录下./zkServer.sh start|stop|restart,启动、停止、重启等命令
- 启动后,在bin目录下./zkCli.sh进入zookeeper客户端,进入后,输入ls,或者新建create /NewCrawlerTest crawlertest,或者删除delete /NewCrawlerTest或者查看 get /NewCrawlerTest
- 退出zookeeper客户端用quit命令
安装ruby:
- Sudo apt-get install ruby ruby-dev
- 查看版本号:ruby –v; gem –v
**Bundler** — If Ruby is already installed, but the `bundle` command doesn't work, just run `gem install bundler`
3.sudo gem install bundler
4.
出现如上图错误:安装bundler,执行bundle install –deployment
5.执行build代码bundle exec middleman build –clean,出现如下图错误
解决:安装nodejs即可,安装后查看node -v:
5.1 sudo apt-get install nodejs
5.2 sudo apt-get install nodejs-legacy