2019-05-06 06:51:53    168    0    0

PREFLIGHT CHECKLIST

The ceph-deploy tool operates out of a directory on an admin node. Any host with network connectivity and a modern python environment and ssh (such as Linux) should work.

CEPH-DEPLOY SETUP

register the target machine with subscription-manager, verify your subscriptions, and enable the “Extras” repository for package dependencies. For example:

  1. yum install subscription-manager -y
  2. sudo subscription-manager repos --enable=rhel-7-server-extras-rpms

Install and enable the Extra Packages for Enterprise Linux (EPEL) repository:

  1. sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Add the Ceph repository to your yum configuration file at /etc/yum.repos.d/ceph.repo with the following command. Replace {ceph-stable-release} with a stable Ceph release (e.g., luminous.) For example:

  1. cat << EOM > /etc/yum.repos.d/ceph.repo
  2. [ceph-noarch]
  3. name=Ceph noarch packages
  4. baseurl=https:
2024-03-31 15:16:57    1    0    0

Operation

Copy file between two esxis

Check if SSH client service is enabled. Will return 'False' if 'Disabled'.

  1. esxcli network firewall ruleset list --ruleset-id sshClient

Then enable SSH client.

  1. esxcli network firewall ruleset set --ruleset-id sshClient --enabled=true

List disk

  1. df -hl

copy file between esxi

  1. scp -r workspace/ 192.168.0.111:/vmfs/volumes/datastore1

unregister vm

  1. vim-cmd vmsvc/getallvms
  2. vim-cmd vmsvc/unregister 13

2021-08-03 14:51:02    124    0    0

INSTALLATION (MANUAL)

INSTALL PACKAGES WITH CEPHADM

prepare env

  1. yum install python3 yum-utils -y
  2. yum-config-manager \
  3. --add-repo \
  4. https://download.docker.com/linux/centos/docker-ce.repo
  5. yum install docker-ce docker-ce-cli containerd.io
  6. systemctl enable docker && service docker start
  7. systemctl disable firewalld && service firewalld stop

Download the cephadm script

  1. curl --silent --remote-name --location https://github.com/ceph/ceph/raw/pacific/src/cephadm/cephadm
  2. chmod +x cephadm

Configure the Ceph repository based on the release name:

  1. ./cephadm add-repo --release Octopus
  2. #https://docs.ceph.com/en/latest/releases/index.html

Install the appropriate packages. You can install them using your package management tool (e.g., APT, Yum) directly, or you can also use the cephadm wrapper. For example:

  1. sudo rpm --import 'https://download.ceph.com/keys/release.asc'
  2. ./cephadm install
  3. ./cephadm install ceph-common

BOOTSTRAP A NEW CLUSTE

2021-08-06 04:50:08    44    0    0

MicroK8s is the smallest, fastest, fully-conformant Kubernetes that tracks upstream releases and makes clustering trivial. MicroK8s is great for offline development, prototyping, and testing.

Install MicroK8s

Requirements

  • Operating system which supports snapd
  • At least 20G of disk space and 4G of memory are recommended
  • An internet connection

For Centos7

  1. service firewall stop && systemctl disable firewalld
  2. yum install epel-release
  3. yum install snapd
  4. systemctl enable --now snapd.socket
  5. sudo ln -s /var/lib/snapd/snap /snap

Install MicroK8s

MicroK8s will install a minimal, lightweight Kubernetes you can run and use on practically any machine. It can be installed with a snap:

  1. snap install microk8s --classic --channel=1.21/stable
  2. snap install microk8s --classic --channel=1.19/stable
  3. #from 1.21 to 1.19
  4. snap refresh --classic --channel=1.19/stable microk8s

All the currently available channels are shown if you run

  1. snap info m
环境搭建    2019-05-06 06:51:53    212    0    0

Install

Debian / Ubuntu:

  1. apt-get install python-pip
  2. pip install shadowsocks

CentOS:

  1. yum install python-setuptools && easy_install pip
  2. #curl -o get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && python get-pip.py
  3. pip install shadowsocks

Windows:

See [Install Server on Windows]

Usage

  1. ssserver -p 443 -k password -m aes-256-cfb

To run in the background:

  1. sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
  2. ssserver --log-file /var/log/shadowsocks-12300.log --pid-file /var/run/shadowsocks-12300.pid --user nobody -p 12300 -k password -m aes-256-cfb -s 0.0.0.0 -d start

To stop:

  1. sudo ssserver -d stop

To check the log:

  1. sudo less /var/log/shadowsocks.log

Check all the options via -h. You can also use a [Configuration] file
instead.

Client

  • [Windows] / [OS X]
  • [Android] / [iOS]
  • [OpenWRT]

Use GUI clients on your local PC/phones. Check the README of your client
for more information.

Documenta

环境搭建 hadoop    2019-05-06 06:51:53    73    0    0

Install Jdk

参考Jdk安装

Configure SSH

参考SSH免密码登陆

Install Ntp

  1. yum install ntp
  2. vi /etc/ntp.conf
  3. server ntp1.aliyun.com iburst
  4. server ntp2.aliyun.com iburst
  5. server ntp3.aliyun.com iburst
  6. systemctl enable ntpd
  7. systemctl start ntpd

Install Hadoop

