Mac、Windows安装Aerospike数据库

来源:互联网 发布:mac系统下安装虚拟机 编辑:程序博客网 时间:2024/04/30 12:18

Mac、Windows安装Aerospike数据库

Aerospike数据库是分布式的用于百G、数T等大数据量的数据库,所以在生产环境中肯定是部署在集群里的,目前大部分企业级应用都是部署在linux服务器上。这篇文章主要介绍在mac上安装Aerospike数据库,为了没有服务器的小伙伴们搭建一个用于个人学习、测试的环境。

因为我用的mac,所以下面主要介绍mac安装的步骤,Windows上可以用相似的步骤完成部署,但是我没有尝试,有兴趣的同学可以看官方资料:

mac 安装步骤

第一步 安装VAGRANT

Aerospike 支持在mac的Vagrant虚拟环境上安装部署。首先要下载安装vagrant:Vagrant下载地址。
安装完成后可以查看版本:

lihanlin$ vagrant -vVagrant 1.8.6

vagrant必须跑在Oracle VirtualBox或者 VMWare上,如果没有的话需要安装其中的一个,这里我们安装一个VirtualBox。

第二步 创建一个工作目录

创建一个aerospike的目录并进入:

lihanlin$ mkdir aerospike-vmlihanlin$ cd aerospike-vm/

第三步 用vagrant创建一个aerospike虚拟机

lihanlin$ vagrant init aerospike/centos-6.5

第四步 启动虚拟机

lihanlin$ vagrant up

下载可能需要一段时间,注意别让电脑休眠导致断网,否则会出现如下报错:

lihanlin$ vagrant upBringing machine 'default' up with 'virtualbox' provider...==> default: Box 'aerospike/centos-6.5' could not be found. Attempting to find and install...    default: Box Provider: virtualbox    default: Box Version: >= 0==> default: Loading metadata for box 'aerospike/centos-6.5'    default: URL: https://atlas.hashicorp.com/aerospike/centos-6.5==> default: Adding box 'aerospike/centos-6.5' (v3.10.0.3) for provider: virtualbox    default: Downloading: https://atlas.hashicorp.com/aerospike/boxes/centos-6.5/versions/3.10.0.3/providers/virtualbox.box==> default: Box download is resuming from prior download progressAn error occurred while downloading the remote file. The errormessage, if any, is reproduced below. Please fix this error and tryagain.SSL read: error:00000000:lib(0):func(0):reason(0), errno 54

当然咱们国内有可能因为网络原因下载不下来然后报上面的错误,此时可以用如下方法解决(如果没有此问题请跳过)

1. 先把通过log中的地址把virtualbox.box 下载下来。

log中我们可以看到实际就是在下载这个文件,我们通过迅雷或者自己翻墙等方式先把这个box文件下载下来。
https://atlas.hashicorp.com/aerospike/boxes/centos-6.5/versions/3.10.0.3/providers/virtualbox.box

2. 手动安装box文件

vagrant box add {title} {url}
注意如果之前init创建的Vagrantfile文件存在,要把它删除。

lihanlin$ rm Vagrantfile lihanlin$ vagrant box add aerospike/centos-6.5 ./as_centos-6.8-x86_64.box 

3. 安装一个aerospike虚拟机并启动

lihanlin$ vagrant init aerospike/centos-6.5 lihanlin$ vagrant up

第五步 查看Aerospike是否启动成功

通过查看aerospike的状态或者查看服务日志来判断aerospike是否启动成功:

lihanlin$ vagrant ssh -c "sudo service aerospike status"asd (pid 2822) is running...Connection to 127.0.0.1 closed.lihanlin$ vagrant ssh -c "sudo grep -i cake /var/log/aerospike/aerospike.log"Nov 04 2016 10:04:32 GMT: INFO (as): (as.c:512) service ready: soon there will be cake!Connection to 127.0.0.1 closed.

至此就完成了在mac搭建aerospike的任务了!

0 0
原创粉丝点击