Vagrant
hanpy

搭建学习环境需要的东西,记录一下

安装JDK

1
sudo apt-get install openjdk-8-jdk

软件下载地址

1
2
3
4
5
6
7
8
9
10
11
zookeeper:
https://archive.apache.org/dist/zookeeper/zookeeper-3.5.7/apache-zookeeper-3.5.7-bin.tar.gz

kafka
https://archive.apache.org/dist/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz

-- /home/vagrant/opt/apps/kafka_2.11-0.11.0.0/bin/kafka-server-start.sh*
if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then
#export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"
export KAFKA_HEAP_OPTS="-Xmx1G -Xms256M"
fi

环境变量

1
2
3
4
5
6
7
#ZK_HOME
export ZK_HOME=/home/vagrant/opt/apps/zookeeper-3.5.7
export PATH=$PATH:$ZK_HOME/bin

#KAFKA_HOME
export KAFKA_HOME=/home/vagrant/opt/apps/kafka_2.11-0.11.0.0
export PATH=$PATH:$KAFKA_HOME/bin

vagrant ssh 登录

1
2
3
4
5
6
7
8
9
10
# 修改root密码
sudo passwd

# 修改ssh配置
/etc/ssh/sshd_config
PermitRootLogin yes
PasswordAuthentication yes

# 重启sshd服务
service sshd restart

vagrant大概配置

1
2
3
4
5
6
7
8
9
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.hostname = "Study-01"
config.vm.network "private_network", ip: "10.0.0.10"
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.name = "Study-01"
end
end