Docker创建HBase和phoenix容器
一、把镜像导入Docker
docker load < phoenix.tar.gz
二、创建容器
docker run --restart=always -it -d -p 2181:2181 -p 8765:8765 -p 15165:15165 \ -p 16000:16000 -p 16010:16010 -p 16020:16020 \ -v /Users/gavin/Documents/docker/hbase/data:/tmp/hbase-root/hbase/data \ --name phoenix \ boostport/hbase-phoenix-all-in-one:2.0-5.0
三、进入hbase
docker exec -it phoenix bash export HBASE_CONF_DIR=/opt/hbase/conf/ /opt/phoenix-server/bin/sqlline.py localhost //进入后可直接通过SQL来操作数据库 UPSERT INTO HOSPITAL.DOCTOR("id", "status") VALUES(1,1); DELETE from HOSPITAL.DOCTOR Where "id"=22;