mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Merge pull request #1119 from bigchaindb/docs/1077/recommend-ubuntu-16.04-for-now
Recommend Ubuntu 16.04 for now
This commit is contained in:
commit
0600483a90
@ -7,7 +7,7 @@ pip -V
|
||||
|
||||
If it says that `pip` isn't installed, or it says `pip` is associated with a Python version less than 3.4, then you must install a `pip` version associated with Python 3.4+. In the following instructions, we call it `pip3` but you may be able to use `pip` if that refers to the same thing. See [the `pip` installation instructions](https://pip.pypa.io/en/stable/installing/).
|
||||
|
||||
On Ubuntu 14.04, we found that this works:
|
||||
On Ubuntu 16.04, we found that this works:
|
||||
```text
|
||||
sudo apt-get install python3-pip
|
||||
```
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
BigchainDB Server has some OS-level dependencies that must be installed.
|
||||
|
||||
On Ubuntu 14.04 and 16.04, we found that the following was enough:
|
||||
On Ubuntu 16.04, we found that the following was enough:
|
||||
```text
|
||||
sudo apt-get update
|
||||
sudo apt-get install g++ python3-dev libffi-dev
|
||||
```
|
||||
|
||||
On Fedora 23 and 24, we found that the following was enough:
|
||||
On Fedora 23–25, we found that the following was enough:
|
||||
```text
|
||||
sudo dnf update
|
||||
sudo dnf install gcc-c++ redhat-rpm-config python3-devel libffi-devel
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Installing BigchainDB on LXC containers using LXD
|
||||
|
||||
**Note: This page was contributed by an external contributor and is not actively maintained. We include it in case someone is interested.**
|
||||
|
||||
You can visit this link to install LXD (instructions here): [LXD Install](https://linuxcontainers.org/lxd/getting-started-cli/)
|
||||
|
||||
(assumption is that you are using Ubuntu 14.04 for host/container)
|
||||
|
@ -23,9 +23,9 @@ If your BigchainDB node is running on an Amazon Linux instance (i.e. a Linux ins
|
||||
That said, you should check _which_ NTP daemon is installed. Is it recent? Is it configured securely?
|
||||
|
||||
|
||||
## Ubuntu's ntp Package
|
||||
## The Ubuntu ntp Packages
|
||||
|
||||
The [Ubuntu 14.04 (Trusty Tahr) package `ntp`](https://launchpad.net/ubuntu/trusty/+source/ntp) is based on the reference implementation of an NTP daemon (i.e. `ntpd`).
|
||||
The [Ubuntu `ntp` packages](https://launchpad.net/ubuntu/+source/ntp) are based on the reference implementation of NTP.
|
||||
|
||||
The following commands will uninstall the `ntp` and `ntpdate` packages, install the latest `ntp` package (which _might not be based on the latest ntpd code_), and start the NTP daemon (a local NTP server). (`ntpdate` is not reinstalled because it's [deprecated](https://askubuntu.com/questions/297560/ntpd-vs-ntpdate-pros-and-cons) and you shouldn't use it.)
|
||||
```text
|
||||
|
@ -2,12 +2,12 @@
|
||||
|
||||
If you didn't read the introduction to the [cloud deployment starter templates](index.html), please do that now. The main point is that they're not for deploying a production node; they can be used as a starting point.
|
||||
|
||||
This page explains how to use [Ansible](https://www.ansible.com/) to install, configure and run all the software needed to run a one-machine BigchainDB node on a server running Ubuntu 14.04.
|
||||
This page explains how to use [Ansible](https://www.ansible.com/) to install, configure and run all the software needed to run a one-machine BigchainDB node on a server running Ubuntu 16.04.
|
||||
|
||||
|
||||
## Install Ansible
|
||||
|
||||
The Ansible documentation has [installation instructions](https://docs.ansible.com/ansible/intro_installation.html). Note the control machine requirements: at the time of writing, Ansible required Python 2.6 or 2.7. (Support for Python 3 [is a goal of Ansible 2.2](https://github.com/ansible/ansible/issues/15976#issuecomment-221264089).)
|
||||
The Ansible documentation has [installation instructions](https://docs.ansible.com/ansible/intro_installation.html). Note the control machine requirements: at the time of writing, Ansible required Python 2.6 or 2.7. ([Python 3 support is coming](https://docs.ansible.com/ansible/python_3_support.html): "Ansible 2.2 features a tech preview of Python 3 support." and the latest version, as of January 31, 2017, was 2.2.1.0. For now, it's probably best to use it with Python 2.)
|
||||
|
||||
For example, you could create a special Python 2.x virtualenv named `ansenv` and then install Ansible in it:
|
||||
```text
|
||||
@ -19,9 +19,9 @@ pip install ansible
|
||||
|
||||
## About Our Example Ansible Playbook
|
||||
|
||||
Our example Ansible playbook installs, configures and runs a basic BigchainDB node on an Ubuntu 14.04 machine. That playbook is in `.../bigchaindb/ntools/one-m/ansible/one-m-node.yml`.
|
||||
Our example Ansible playbook installs, configures and runs a basic BigchainDB node on an Ubuntu 16.04 machine. That playbook is in `.../bigchaindb/ntools/one-m/ansible/one-m-node.yml`.
|
||||
|
||||
When you run the playbook (as per the instructions below), it ensures all the necessary software is installed, configured and running. It can be used to get a BigchainDB node set up on a bare Ubuntu 14.04 machine, but it can also be used to ensure that everything is okay on a running BigchainDB node. (If you run the playbook against a host where everything is okay, then it won't change anything on that host.)
|
||||
When you run the playbook (as per the instructions below), it ensures all the necessary software is installed, configured and running. It can be used to get a BigchainDB node set up on a bare Ubuntu 16.04 machine, but it can also be used to ensure that everything is okay on a running BigchainDB node. (If you run the playbook against a host where everything is okay, then it won't change anything on that host.)
|
||||
|
||||
|
||||
## Create an Ansible Inventory File
|
||||
@ -39,7 +39,15 @@ echo "192.0.2.128" > hosts
|
||||
but replace `192.0.2.128` with the IP address of the host.
|
||||
|
||||
|
||||
## Run the Ansible Playbook
|
||||
## Run the Ansible Playbook(s)
|
||||
|
||||
The latest Ubuntu 16.04 AMIs from Canonical don't include Python 2 (which is required by Ansible), so the first step is to run a small Ansible playbook to install Python 2 on the managed node:
|
||||
```text
|
||||
# cd to the directory .../bigchaindb/ntools/one-m/ansible
|
||||
ansible-playbook -i hosts --private-key ~/.ssh/<key-name> install-python2.yml
|
||||
```
|
||||
|
||||
where `<key-name>` should be replaced by the name of the SSH private key you created earlier (for SSHing to the host machine at your cloud hosting provider).
|
||||
|
||||
The next step is to run the Ansible playbook named `one-m-node.yml`:
|
||||
```text
|
||||
@ -47,14 +55,12 @@ The next step is to run the Ansible playbook named `one-m-node.yml`:
|
||||
ansible-playbook -i hosts --private-key ~/.ssh/<key-name> one-m-node.yml
|
||||
```
|
||||
|
||||
where `<key-name>` should be replaced by the name of the SSH private key you created earlier (for SSHing to the host machine at your cloud hosting provider).
|
||||
|
||||
What did you just do? Running that playbook ensures all the software necessary for a one-machine BigchainDB node is installed, configured, and running properly. You can run that playbook on a regular schedule to ensure that the system stays properly configured. If something is okay, it does nothing; it only takes action when something is not as-desired.
|
||||
|
||||
|
||||
## Some Notes on the One-Machine Node You Just Got Running
|
||||
|
||||
* It ensures that the installed version of RethinkDB is `2.3.4~0trusty`. You can change that by changing the installation task.
|
||||
* It ensures that the installed version of RethinkDB is the latest. You can change that by changing the installation task.
|
||||
* It uses a very basic RethinkDB configuration file based on `bigchaindb/ntools/one-m/ansible/roles/rethinkdb/templates/rethinkdb.conf.j2`.
|
||||
* If you edit the RethinkDB configuration file, then running the Ansible playbook will **not** restart RethinkDB for you. You must do that manually. (You can stop RethinkDB using `sudo /etc/init.d/rethinkdb stop`; run the playbook to get RethinkDB started again. This assumes you're using init.d, which is what the Ansible playbook assumes. If you want to use systemd, you'll have to edit the playbook accordingly, and stop RethinkDB using `sudo systemctl stop rethinkdb@<name_instance>`.)
|
||||
* It generates and uses a default BigchainDB configuration file, which it stores in `~/.bigchaindb` (the default location).
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
If you didn't read the introduction to the [cloud deployment starter templates](index.html), please do that now. The main point is that they're not for deploying a production node; they can be used as a starting point.
|
||||
|
||||
This page explains a way to use [Terraform](https://www.terraform.io/) to provision an Ubuntu machine (i.e. an EC2 instance with Ubuntu 14.04) and other resources on [AWS](https://aws.amazon.com/). That machine can then be used to host a one-machine BigchainDB node.
|
||||
This page explains a way to use [Terraform](https://www.terraform.io/) to provision an Ubuntu machine (i.e. an EC2 instance with Ubuntu 16.04) and other resources on [AWS](https://aws.amazon.com/). That machine can then be used to host a one-machine BigchainDB node.
|
||||
|
||||
|
||||
## Install Terraform
|
||||
@ -65,7 +65,7 @@ terraform apply
|
||||
|
||||
Terraform will report its progress as it provisions all the resources. Once it's done, you can go to the Amazon EC2 web console and see the instance, its security group, its elastic IP, and its attached storage volumes (one for the root directory and one for RethinkDB storage).
|
||||
|
||||
At this point, there is no software installed on the instance except for Ubuntu 14.04 and whatever else came with the Amazon Machine Image (AMI) specified in the Terraform configuration (files).
|
||||
At this point, there is no software installed on the instance except for Ubuntu 16.04 and whatever else came with the Amazon Machine Image (AMI) specified in the Terraform configuration (files).
|
||||
|
||||
The next step is to install, configure and run all the necessary software for a BigchainDB node. You could use [our example Ansible playbook](template-ansible.html) to do that.
|
||||
|
||||
|
@ -14,11 +14,11 @@ We use some Bash and Python scripts to launch several instances (virtual servers
|
||||
|
||||
## Python Setup
|
||||
|
||||
The instructions that follow have been tested on Ubuntu 14.04, but may also work on similar distros or operating systems.
|
||||
The instructions that follow have been tested on Ubuntu 16.04. Similar instructions should work on similar Linux distros.
|
||||
|
||||
**Note: Our Python scripts for deploying to AWS use Python 2 because Fabric doesn't work with Python 3.**
|
||||
|
||||
You must install the Python package named `fabric`, but it depends on the `cryptography` package, and that depends on some OS-level packages. On Ubuntu 14.04, you can install those OS-level packages using:
|
||||
You must install the Python package named `fabric`, but it depends on the `cryptography` package, and that depends on some OS-level packages. On Ubuntu 16.04, you can install those OS-level packages using:
|
||||
```text
|
||||
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
|
||||
```
|
||||
@ -72,7 +72,7 @@ One way to monitor a BigchainDB cluster is to use the monitoring setup described
|
||||
|
||||
You can deploy a monitoring server on AWS. To do that, go to the AWS EC2 Console and launch an instance:
|
||||
|
||||
1. Choose an AMI: select Ubuntu Server 14.04 LTS.
|
||||
1. Choose an AMI: select Ubuntu Server 16.04 LTS.
|
||||
2. Choose an Instance Type: a t2.micro will suffice.
|
||||
3. Configure Instance Details: you can accept the defaults, but feel free to change them.
|
||||
4. Add Storage: A "Root" volume type should already be included. You _could_ store monitoring data there (e.g. in a folder named `/influxdb-data`) but we will attach another volume and store the monitoring data there instead. Select "Add New Volume" and an EBS volume type.
|
||||
|
@ -9,7 +9,7 @@ Note: This section will be broken apart into several pages, e.g. NTP requirement
|
||||
* BigchainDB Server requires Python 3.4+ and Python 3.4+ [will run on any modern OS](https://docs.python.org/3.4/using/index.html).
|
||||
* BigchaindB Server uses the Python `multiprocessing` package and [some functionality in the `multiprocessing` package doesn't work on OS X](https://docs.python.org/3.4/library/multiprocessing.html#multiprocessing.Queue.qsize). You can still use Mac OS X if you use Docker or a virtual machine.
|
||||
|
||||
The BigchainDB core dev team uses Ubuntu 14.04, Ubuntu 16.04, Fedora 23, and Fedora 24.
|
||||
The BigchainDB core dev team uses recent LTS versions of Ubuntu and recent versions of Fedora.
|
||||
|
||||
We don't test BigchainDB on Windows or Mac OS X, but you can try.
|
||||
|
||||
|
@ -94,21 +94,7 @@ If you're testing or developing BigchainDB on a stand-alone node, then you shoul
|
||||
|
||||
## Install BigchainDB Server
|
||||
|
||||
BigchainDB Server has some OS-level dependencies that must be installed.
|
||||
|
||||
On Ubuntu 14.04, we found that the following was enough:
|
||||
```text
|
||||
sudo apt-get update
|
||||
sudo apt-get install g++ python3-dev libffi-dev
|
||||
```
|
||||
|
||||
On Fedora 23, we found that the following was enough (tested in February 2015):
|
||||
```text
|
||||
sudo dnf update
|
||||
sudo dnf install gcc-c++ redhat-rpm-config python3-devel libffi-devel
|
||||
```
|
||||
|
||||
(If you're using a version of Fedora before version 22, you may have to use `yum` instead of `dnf`.)
|
||||
First, [install the OS-level dependencies of BigchainDB Server (link)](../appendices/install-os-level-deps.html).
|
||||
|
||||
With OS-level dependencies installed, you can install BigchainDB Server with `pip` or from source.
|
||||
|
||||
@ -122,7 +108,7 @@ pip -V
|
||||
|
||||
If it says that `pip` isn't installed, or it says `pip` is associated with a Python version less than 3.4, then you must install a `pip` version associated with Python 3.4+. In the following instructions, we call it `pip3` but you may be able to use `pip` if that refers to the same thing. See [the `pip` installation instructions](https://pip.pypa.io/en/stable/installing/).
|
||||
|
||||
On Ubuntu 14.04, we found that this works:
|
||||
On Ubuntu 16.04, we found that this works:
|
||||
```text
|
||||
sudo apt-get install python3-pip
|
||||
```
|
||||
|
15
ntools/one-m/ansible/install-python2.yml
Normal file
15
ntools/one-m/ansible/install-python2.yml
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
# This playbook ensures Python 2 is installed on the managed node.
|
||||
# This is inspired by https://gist.github.com/gwillem/4ba393dceb55e5ae276a87300f6b8e6f
|
||||
|
||||
- hosts: all
|
||||
gather_facts: false
|
||||
remote_user: ubuntu
|
||||
|
||||
pre_tasks:
|
||||
- name: Install Python 2
|
||||
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
|
||||
become: true
|
||||
|
||||
# action: setup will gather facts after python2 has been installed
|
||||
- action: setup
|
@ -10,22 +10,24 @@
|
||||
apt: name={{item}} state=latest update_cache=yes
|
||||
become: true
|
||||
with_items:
|
||||
- make
|
||||
- git
|
||||
- g++
|
||||
- python3-dev
|
||||
- libffi-dev
|
||||
- python3-setuptools # mainly for easy_install3, which is used to get latest pip3
|
||||
|
||||
# This should make both pip and pip3 be pip version >=8.1.2 (python 3.4).
|
||||
# See the comments about this below.
|
||||
- name: Ensure the latest pip/pip3 is installed, using easy_install3
|
||||
easy_install: executable=easy_install3 name=pip state=latest
|
||||
become: true
|
||||
- python3-dev
|
||||
- python3-pip
|
||||
- python3-setuptools
|
||||
|
||||
- name: Ensure the latest setuptools (Python package) is installed
|
||||
pip: executable=pip3 name=setuptools state=latest
|
||||
become: true
|
||||
|
||||
# This should make both pip and pip3 be pip version >=8.1.2 (python 3.4).
|
||||
# See the comments about this below.
|
||||
#- name: Ensure the latest pip/pip3 is installed, using easy_install3
|
||||
# easy_install: executable=easy_install3 name=pip state=latest
|
||||
# become: true
|
||||
|
||||
- name: Install BigchainDB from PyPI using sudo pip3 install bigchaindb
|
||||
pip: executable=pip3 name=bigchaindb state=latest
|
||||
become: true
|
||||
|
@ -12,12 +12,14 @@
|
||||
# To better understand the /etc/fstab fields/columns, see:
|
||||
# http://man7.org/linux/man-pages/man5/fstab.5.html
|
||||
# https://tinyurl.com/jmmsyon = the soure code of the mount module
|
||||
# Note: It seems the "nobootwait" option is gone in Ubuntu 16.04. See
|
||||
# https://askubuntu.com/questions/786928/ubuntu-16-04-fstab-fails-with-nobootwait
|
||||
- name: Ensure /data dir exists and is mounted + update /etc/fstab
|
||||
mount:
|
||||
name=/data
|
||||
src=/dev/xvdp
|
||||
fstype=ext4
|
||||
opts="defaults,nofail,nobootwait"
|
||||
opts="defaults,nofail"
|
||||
dump=0
|
||||
passno=2
|
||||
state=mounted
|
||||
|
@ -2,11 +2,12 @@
|
||||
# ansible/roles/rethinkdb/tasks/main.yml
|
||||
|
||||
# Note: the .list extension will be added to the rethinkdb filename automatically
|
||||
# Note: xenial is the $DISTRIB_CODENAME for Ubuntu 16.04
|
||||
- name: >
|
||||
Ensure RethinkDB's APT repository for Ubuntu trusty is present
|
||||
Ensure RethinkDB's APT repository for Ubuntu xenial is present
|
||||
in /etc/apt/sources.list.d/rethinkdb.list
|
||||
apt_repository:
|
||||
repo='deb http://download.rethinkdb.com/apt trusty main'
|
||||
repo='deb http://download.rethinkdb.com/apt xenial main'
|
||||
filename=rethinkdb
|
||||
state=present
|
||||
become: true
|
||||
@ -15,8 +16,8 @@
|
||||
apt_key: url=http://download.rethinkdb.com/apt/pubkey.gpg state=present
|
||||
become: true
|
||||
|
||||
- name: Ensure the Ubuntu package rethinkdb 2.3.4~0trusty is installed
|
||||
apt: name=rethinkdb=2.3.4~0trusty state=present update_cache=yes
|
||||
- name: Ensure the latest rethinkdb package is installed
|
||||
apt: name=rethinkdb state=latest update_cache=yes
|
||||
become: true
|
||||
|
||||
- name: Ensure the /data directory's owner and group are both 'rethinkdb'
|
||||
|
@ -2,19 +2,20 @@
|
||||
# even though the contents are the same.
|
||||
# This file has the mapping from region --> AMI name.
|
||||
#
|
||||
# These are all Ubuntu 14.04 LTS AMIs
|
||||
# These are all Ubuntu 16.04 LTS AMIs
|
||||
# with Arch = amd64, Instance Type = hvm:ebs-ssd
|
||||
# from https://cloud-images.ubuntu.com/locator/ec2/
|
||||
# as of Jan. 31, 2017
|
||||
variable "amis" {
|
||||
type = "map"
|
||||
default = {
|
||||
eu-west-1 = "ami-55452e26"
|
||||
eu-central-1 = "ami-b1cf39de"
|
||||
us-east-1 = "ami-8e0b9499"
|
||||
us-west-2 = "ami-547b3834"
|
||||
ap-northeast-1 = "ami-49d31328"
|
||||
ap-southeast-1 = "ami-5e429c3d"
|
||||
ap-southeast-2 = "ami-25f3c746"
|
||||
sa-east-1 = "ami-97980efb"
|
||||
eu-west-1 = "ami-d8f4deab"
|
||||
eu-central-1 = "ami-5aee2235"
|
||||
us-east-1 = "ami-6edd3078"
|
||||
us-west-2 = "ami-7c803d1c"
|
||||
ap-northeast-1 = "ami-eb49358c"
|
||||
ap-southeast-1 = "ami-b1943fd2"
|
||||
ap-southeast-2 = "ami-fe71759d"
|
||||
sa-east-1 = "ami-7379e31f"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user