Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the installer guides. Moved them to docs from wiki. #139

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions content/guides/installer-guides/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
title: SODA Installer Guides
description: "All the installation guides and documentation"
weight: 10
disableToc: false
disableToc: true
---
## SODA Installers

SODA Foundation Release supports different kinds of installation methods.
You can find the details of the SODA Installer as below:

- [The Installer Guides](https://docs.sodafoundation.io/soda-gettingstarted/installation/)
- [SODA Installer Source Code](https://github.com/sodafoundation/installer)

{{%children style="h3" description="true" %}}
{{% children style="h3" description="true" %}}

200 changes: 200 additions & 0 deletions content/guides/installer-guides/containerized/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
---
title: How to Run Containerized SODA for Testing
menuTitle: Run Containerized SODA
description: "Here is a tutorial guiding users and new contributors to get familiar with SODA by installing a simple containerized local cluster"
weight: 60
tags: ['installer guide', 'containerized']
---
Here is a tutorial guiding users and new contributors to get familiar with [SODA](https://github.com/sodafoundation/soda) by installing a simple containerized local cluster. You can also use the ansible script to install automatically, see detail in [SODA Local Cluster Installation through ansible](/guides/installer-guides/using-ansible/).

### Pre-configuration
Before you start, some configurations are required:
```shell
export BackendType="sample" # 'sample' is the default option, currently also support 'lvm'

mkdir -p /etc/opensds && sudo cat > /etc/opensds/opensds.conf <<OPENSDS_GLOABL_CONFIG_DOC
[osdsapiserver]
api_endpoint = 0.0.0.0:50040
auth_strategy = keystone
# If https is enabled, the default value of cert file
# is /opt/opensds-security/opensds/opensds-cert.pem,
# and key file is /opt/opensds-security/opensds/opensds-key.pem
https_enabled = False
beego_https_cert_file =
beego_https_key_file =
# Encryption and decryption tool. Default value is aes.
password_decrypt_tool = aes

[keystone_authtoken]
memcached_servers = 127.0.0.1:11211
signing_dir = /var/cache/opensds
cafile = /opt/stack/data/ca-bundle.pem
auth_uri = http://127.0.0.1/identity
project_domain_name = Default
project_name = service
user_domain_name = Default
password = opensds@123
# Whether to encrypt the password. If enabled, the value of the password must be ciphertext.
enable_encrypted = False
# Encryption and decryption tool. Default value is aes. The decryption tool can only decrypt the corresponding ciphertext.
pwd_encrypter = aes
username = opensds
auth_url = http://127.0.0.1/identity
auth_type = password

[osdslet]
api_endpoint = 127.0.0.1:50049

[osdsdock]
api_endpoint = 127.0.0.1:50050
# Choose the type of dock resource, only support 'provisioner' and 'attacher'.
dock_type = provisioner
# Specify which backends should be enabled, sample,ceph,cinder,lvm and so on.
enabled_backends = $BackendType

[sample]
name = sample
description = Sample Test
driver_name = sample

[lvm]
name = lvm
description = LVM Test
driver_name = lvm
config_path = /etc/opensds/driver/lvm.yaml
host_based_replication_driver = DRBD

[database]
endpoint = 127.0.0.1:2379,127.0.0.1:2380
driver = etcd
OPENSDS_GLOABL_CONFIG_DOC
```

If you choose `lvm` as backend, you need to make sure physical volume and volume group existed. Besides, you need to configure lvm driver.
```
sudo pvdisplay # Check if physical volume existed
sudo vgdisplay # Check if volume group existed

mkdir -p /etc/opensds/driver && sudo cat > /etc/opensds/driver/lvm.yaml <<OPENSDS_DRIVER_CONFIG_DOC
tgtBindIp: 127.0.0.1
tgtConfDir: /etc/tgt/conf.d
pool:
{{ volume_group_name }}:
storageType: block
availabilityZone: default
extras:
dataStorage:
provisioningPolicy: Thin
isSpaceEfficient: false
ioConnectivity:
accessProtocol: iscsi
maxIOPS: 7000000
maxBWS: 600
advanced:
diskType: SSD
latency: 5ms
OPENSDS_DRIVER_CONFIG_DOC
```

### SODA Service Installation
If you are a lazy one, just like me, you probably want to do this:(`docker-compose` required)
```
wget https://raw.githubusercontent.com/opensds/opensds/development/docker-compose.yml

docker-compose up -d
```

Or you can do this:
```
docker run -d --net=host -v /usr/share/ca-certificates/:/etc/ssl/certs quay.io/coreos/etcd:latest

docker run -d --net=host --privileged=true opensdsio/opensds-authchecker:latest

docker run -d --net=host -v /etc/opensds:/etc/opensds opensdsio/opensds-apiserver:latest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These executable names may not be valid for recent releases. Can we add some notes that these steps are to be validated.


docker run -d --net=host -v /etc/opensds:/etc/opensds opensdsio/opensds-controller:latest

docker run -d --net=host --privileged=true -v /etc/opensds:/etc/opensds -v /dev/:/dev/ -v /run/:/run/:shared -v /etc/localtime:/etc/localtime:ro -v /lib/modules:/lib/modules:ro opensdsio/opensds-dock:latest

docker run -d --net=host opensdsio/dashboard:latest
```

If you are a smart guy, you probably need to configure your service ip and database endpoint:
```
export HostIP="your_real_ip"
docker run -d --net=host -v /usr/share/ca-certificates/:/etc/ssl/certs quay.io/coreos/etcd:latest \
-name etcd0 \
-advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://${HostIP}:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster etcd0=http://${HostIP}:2380 \
-initial-cluster-state new

docker run -d --net=host --privileged=true --name=opensds-authchecker opensdsio/opensds-authchecker:latest

docker run -d --net=host -v /etc/opensds:/etc/opensds opensdsio/opensds-apiserver:latest /usr/bin/osdsapiserver --api-endpoint=0.0.0.0:50040 --db-endpoint=${HostIP}:2379,${HostIP}:2380

docker run -d --net=host -v /etc/opensds:/etc/opensds opensdsio/opensds-controller:latest /usr/bin/osdslet --api-endpoint=0.0.0.0:50040 --db-endpoint=${HostIP}:2379,${HostIP}:2380

docker run -d --net=host --privileged=true -v /etc/opensds:/etc/opensds -v /dev/:/dev/ -v /run/:/run/:shared -v /etc/localtime:/etc/localtime:ro -v /lib/modules:/lib/modules:ro opensdsio/opensds-dock:latest /usr/bin/osdsdock -logtostderr --api-endpoint=0.0.0.0:50050 --db-endpoint=${HostIP}:2379,${HostIP}:2380

docker run -d --net=host --env OPENSDS_AUTH_URL=http://${HostIP}/identity --env OPENSDS_HOTPOT_URL=http://${HostIP}:50040 OPENSDS_GELATO_URL=http://${HostIP}:8089 opensdsio/dashboard:latest
```

### Test

### SODA CLI tool
Download and configure cli tool.
```
wget https://github.com/opensds/opensds/releases/download/v0.6.0/opensds-hotpot-v0.6.0-linux-amd64.tar.gz
tar zxvf opensds-hotpot-v0.6.0-linux-amd64.tar.gz
cp opensds-hotpot-v0.6.0-linux-amd64/bin/* /usr/local/bin
chmod +x /usr/local/bin/osdsctl

export OPENSDS_ENDPOINT=http://127.0.0.1:50040
export OPENSDS_AUTH_STRATEGY=keystone
export OS_AUTH_URL=http://127.0.0.1/identity
export OS_USERNAME=admin
export OS_PASSWORD=opensds@123
export OS_TENANT_NAME=admin
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_ID=default

osdsctl pool list
```

#### Create a default profile firstly.
```
osdsctl profile create '{"name": "default", "description": "default policy", "storageType": "block"}'
```

#### Create a volume.
```
osdsctl volume create 1 --name=test-001
```

#### List all volumes.
```
osdsctl volume list
```

#### Delete the volume.
```
osdsctl volume delete <your_volume_id>
```

### SODA Dashboard
SODA Dashboard is available at `http://{your_host_ip}:8088`, please login the dashboard using the default admin credentials: `admin/opensds@123`. Create `tenant`, `user`, and `profiles` as admin. Multi-Cloud service is also supported by dashboard.

Logout of the dashboard as admin and login the dashboard again as a non-admin user to manage storage resource:

#### Volume Service
* Create volume
* Create snapshot
* Expand volume size
* Create volume from snapshot
* Create volume group

After this is done, just enjoy it!
170 changes: 170 additions & 0 deletions content/guides/installer-guides/for-rhel/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
---
title: Guide for installing SODA on Red Hat Enterprise Linux
menuTitle: Install on Red Hat
description: "This document describes how to install SODA projects in a local cluster on Red Hat Enterprise Linux"
weight: 70
tags: ['installer guide', 'rhel']
---
### Install SODA in Redhat 7.5 manually

### Pre-config (Redhat 7.5)
All the installation work is tested on `Redhat 7.5`, please make sure you have installed the right one. Also `root` user is suggested before the installation work starts.

* packages

Install following packages:
```bash
yum install librados2-devel
yum install librbd1-devel
```
* etcd

Install etcd:
```bash
wget https://github.com/etcd-io/etcd/releases/download/v3.3.9/etcd-v3.3.9-linux-amd64.tar.gz
cp etcd-v3.3.9-linux-amd64/etcd* /usr/local/bin/
```

### Install SODA


#### Download binary
```
# OpenSDS
wget https://github.com/opensds/opensds/releases/download/v0.5.0/opensds-hotpot-v0.5.0-linux-amd64.tar.gz
tar xvf opensds-hotpot-v0.5.0-linux-amd64.tar.gz
cp opensds-hotpot-v0.5.0-linux-amd64/bin/* /usr/local/bin
```

#### Create LVM volume group


vi create_vg.sh
```bash
#!/bin/bash
function _create_lvm_volume_group {
local vg=$1
local size=$2

local backing_file=/opt/opensds/opensds-volume.img
mkdir /opt/opensds -p
if ! sudo vgs $vg &> /dev/null ; then
[[ -f $backing_file ]] || truncate -s $size $backing_file
local vg_dev
vg_dev=`sudo losetup -f --show $backing_file`

if ! sudo pvs $vg_dev; then
sudo pvcreate $vg_dev
fi

if ! sudo vgs $vg; then
sudo vgcreate $vg $vg_dev
fi
fi
}
modprobe dm_thin_pool
_create_lvm_volume_group opensds-volumes 10G
```

Then, execute command
```
chmod +x create_vg.sh
./create_vg.sh
```

#### Configure OpenSDS

We assume that the IP address of your Redhat linux is "192.168.0.2".

```
mkdir -p /etc/opensds/driver/
```

vi /etc/opensds/opensds.conf
```
[osdslet]
api_endpoint = 0.0.0.0:50040
graceful = True
log_file = /var/log/opensds/osdslet.log
socket_order = inc
auth_strategy = noauth

[osdsdock]
api_endpoint = 192.168.0.2:50050
log_file = /var/log/opensds/osdsdock.log
# Choose the type of dock resource, only support 'provisioner' and 'attacher'.
dock_type = provisioner
# Specify which backends should be enabled, sample,ceph,cinder,lvm and so on.
enabled_backends = lvm

[database]
endpoint = 192.168.0.2:2479,192.168.0.2:2480
driver = etcd

[lvm]
name = lvm backend
description = This is a lvm backend service
driver_name = lvm
config_path = /etc/opensds/driver/lvm.yaml
```

vi /etc/opensds/driver/lvm.yaml
```
tgtBindIp: 192.168.0.2
pool:
vg001:
storageType: block
availabilityZone: default
extras:
dataStorage:
provisioningPolicy: Thin
isSpaceEfficient: false
ioConnectivity:
accessProtocol: iscsi
maxIOPS: 7000000
maxBWS: 600
advanced:
diskType: SSD
latency: 5ms
```

#### Startup service.
```
mkdir /opt/opensds/etcd/ -p
nohup etcd --advertise-client-urls http://192.168.0.2:2479 --listen-client-urls http://192.168.0.2:2479 --listen-peer-urls http://192.168.0.2:2480 --data-dir /opt/opensds/etcd/data --debug &
osdslet --daemon
osdsdock --daemon
```


### How to test SODA cluster

**SODA CLI**
Firstly configure SODA CLI tool:
```bash
export OPENSDS_ENDPOINT=http://192.168.0.2:50040
export OPENSDS_AUTH_STRATEGY=noauth

osdsctl pool list # Check if the pool resource is available
```

Then create a default profile:
```
osdsctl profile create '{"name": "default", "description": "default policy"}'
```

Create a volume:
```
osdsctl volume create 1 --name=test-001
```

List all volumes:
```
osdsctl volume list
```

Delete the volume:
```
osdsctl volume delete <your_volume_id>
```

Loading