{"id":19865279,"url":"https://github.com/mnms/cli","last_synced_at":"2025-06-18T18:41:23.774Z","repository":{"id":83397589,"uuid":"218691116","full_name":"mnms/cli","owner":"mnms","description":"LightningDB Command Line Interface Tool","archived":false,"fork":false,"pushed_at":"2020-05-26T02:28:28.000Z","size":372,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-11T15:39:59.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-31T05:30:29.000Z","updated_at":"2020-05-26T02:14:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"37475f56-428f-4fd1-bec9-e714dca8f8a3","html_url":"https://github.com/mnms/cli","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnms%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnms%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnms%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnms%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnms","download_url":"https://codeload.github.com/mnms/cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241274480,"owners_count":19937199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T15:22:02.135Z","updated_at":"2025-02-28T23:25:39.628Z","avatar_url":"https://github.com/mnms.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LTCLI Guide\n\n[Installing Prerequisites](#installing-prerequisites)\n\n[LTCLI Install](#LTCLI-install)\n\n[LTCLI 실행하기](#LTCLI-실행하기)\n\n[Deploy](#deploy)\n\n[클러스터 생성](#클러스터-생성)\n\n[Lightning DB Version Update](#lightningdb-version-update)\n\n[Re-Deploy](#re-deploy)\n\n[Add Slave](#add-slave)\n\n[Thrift Server](#thrift-server)\n\n[Logging in file](#logging-in-file)\n\n\u003c/br\u003e\n\u003c/br\u003e\n\n## Installing Prerequisites\n\n* Installing prerequisites for lightningdb\n\n* Python ==2.7, \u003e=3.5\n\n\u003c/br\u003e\n\u003c/br\u003e\n\n## LTCLI Install\n\n```\n$ pip insatll ltcli --upgrade --user\n```\n\n\u003c/br\u003e\n\u003c/br\u003e\n\n## LTCLI 실행하기\n\n실행하기 전에 환경변수 FBPATH 설정이 필요합니다. 미설정시 아래와 같이 에러메시지가 발생합니다.\n\n```\nTo start using LTCLI, you should set env FBPATH\nex)\nexport FBPATH=$HOME/.flashbase\n```\n\n\u003c/br\u003e\n\n설치 및 설정완료 후 아래와 같이 `ltcli` 을 입력하면 LTCLI이 실행됩니다.\n```\n$ ltcli\n```\n\n\u003c/br\u003e\n\nLTCLI 최초접속시 base_directory를 물어봅니다. base_directory는 lightningdb의 root path 입니다.\n\n```\nType base directory of LightningDB [~/tsr2]\n~/tsr2\nOK, ~/tsr2\n```\n\u003e 대괄호 안의 값은 default value이며 아무값도 입력하지 않으면 default value가 선택됩니다.\n\u003e\n\u003e 질의에 따라 default value가 없을 수도 있습니다.\n\n `edit` 명령어를 이용하거나 `$FBPAHT/.flashbase/config` 파일을 열어 base_directory 를 수정할 수 있습니다.\n\n\u003c/br\u003e\n\n정상적으로 접속이 되면 가장 최근에 접속했던 cluster에 접속되며, 없는 경우 `-` 로 표시됩니다.\n\nLTCLI의 prompt 형식은 `\u003cuser-name\u003e@lightningdb:\u003ccluster-id\u003e\u003e` 입니다.\n\nex)\n\n```\nroot@lightningdb:-\u003e\nroot@lightningdb:1\u003e\n```\n\n\u003c/br\u003e\n\u003c/br\u003e\n\n## Deploy\n\ndeploy는 lightningdb 설치과정입니다. 클러스터마다 deploy가 이루어져야 합니다.\n\n```\n\u003e deploy 1\n```\n\n\u003c/br\u003e\n\n정보 입력 시 아래의 값들은 가장 최근에 입력했던 값을 default value로 보여줍니다.\n\n* host\n* number of master\n* replicas\n* number of ssd\n* prefix of (redis data / redis db path / flash db path)\n\n현재 입력하는 값이 default value로 저장되지 않도록 하려면  `--history-save` 옵션을 사용하세요.\n```\n\u003e deploy --history-save=False\n```\n\n\u003c/br\u003e\n\n### installer 선택\n\n```\nSelect installer\n\n    [ INSTALLER LIST ]\n    (1) tsr2-installer.bin.lightningdb_v1.1.10.centos\n    (2) tsr2-installer.bin.lightningdb_v1.1.09.centos\n    (3) tsr2-installer.bin.lightningdb_v1.1.08.centos\n\nPlease enter the number, file path or url of the installer you want to use.\nyou can also add file in list by copy to '$FBPATH/releases/'\n1\nOK, tsr2-installer.bin.lightningdb_v1.1.10.centos\n```\n\ninstaller를 선택합니다. 숫자입력을 통해 리스트에서 선택할 수 있으며, 파일의 경로나 url을 통해서도 선택할 수 있습니다.\n\n\n```\nSelect installer\n\n    [ INSTALLER LIST ]\n    (empty)\n\nPlease enter file path or url of the installer you want to use\nyou can also add file in list by copy to '$FBPATH/releases/'\n```\n\n위와 같이 목록이 비어있는 경우에는 파일 경로를 입력하거나 url 입력을 통해서만 installer를 선택할 수 있습니다.\n\nurl을 통해 installer를 다운로드 하거나 `$FBPATH/releases/` 경로 아래에 installer 파일을 복사하면 리스트에 추가됩니다.\n\n\n\u003c/br\u003e\n\n### host 입력\n\n```\nPlease type host list separated by comma(,) [127.0.0.1]\nnodeA, nodeB, nodeC, nodeD\nOK, ['nodeA', 'nodeB', 'nodeC', 'nodeD']\n```\n\nip주소 혹은 hostname을 입력합니다. 여러 개를 입력하는 경우 쉼표(,)를 구분자로 사용하세요.\n\n\n\u003c/br\u003e\n\n### master 정보 입력\n\n```\nHow many masters would you like to create on each host? [1]\n1\nOK, 1\nPlease type ports separate with comma(,) and use hyphen(-) for range. [18100]\n18100\nOK, ['18100']\n```\n\n각 host에 몇 개의 master 를 생성할지 입력합니다. \n\n만약 4개 host를 선택했고 1를 입력한다면 총 4개의 master가 생성됩니다. \n\nport 입력은 쉼표(,)를 구분자로 사용하며 범위를 입력하고 싶은 경우 하이픈(-)을 사용하세요. \n\nex) `18100-18101`\n\nport는 cluster id와 master의 개수를 기반으로 추천해줍니다.\n\n\n\u003c/br\u003e\n\n### slave 정보 입력\n\n```\nHow many replicas would you like to create on each master? [2]\n2\nOK, 2\nPlease type ports separate with comma(,) and use hyphen(-) for range. [18150-18151]\n18150-18151\nOK, ['18150-18151']\n```\n\n각 master 마다 몇 개의 slave를 생성할 지 입력합니다. \n\n만약 4개의 마스터를 생성하고 2를 입력한다면 총 8개의 slave가 생성됩니다. \n\nslave를 사용하지 않으려면 0을 입력하세요. \n\nport 입력은 쉼표(,)를 구분자로 사용하며 범위를 입력하고 싶은 경우 하이픈(-)을 사용하세요. \n\nex) `18150-18151`\n\nport는 cluster id와 slave의 개수를 기반으로 추천해줍니다.\n\n\n\u003c/br\u003e\n\n### 그 외 정보 입력\n\n```\nHow many ssd would you like to use? [3]\n3\nOK, 3\nType prefix of db path [/sata_ssd/ssd_]\n/sata_ssd/ssd_\nOK, /sata_ssd/ssd_\n```\n\n\n\u003c/br\u003e\n\n### 정보확인\n\n```\n+-------------------+---------------------------------------------+\n| NAME              | VALUE                                       |\n+-------------------+---------------------------------------------+\n| installer         | tsr2-installer.bin.lightningdb_v1.1.10.centos |\n| nodes             | nodeA                                       |\n|                   | nodeB                                       |\n|                   | nodeC                                       |\n|                   | nodeD                                       |\n| master ports      | 18100                                       |\n| slave ports       | 18150-18151                                 |\n| ssd count         | 3                                           |\n| prefix_of_db_path | ~/sata_ssd/ssd_                             |\n+-------------------+---------------------------------------------+\nDo you want to proceed with the deploy accroding to the above information? (y/n)\ny\n```\n\n모든 정보입력이 완료되면 위와 같이 입력한 정보들을 확인합니다.\n\n\u003c/br\u003e\n\n### Deploy 진행\n\n```\nCheck status of hosts...\n+-----------+--------+\n| HOST      | STATUS |\n+-----------+--------+\n| nodeA     | OK     |\n| nodeB     | OK     |\n| nodeC     | OK     |\n| nodeD     | OK     |\n+-----------+--------+\nOK\nChecking for cluster exist...\n+-----------+--------+\n| HOST      | STATUS |\n+-----------+--------+\n| nodeA     | CLEAN  |\n| nodeB     | CLEAN  |\n| nodeC     | CLEAN  |\n| nodeD     | CLEAN  |\n+-----------+--------+\nOK\nTransfer install and execute...\n - nodeA\n - nodeB\n - nodeC\n - nodeD\nSync conf...\nComplete to deploy cluster 1\nCluster 1 selected.\n```\n\ndeploy가 성공적으로 진행되면 위와 같은 메세지들과 함께 완료된 후 클러스터에 접속이 됩니다.\n\n\u003c/br\u003e\n\n### Deploy 진행 중 오류 발생시\n\n#### Host connection error\n\n```\nCheck status of hosts...\n+-------+------------------+\n| HOST  | STATUS           |\n+-------+------------------+\n| nodeA | OK               |\n| nodeB | SSH ERROR        |\n| nodeC | UNKNOWN HOST     |\n| nodeD | CONNECTION ERROR |\n+-------+------------------+\nThere are unavailable host.\n```\n\n`SSH ERROR`: ssh 접속 오류입니다. key 교환 혹은 ssh client/server 상태를 점검하세요\n\n`UNKNOWN HOST`: hostname을 통해 ip주소를 가져올 수 없는 경우입니다.\n\n`CONNECTION ERROR`: host의 상태 혹은 outbound/inbound 등을 확인하세요.\n\n\u003c/br\u003e\n\n#### Cluster already exist\n\n```\nChecking for cluster exist...\n+-------+---------------+\n| HOST  | STATUS        |\n+-------+---------------+\n| nodeA | CLEAN         |\n| nodeB | CLEAN         |\n| nodeC | CLUSTER EXIST |\n| nodeD | CLUSTER EXIST |\n+-------+---------------+\nCluster information exist on some hosts.\n```\n\n`CLUSTER EXIST`: 해당 host에 이미 deploy가 진행된 이력이 있는 경우입니다.\n\ndeploy가 진행 중 중단되는 경우에는 `CLUSTER EXIST` 가 뜨지 않습니다.\n\nre-deploy의 경우 새로 추가되는 host만 검사합니다.\n\n\n\u003c/br\u003e\n\n### Not include localhost\n\n```\n  Check status of hosts...\n  +-------+------------------+\n  | HOST  | STATUS           |\n  +-------+------------------+\n  | nodeB | OK               |\n  | nodeC | OK               |\n  | nodeD | OK               |\n  +-------+------------------+\n  Must include localhost.\n```\n\ndeploy 에서 host 정보에 localhost를 포함하지 않는 경우 에러가 발생합니다. \n\n`localhost` 혹은 `127.0.0.1` 외에 ip주소나 hostname으로 입력해도 무방합니다.\n\n\u003c/br\u003e\n\u003c/br\u003e\n\n## 클러스터 생성\n\ndeploy가 완료되었다면 클러스터 생성을 진행할 수 있습니다.\n\n\u003c/br\u003e\n\n### redis conf 생성\n\n```\n\u003e cluster configure\n```\n\n`redis-\u003cmaster/slave\u003e.conf.template` 와 `redis.properties` 를 이용해 `redis-\u003cport\u003e.conf` 파일들을 생성합니다.  \n\n\u003c/br\u003e\n\n### redis 실행\n\n클러스터를 구성할 redis들을 실행합니다.\n\n```\n\u003e cluster start\nCheck status of hosts ...\nOK\nCheck cluster exist...\n\n...\n\nOK\nBackup redis master log in each MASTER hosts...\n\n...\n\nStarting master nodes : nodeA : 18100 ...\n\n...\n\nStarting slave nodes : nodeA : 18150|18151 ...\n\n...\n\nWait until all redis process up...\ncur: 0 / total: 12\n\n...\n\ncur: 12 / total: 12\nComplete all redis process up.\n```\n\n\u003c/br\u003e\n\n### 클러스터 구성하기\n\n `cluster create` 명령어를 통해 클러스터를 구성합니다.\n\ncreate를 시작하기 전에 구성정보를 확인하는 절차를 거칩니다.\n\n```\n\u003e cluster create\n\u003e\u003e\u003e Creating cluster\n+-------+-------+--------+\n| HOST  | PORT  | TYPE   |\n+-------+-------+--------+\n| nodeA | 18100 | MASTER |\n| nodeB | 18100 | MASTER |\n|   .       .       .    |\n|   .       .       .    |\n|   .       .       .    |\n| nodeD | 18150 | SLAVE  |\n| nodeD | 18151 | SLAVE  |\n+-------+-------+--------+\nDo you want to proceed with the create according to the above information? (y/n)\ny\nreplicas: 2.00\nreplicate [M] nodeA 18100 - [S] nodeA 18150\nreplicate [M] nodeD 18100 - [S] nodeD 18151\n1 / 8 meet complete.\n2 / 8 meet complete.\n\n...\n\n8 / 8 meet complete.\ncreate cluster complete.\n```\n\n\u003c/br\u003e\n\n### 정보 확인\n\n다음 명령어들을 통해 클러스터 상태 및 정보를 확인할 수 있습니다.\n\n* `cli ping --all`\n\n* `cli cluster info`\n\n* `cli cluster nodes `\n\n\n\u003c/br\u003e\n\n### 클러스터 구성 중 오류 발생 시\n\n#### ClusterError\n\n```\n\u003e cluster create\n\u003e\u003e\u003e Creating cluster\n+-------+-------+--------+\n| HOST  | PORT  | TYPE   |\n+-------+-------+--------+\n| nodeA | 18100 | MASTER |\n| nodeB | 18100 | MASTER |\n|   .       .       .    |\n|   .       .       .    |\n|   .       .       .    |\n| nodeD | 18150 | SLAVE  |\n| nodeD | 18151 | SLAVE  |\n+-------+-------+--------+\nDo you want to proceed with the create according to the above information? (y/n)\ny\nNode nodeA:18100 is already in a cluster\n```\n\n해당 redis가 이미 클러스터로 구성되어 있는 경우입니다. \n\n해당 redis를 포함하는 클러스터에서 `cluster clean --all` 명령어를 통해 클러스터를 해제를 먼저 해야합니다.\n\n해당 redis들을 클러스터에서 강제로 해제시킨 후 구성하려면 `cluster restart --reset` 을 사용하세요.\n\n\n\u003c/br\u003e\n\n#### Connection Error\n\n```\nroot@lightningdb:32\u003e cluster create\n\u003e\u003e\u003e Creating cluster\n+-------+-------+--------+\n| HOST  | PORT  | TYPE   |\n+-------+-------+--------+\n| nodeA | 18100 | MASTER |\n| nodeB | 18100 | MASTER |\n|   .       .       .    |\n|   .       .       .    |\n|   .       .       .    |\n| nodeD | 18150 | SLAVE  |\n| nodeD | 18151 | SLAVE  |\n+-------+-------+--------+\nDo you want to proceed with the create according to the above information? (y/n)\ny\nnodeD:18100 - [Errno 111] Connection refused\n```\n\n해당 redis가 실행중이 아닌 경우 발생합니다. `cluster start` 명령어를 통해 먼저 redis를 실행시켜야 합니다.\n\n\u003c/br\u003e\n\u003c/br\u003e\n\n## lightningdb Version Update\n\nlightningdb version의 변경은 `deploy` 명령어를 통해 진행할 수 있습니다.\n\n\u003c/br\u003e\n\n### Deploy\n\n```\n\u003e c 1 // alias of 'cluster use 1'\n\u003e deploy\n(Watch out) Cluster 1 is already deployed. Do you want to deploy again? (y/n) [n]\ny\n```\n\n\u003e 클러스터에 접속하지 않고 클러스터 번호를 같이 입력해도 됩니다.\n\u003e\n\u003e ```\n\u003e \u003e deploy 1\n\u003e ```\n\n\u003c/br\u003e\n\n#### Installer\n\n```\nSelect installer\n\n    [ INSTALLER LIST ]\n    (1) tsr2-installer.bin.lightningdb_v1.1.10.centos\n    (2) tsr2-installer.bin.lightningdb_v1.1.09.centos\n    (3) tsr2-installer.bin.lightningdb_v1.1.08.centos\n\nPlease enter the number, file path or url of the installer you want to use.\nyou can also add file in list by copy to '$FBPATH/releases/'\n```\n\ninstaller를 선택하거나 파일경로 혹은 url을 입력하세요.\n\n\u003c/br\u003e\n\n### Restore\n\n```\nDo you want to restore conf? (y/n)\ny\n```\n\n현재 설정값을 그대로 사용할 것인지 물어봅니다. `y` 를 선택해주세요.\n\n\u003c/br\u003e\n\n### 정보확인 및 진행\n\n정보확인 후 클러스터와 conf의 백업과 함께 update가 진행됩니다.\n\n```\n+-----------------+---------------------------------------------+\n| NAME            | VALUE                                       |\n+-----------------+---------------------------------------------+\n| installer       | tsr2-installer.bin.lightningdb_v1.1.10.centos |\n| nodes           | nodeA                                       |\n|                 | nodeB                                       |\n|                 | nodeC                                       |\n|                 | nodeD                                       |\n| master ports    | 18100                                       |\n| slave ports     | 18150-18151                                 |\n| ssd count       | 3                                           |\n| redis data path | /sata_ssd/ssd_                              |\n| redis db path   | /sata_ssd/ssd_                              |\n| flash db path   | /sata_ssd/ssd_                              |\n+-----------------+---------------------------------------------+\nDo you want to proceed with the deploy accroding to the above information? (y/n)\ny\nCheck status of hosts...\n+-----------+--------+\n| HOST      | STATUS |\n+-----------+--------+\n| nodeA     | OK     |\n| nodeB     | OK     |\n| nodeC     | OK     |\n| nodeD     | OK     |\n+-----------+--------+\nChecking for cluster exist...\n+------+--------+\n| HOST | STATUS |\n+------+--------+\nBackup conf of cluster 1...\nOK, cluster_1_conf_bak_\u003ctime-stamp\u003e\nBackup info of cluster 1 at nodeA...\nOK, cluster_1_bak_\u003ctime-stamp\u003e\nBackup info of cluster 1 at nodeB...\nOK, cluster_1_bak_\u003ctime-stamp\u003e\nBackup info of cluster 1 at nodeC...\nOK, cluster_1_bak_\u003ctime-stamp\u003e\nBackup info of cluster 1 at nodeD...\nOK, cluster_1_bak_\u003ctime-stamp\u003e\nTransfer installer and execute...\n - nodeA\n - nodeB\n - nodeC\n - nodeD\nSync conf...\nComplete to deploy cluster 1.\nCluster 1 selected.\n```\n\n클러스터 백업 경로: `\u003cbase-directory\u003e/backup/cluster_\u003ccluster-id\u003e_bak_\u003ctime-stamp\u003e`\n\nconf 백업 경로: `$FBAPTH/conf_backup/cluster_\u003ccluster-id\u003e_conf_bak_\u003ctime-stamp\u003e`\n\n\n\u003c/br\u003e\n\n### restart\n\n```\n\u003e cluster restart\n```\n\n`cluster restart` 를 통해 재시작을 해주면 완료됩니다.\n\n\n\u003c/br\u003e\n\u003c/br\u003e\n\n## Re-Deploy\n\ndeploy가 완료된 클러스터에서 `deploy` 명령어를 통해 다시 진행할 수 있습니다.\n\n\n\u003c/br\u003e\n\n### Stop\n\nhost, port 등 정보가 변경된다면 deploy 이전에 반드시 중지 및 정보 리셋이 필요합니다.\n\n```\n\u003e cluster stop\n\u003e cluster clean --all\n```\n\n\u003c/br\u003e\n\n### Deploy\n\n```\n\u003e c 1 // alias of 'cluster use 1'\n\u003e deploy\n(Watch out) Cluster 1 is already deployed. Do you want to deploy again? (y/n) [n]\ny\n```\n\n\u003e 클러스터에 접속하지 않고 argument로 클러스터 번호를 주어도 됩니다.\n\u003e\n\u003e ```\n\u003e \u003e deploy 1\n\u003e ```\n\n\n\u003c/br\u003e\n\n### Installer\n\n```\nSelect installer\n\n    [ INSTALLER LIST ]\n    (1) tsr2-installer.bin.lightningdb_v1.1.10.centos\n    (2) tsr2-installer.bin.lightningdb_v1.1.09.centos\n    (3) tsr2-installer.bin.lightningdb_v1.1.08.centos\n\nPlease enter the number, file path or url of the installer you want to use.\nyou can also add file in list by copy to '$FBPATH/releases/'\n```\n\n다시 설치할 lightningdb의 installer를 선택해주세요.\n\n변경하지 않는 경우 기존에 사용했던 installer를 선택하시면 됩니다.\n\n\n\u003c/br\u003e\n\n### Restore\n\n```\nDo you want to restore conf? (y/n)\nn\n```\n\n현재 설정값을 그대로 사용할 것인지 물어봅니다. 정보변경을 위해 `n` 을 선택합니다.\n\n\n\u003c/br\u003e\n\n### Setup Info\n\n```\n#!/bin/bash\n\n## Master hosts and ports\nexport SR2_REDIS_MASTER_HOSTS=( \"nodeA\" \"nodeB\" \"nodeC\" \"nodeD\" )\nexport SR2_REDIS_MASTER_PORTS=( 18100 )\n\n## Slave hosts and ports (optional)\nexport SR2_REDIS_SLAVE_HOSTS=( \"nodeA\" \"nodeB\" \"nodeC\" \"nodeD\" )\nexport SR2_REDIS_SLAVE_PORTS=( $(seq 18150 18151) )\n\n## only single data directory in redis db and flash db\n## Must exist below variables; 'SR2_REDIS_DATA', 'SR2_REDIS_DB_PATH' and 'SR2_FLASH_DB_PATH'\n#export SR2_REDIS_DATA=\"/nvdrive0/nvkvs/redis\"\n#export SR2_REDIS_DB_PATH=\"/nvdrive0/nvkvs/redis\"\n#export SR2_FLASH_DB_PATH=\"/nvdrive0/nvkvs/flash\"\n\n## multiple data directory in redis db and flash db\nexport SSD_COUNT=3\n#export HDD_COUNT=3\nexport SR2_REDIS_DATA=\"~/sata_ssd/ssd_\"\nexport SR2_REDIS_DB_PATH=\"~/sata_ssd/ssd_\"\nexport SR2_FLASH_DB_PATH=\"~/sata_ssd/ssd_\"\n\n#######################################################\n# Example : only SSD data directory\n#export SSD_COUNT=3\n#export SR2_REDIS_DATA=\"/ssd_\"\n#export SR2_REDIS_DB_PATH=\"/ssd_\"\n#export SR2_FLASH_DB_PATH=\"/ssd_\"\n#######################################################\n```\n\n위와 같이 기존의 `redis.properties` 파일이 열립니다. 수정하고자 하는 부분을 수정해주세요.\n\n수정 중 정보오류 등으로 deploy가 중단된 경우 수정이력이 저장되며 아래와 같이 불러올 수 있습니다.\n\n```\nDo you want to restore conf? (y/n)\nn\nThere is a history of modification. Do you want to load? (y/n)\ny\n```\n\n\n\u003c/br\u003e\n\n### 정보확인 및 진행\n\n정보확인 후 클러스터와 conf의 백업과 함께 update가 진행됩니다.\n\n```\n+-----------------+---------------------------------------------+\n| NAME            | VALUE                                       |\n+-----------------+---------------------------------------------+\n| installer       | tsr2-installer.bin.lightningdb_v1.1.10.centos |\n| nodes           | nodeA                                       |\n|                 | nodeB                                       |\n|                 | nodeC                                       |\n|                 | nodeD                                       |\n| master ports    | 18100                                       |\n| slave ports     | 18150-18151                                 |\n| ssd count       | 3                                           |\n| redis data path | /sata_ssd/ssd_                              |\n| redis db path   | /sata_ssd/ssd_                              |\n| flash db path   | /sata_ssd/ssd_                              |\n+-----------------+---------------------------------------------+\nDo you want to proceed with the deploy accroding to the above information? (y/n)\ny\nCheck status of nodes...\n+-----------+--------+\n| HOST      | STATUS |\n+-----------+--------+\n| nodeA     | OK     |\n| nodeB     | OK     |\n| nodeC     | OK     |\n| nodeD     | OK     |\n+-----------+--------+\nBackup conf of cluster 1...\nOK, cluster_1_conf_bak_\u003ctime-stamp\u003e\nBackup info of cluster 1 at nodeA...\nOK, cluster_1_bak_\u003ctime-stamp\u003e\nBackup info of cluster 1 at nodeB...\nOK, cluster_1_bak_\u003ctime-stamp\u003e\nBackup info of cluster 1 at nodeC...\nOK, cluster_1_bak_\u003ctime-stamp\u003e\nBackup info of cluster 1 at nodeD...\nOK, cluster_1_bak_\u003ctime-stamp\u003e\nTransfer installer and execute...\nComplete to deploy cluster 1.\nCluster 1 selected.\n```\n\n클러스터 백업 경로: `\u003cbase-directory\u003e/backup/cluster_\u003ccluster-id\u003e_bak_\u003ctime-stamp\u003e`\n\nconf 백업 경로: `$FBAPTH/conf_backup/cluster_\u003ccluster-id\u003e_conf_bak_\u003ctime-stamp\u003e`\n\n\n\n\u003c/br\u003e\n\u003c/br\u003e\n\n## Add Slave\n\nYou can add a slave to a cluster that is configured only with master without redundancy.\n\n### create cluster only with master\n\n(Procedure for configuring the test environment. If cluster with only master already exists, go to the [add slave info](#add-slave-info).)\n\nProceed with the deploy.\n\n```\n\u003e deploy 3\n```\n\nEnter 0 in replicas as shown below when deploy.\n\n```\nSelect installer\n\n    [ INSTALLER LIST ]\n    (1) tsr2-installer.bin.lightningdb_v1.1.10.centos\n\nPlease enter the number, file path or url of the installer you want to use.\nyou can also add file in list by copy to '$FBPATH/releases/'\n1\nOK, tsr2-installer.bin.lightningdb_v1.1.10.centos\nPlease type host list separated by comma(,) [127.0.0.1]\n127.0.0.1\nOK, ['127.0.0.1']\nHow many masters would you like to create on each host? [1]\n1\nOK, 1\nPlease type ports separate with comma(,) and use hyphen(-) for range. [18300]\n18300\nOK, ['18300']\n\n*-----------------------------------------------------------------*\n| How many replicas would you like to create on each master? [2]  |\n| 0                                                               |\n| OK, 0                                                           |\n*-----------------------------------------------------------------*\n ↳ (a border just for emphasis)\n\nHow many ssd would you like to use? [3]\n3\nOK, 3\nType prefix of db path [/sata_ssd/ssd_]\n/sata_ssd/ssd_\nOK, /sata_ssd/ssd_\n+-------------------+---------------------------------------------+\n| NAME              | VALUE                                       |\n+-------------------+---------------------------------------------+\n| installer         | tsr2-installer.bin.lightningdb_v1.1.10.centos |\n| hosts             | 127.0.0.1                                   |\n| master ports      | 18300                                       |\n| ssd count         | 3                                           |\n| prefix_of_db_path | /sata_ssd/ssd_                              |\n+-------------------+---------------------------------------------+\nDo you want to proceed with the deploy accroding to the above information? (y/n)\ny\n```\n\nWhen the deploy is complete, start and create the cluster.\n\n```\n\u003e cluster start\n...\n\u003e cluster create\n...\n```\n\n\u003cbr/\u003e\n\n\n### add slave info\n\n```\n\u003e conf cluster\n```\n\nYou can modify `redis.properties` by entering the command as shown above.\n\n```sh\n  1 #!/bin/bash\n  2\n  3 ## Master hosts and ports\n  4 export SR2_REDIS_MASTER_HOSTS=( \"127.0.0.1\" )\n  5 export SR2_REDIS_MASTER_PORTS=( 18300 )\n  6\n  7 ## Slave hosts and ports (optional)\n  8 #export SR2_REDIS_SLAVE_HOSTS=( \"127.0.0.1\" )\n  9 #export SR2_REDIS_SLAVE_PORTS=( $(seq 18600 18609) )\n 10\n 11 ## only single data directory in redis db and flash db\n 12 ## Must exist below variables; 'SR2_REDIS_DATA', 'SR2_REDIS_DB_PATH' and 'SR2_FLASH_DB_PATH'\n 13 #export SR2_REDIS_DATA=\"/nvdrive0/nvkvs/redis\"\n 14 #export SR2_REDIS_DB_PATH=\"/nvdrive0/nvkvs/redis\"\n 15 #export SR2_FLASH_DB_PATH=\"/nvdrive0/nvkvs/flash\"\n 16\n 17 ## multiple data directory in redis db and flash db\n 18 export SSD_COUNT=3\n 19 #export HDD_COUNT=3\n 20 export SR2_REDIS_DATA=\"/sata_ssd/ssd_\"\n 21 export SR2_REDIS_DB_PATH=\"/sata_ssd/ssd_\"\n 22 export SR2_FLASH_DB_PATH=\"/sata_ssd/ssd_\"\n 23\n 24 #######################################################\n 25 # Example : only SSD data directory.\n 26 #export SSD_COUNT=3\n 27 #export SR2_REDIS_DATA=\"/ssd_\"\n 28 #export SR2_REDIS_DB_PATH=\"/ssd_\"\n 29 #export SR2_FLASH_DB_PATH=\"/ssd_\"\n 30 #######################################################\n```\n\nModify `SR2_REDIS_SLAVE_HOSTS` and `SR2_REDIS_SLAVE_PORTS` as shown below.\n\n\n```sh\n  1 #!/bin/bash\n  2\n  3 ## Master hosts and ports\n  4 export SR2_REDIS_MASTER_HOSTS=( \"127.0.0.1\" )\n  5 export SR2_REDIS_MASTER_PORTS=( 18300 )\n  6\n  7 ## Slave hosts and ports (optional)\n  8 export SR2_REDIS_SLAVE_HOSTS=( \"127.0.0.1\" )\n  9 export SR2_REDIS_SLAVE_PORTS=( $(seq 18350 18351) )\n 10\n 11 ## only single data directory in redis db and flash db\n 12 ## Must exist below variables; 'SR2_REDIS_DATA', 'SR2_REDIS_DB_PATH' and 'SR2_FLASH_DB_PATH'\n 13 #export SR2_REDIS_DATA=\"/nvdrive0/nvkvs/redis\"\n 14 #export SR2_REDIS_DB_PATH=\"/nvdrive0/nvkvs/redis\"\n 15 #export SR2_FLASH_DB_PATH=\"/nvdrive0/nvkvs/flash\"\n 16\n 17 ## multiple data directory in redis db and flash db\n 18 export SSD_COUNT=3\n 19 #export HDD_COUNT=3\n 20 export SR2_REDIS_DATA=\"/sata_ssd/ssd_\"\n 21 export SR2_REDIS_DB_PATH=\"/sata_ssd/ssd_\"\n 22 export SR2_FLASH_DB_PATH=\"/sata_ssd/ssd_\"\n 23\n 24 #######################################################\n 25 # Example : only SSD data directory.\n 26 #export SSD_COUNT=3\n 27 #export SR2_REDIS_DATA=\"/ssd_\"\n 28 #export SR2_REDIS_DB_PATH=\"/ssd_\"\n 29 #export SR2_FLASH_DB_PATH=\"/ssd_\"\n 30 #######################################################\n ```\n\n\u003cbr/\u003e\n\n### execute command add-slave\n\n```\n\u003e cluster add-slave\nCheck status of hosts...\nOK\nsync conf\nComplete edit\nroot@lightningdb:3\u003e cluster add-slave\nCheck status of hosts...\nOK\nCheck cluster exist...\n - 127.0.0.1\nOK\nRemoving redis generated slave configuration files\n - 127.0.0.1\nRemoving flash db directory, appendonly and dump.rdb files in master\nRemoving flash db directory, appendonly and dump.rdb files in slave\n - 127.0.0.1\nRemoving master node configuration\nRemoving slave node configuration\n - 127.0.0.1\nBackup redis slave log in each SLAVE hosts...\n - 127.0.0.1\nGenerate redis configuration files for slave hosts\nsync conf\n+-----------+--------+\n| HOST      | STATUS |\n+-----------+--------+\n| 127.0.0.1 | OK     |\n+-----------+--------+\nStarting slave nodes : 127.0.0.1 : 18350|18351 ...\nWait until all redis process up...\ncur: 3 / total: 3\nComplete all redis process up\nreplicate [M] 127.0.0.1 18300 - [S] 127.0.0.1 18350\nreplicate [M] 127.0.0.1 18300 - [S] 127.0.0.1 18351\n1 / 2 meet complete.\n2 / 2 meet complete.\n```\n\n\u003cbr/\u003e\n\n### check configuration information\n\n```\n\u003e cli cluster nodes\nfc7d8c... 127.0.0.1:18300 myself,master - 0 1573628546000 0 connected 0-16383\nf9dbb3... 127.0.0.1:18351 slave fc7d8c... 0 1573628547266 1 connected\n60c723... 127.0.0.1:18350 slave fc7d8c... 0 1573628548269 1 connected\n```\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n## Thrift Server\n\n\n* start\n* monitor\n* beeline\n* stop\n* restart\n\n\n`ths` is alias of `thriftserver`\n\nYou can modify information of thrift server by command `conf thriftserver (= conf ths)`\nthrift server 관련 정보수정은 `conf thriftserver (= conf ths)` 를 이용하세요.\n\n\u003cbr/\u003e\n\n### start\n\nRun the thrift server.\n\n```\n\u003e ths start  # alias of thriftserver start\nstarting org.apache.spark.sql.hive.thriftserver.HiveThriftServer2, logging to \u003clogfile-name\u003e\n```\n\nYou can view the logs through the command [monitor](#monitor).\n\n\u003cbr/\u003e\n\n### monitor\n\nYou can view the logs of the thrift server in real time.\n\n```\n\u003e ths monitor  # alias of thriftserver monitor\nPress Ctrl-C for exit.\n(show log)\n```\n\n\u003cbr/\u003e\n\n### beeline\n\nConnect to the thrift server\n\nFor more information, see the [link](https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-Beeline%E2%80%93CommandLineShell).\n\n```\n\u003e ths beeline  # alias of thriftserver beeline\nConnecting...\nConnecting to jdbc:hive2://localhost:13000\n\u003ctimestamp\u003e INFO jdbc.Utils: Supplied authorities: localhost:13000\n\u003ctimestamp\u003e INFO jdbc.Utils: Resolved authority: localhost:13000\n\u003ctimestamp\u003e INFO jdbc.HiveConnection: Will try to open client transport with JDBC Uri: jdbc:hive2://localhost:13000\nConnected to: Spark SQL (version 2.1.1)\nDriver: Hive JDBC (version 1.2.1.spark2)\nTransaction isolation: TRANSACTION_REPEATABLE_READ\nBeeline version 1.2.1.spark2 by Apache Hive\n0: jdbc:hive2://localhost:13000\u003e\n```\n\nDefault value of db url to connect is `jdbc:hive2://$HIVE_HOST:$HIVE_PORT`\n\nYou can modify `$HIVE_HOST` and `$HIVE_PORT` by command `conf ths`\n\n\u003cbr/\u003e\n\n### stop\n\nShut down the thrift server.\n\n```\n\u003e ths stop  # alias of thriftserver stop\nstopping org.apache.spark.sql.hive.thriftserver.HiveThriftServer2\n```\n\n\u003cbr/\u003e\n\n### restart\n\nRestart the thrift server.\n\n```\n\u003e ths restart  # alias of thriftserver restart\nstopping org.apache.spark.sql.hive.thriftserver.HiveThriftServer2\nstarting org.apache.spark.sql.hive.thriftserver.HiveThriftServer2, logging to \u003clogfile-name\u003e\n```\n\n\n\u003c/br\u003e\n\u003c/br\u003e\n\n## Logging in file\n\n`$FBPATH/logs/fb-roate.log` 에 debug 수준의 로그가 저장됩니다.\n\n최대 1GiB 만큼 저장하며 초과하는 경우 최신순으로 rolling update가 진행됩니다.\n\nLTCLI의 로그만 저장됩니다. 클러스터, thriftserver 등의 로그는 별도의 명령어를 사용하세요.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnms%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnms%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnms%2Fcli/lists"}