www.cnblogs.com/ruiyqinrui

开源、架构、Linux C/C++/python AI BI 运维开发自动化运维。 春风桃李花 秋雨梧桐叶。“力尽不知热 但惜夏日长”。夏不惜,秋不获。@ruiY--秦瑞

python爬虫,C编程,嵌入式开发.hadoop大数据,桉树,onenebula云计算架构.linux运维及驱动开发.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

./tools/tungsten-installer --master-slave -a --datasource-type=mysql --master-host=master.puppet.org --datasource-user=tungsten --datasource-password=321 --datasource-log-directory=/var/lib/mysql --datasource-port=3306 --service-name=byRuiyHello --home-directory=/root/deploy/mysql --cluster-hosts=master.puppet.org --mysql-use-bytes-for-string=false  --svc-extractor-filters=colnames,pkey --svc-parallelization-type=disk --start-and-report

 

 

 

tungsten-Applications正确Mysql master端执行语句

./tools/tungsten-installer --master-slave -a   --datasource-type=mysql   --master-host=master.puppet.org    --datasource-user=tungsten    --datasource-password=321    --datasource-log-directory=/var/lib/mysql   --datasource-port=3306   --service-name=mongodbs   --home-directory=/opt/mysqls   --cluster-hosts=master.puppet.org   --mysql-use-bytes-for-string=false   --svc-extractor-filters=colnames,pkey   --svc-parallelization-type=disk --start-and-report

tools/tungsten-installer --master-slave -a --service-name=tomongo --cluster-hosts=agent01.puppet.org --master-host=master.puppet.org --datasource-type=mongodb --skip-validation-check=InstallerMasterSlaveCheck --svc-parallelization-type=none --start-and-report --home-directory=/opt/mongodb

直接访问google的ip

http://93.123.23.57/ 
https://github.com/greatfire/wiki 
http://173.194.72.104
http://209.85.228.120/

./tools/tungsten-installer --master-slave -a --service-name=tomongo --cluster-hosts=agent01.puppet.org --master-host=master.puppet.org --skip-validation-check=InstallerMasterSlaveCheck --datasource-type=mongodb  --start-and-report --home-directory=/opt/heis
WARN  >> agent01.puppet.org >> Currently unable to check for the THL schema in mongodb

 

 

基于tungsten-Replicator 的tpm

./tools/tpm install test01 --info --master=master.puppet.org --replication-user=tungsten --replication-password=321 --install-directory=/opt/test01 --thl-port=2201   --rmi-port=2202

上面的是残局,壁垒已被摧毁链接如下(请点击如下文字行超链接,查看article),当前测试基于单机测试成功,跨逻辑资源OS机待测试,tungsten功能很给力,不错;

tungsten同步mysql数据到mongodb(从DBMS->key-value)

锋回笔转,咱简单玩玩mongodb 语句使用,index,优化是重点戏头,别的都是浮云,pass,忽略;

一、修改mongodb主配置文件添加用户认证,只有添加认证的用户才能有管理能力

主配置文件添加如下语句

auth=true

二、创建测试数据库(在MongoDB数据库服务器操作)

在mongodb上执行

cd /usr/local/mongodb/bin/

./mongo  #进入数据库

#创建数据库,在数据库中新建表,插入数据

use ruiy  #创建数据库ruiy 如果什么都不操作离开的话,这个库就会被系统删除

db.createCollection("ruiy_table")  #创建表ruiy_table

show collections  #查看此时库下所有表

db.ruiy_table.insert({uid:1,name:"运维",url:"http://cnblogs.com/ruiy",content:"系统运维site byRuiy"})  #插入数据到表ruiy_table中

db.ruiy_table.find();查看ruiy_table表数据

show dbs 显示所有数据库名

三、创建数据库账号(在MongoDB数据库服务器操作)

===============================================================

1、MongoDB数据库默认没有用户名和密码,只要连接上服务,就能登录,进行所有操作。

2、可以通过配置文件设置,开启登录验证功能。

3、只有切换到admin数据库,添加的账号才是管理员账号。

4、管理员账号可以对MongoDB服务器所有数据库进行管理(但是:默认只能管理自己的admin数据库,要管理其他数据库,需要先在admin数据库中进行认证)

===============================================================

#添加普通账号

cd /usr/local/mongodb/bin/

./mongo  #进入数据库

use ruiy

db.addUser('byRuiy','123456')  #账号:byRuiy 密码:123456 权限:读写

#db.addUser('byRuiy','123456',true)  #账号:byRuiy 密码:123456 权限:只读

db.auth('byRuiyr','123456') #添加用户认证

exit #退出

#添加管理员账号

cd /usr/local/mongodb/bin/

./mongo  #进入数据库

show dbs  #列出所有数据库

use admin  #切换到admin数据库,添加的账号才是管理员账号。

show collections

db.system.users.find()

db.addUser('root','123456')  #添加管理员账号:root 密码:123456

db.auth('root','123456') #添加管理员用户认证,认证之后才能管理所有数据库

exit  #退出

###############################################################

#删除数据库、删除表操作

cd /usr/local/mongodb/bin/

./mongo

use ruiy #进入数据库

db.dropDatabase()  #删除数据库

db.ruiy_table.drop() #删除表

db.removeUser('byRuiy')  #删除用户

build index,库优化,咱休息下,养好精神再战,ruiy不喜欢打疲劳战;

 

posted on 2014-06-17 15:18  秦瑞It行程实录  阅读(521)  评论(0编辑  收藏  举报
www.cnblogs.com/ruiyqinrui