Download Hadoop

  1. wget https://archive.apache.org/dist/hadoop/core/hadoop-2.7.5/hadoop-2.7.5.tar.gz
  2. tar zxvf hadoop-2.7.5.tar.gz
  3. cd hadoop-2.7.5/

Configure Hadoop

Config Env

  1. vi .bashrc
  2. export JAVA_HOME=/opt/jdk1.8.0_202
  3. export HADOOP_PID_DIR=/data/hadooptemp

Configure slaves

  1. vi slaves
  2. test01
  3. test02
  4. test03

Configure core-site.xml

  1. mkdir /data/hadoop
  2. mkdir /data/hadooptemp
  1. <configuration>
  2. <property>
  3. <name>hadoop.tmp.dir</name>
  4. <value>/data/hadoop</value>
  5. <description>
  6. A base for other temporary directories.
  7. </description>
  8. </property>
  9. <property>
  10. <name>fs.defaultFS</name>
  11. <value>hdfs://cluster01</value>
  12. <descr
2022-01-29 08:12:55    12    0    0

Install MongoDB Community Edition

MongoDB only supports the 64-bit versions of these platforms.

Follow these steps to install MongoDB Community Edition using the yum package manager.

Create a /etc/yum.repos.d/mongodb-org-4.4.repo file so that you can install MongoDB directly using yum:

  1. [mongodb-org-4.4]
  2. name=MongoDB Repository
  3. baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.4/x86_64/
  4. gpgcheck=1
  5. enabled=1
  6. gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc

To install the latest stable version of MongoDB, issue the following command:

  1. sudo yum install -y mongodb-org

Alternatively, to install a specific release of MongoDB, specify each component package individually and append the version number to the package name, as in the following example:

  1. sudo yum install -y mongodb-org-4.4.11 mongodb-org-server-4.4.11 mongodb-org-shell-4.4.11 mongodb-org-mongos-4.4.11 mongodb-org-tools-4.4.11

You can specify

2022-01-29 08:09:33    16    0    0

Krew

Make sure that git is installed.

Run this command to download and install krew:

  1. (
  2. set -x; cd "$(mktemp -d)" &&
  3. OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
  4. ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
  5. KREW="krew-${OS}_${ARCH}" &&
  6. curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
  7. tar zxvf "${KREW}.tar.gz" &&
  8. ./"${KREW}" install krew
  9. )

Add the $HOME/.krew/bin directory to your PATH environment variable. To do this, update your .bashrc or .zshrc file and append the following line:

  1. export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"

and restart your shell.

Run kubectl krew to check the installation.

kubectx + kubens

  1. export HTTP_PROXY=http://192.168.0.201:6666
  2. export HTTPS_PROXY=http://192.168.0.201:6666
  3. kubectl krew install ctx
  4. kubectl krew install ns
2022-01-28 07:24:36    18    0    0

Download the latest Kafka release and extract it:

  1. wget https://dlcdn.apache.org/kafka/3.1.0/kafka_2.12-3.1.0.tgz --no-check-certificate

Config Kafka Broker server.properties

  1. #broker.id=0
  2. log.dirs=/data/kafka
  3. zookeeper.connect=test01:2181,test02:2181,test03:2181/kafka

Copy To All Nodes

  1. scp -r kafka_2.12-3.1.0/ test02:~
  2. scp -r kafka_2.12-3.1.0/ test03:~

Start kafka service

  1. ssh test01 'cd kafka_2.12-3.1.0 && bin/kafka-server-start.sh -daemon config/server.properties'
  2. ssh test02 'cd kafka_2.12-3.1.0 && bin/kafka-server-start.sh -daemon config/server.properties'
  3. ssh test03 'cd kafka_2.12-3.1.0 && bin/kafka-server-start.sh -daemon config/server.properties'

Run Kafka Ui

with kafka-ui

  1. docker run -d --name=kafkaui -p 19092:8080 \
  2. --add-host test01:192.168.0.161 \
  3. --add-host test02:192.168.0.162 \
  4. --add-host test03:192.168.0.163 \
  5. -e KAFKA_CLUSTERS_0_NAME=kafka01 \
  6. -e KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=test01:90
2021-12-30 05:14:58    13    0    0

Install

  1. yum install bind bind-utils

backup named.conf file

  1. cp /etc/named.conf /etc/named.conf.bak

configure named.conf

  1. listen-on port 53 { 127.0.0.1; 192.168.0.201; };
  2. allow-query { any; };
  3. zone "louyj.com" IN{
  4. type master;
  5. file "louyj.com.zone";
  6. };

type:

  • master指的是主dns解析
  • slave指的是从dns解析
  • hint指的是根域名解析(根提示域)
  • forward指的是转发,转发不使用file

add zone

vi /var/named/louyj.com.zone

  1. $TTL 1D
  2. @ IN SOA ns1.louyj.com. ns2.louyj.com. (
  3. 0;serial
  4. 1D;refresh
  5. 1H;retry
  6. 1W;expire
  7. 3H;minimum
  8. );
  9. @ IN NS ns1
  10. @ IN NS ns2
  11. ns1 IN A 192.168.0.201
  12. ns2 IN A 192.168.0.200
  13. www IN A 192.168.0.201
  14. esxi IN A 192.168.0.201
  15. cloud IN A 192.168.0.201
  16. image IN A 192.168.0.201
  17. media IN A 192.168.0.201
  18. no
1/9