nc 명령어를 이용하는 방법으로 설치가 되어 있어야 한다.

사용방법은 :

nc -v <접속할서버명> <접속할포트>

 

[root@kafka001 bin]# nc -v zk001 2181
nc: connect to zk001 port 2181 (tcp) failed: No route to host

 

만약 실패한 만약에 실패한다면 iptables가 동작하고 있는지 확인후 실행 해 본다.

 

[root@kafka001 bin]# nc -v zk001 2181 
Connection to zk001 2181 port [tcp/eforward] succeeded!

 

 

'linux' 카테고리의 다른 글

리눅스에서 GMAIL SMTP 이용해서 메일 보내기  (0) 2019.06.04
리눅스에서 서비스 등록/해제  (0) 2019.06.04
by pacino.kang 2019. 6. 4. 09:22

[root@zk003 ~]# chkconfig --list iptables
iptables        0:off 1:off 2:off 3:off 4:off 5:off 6:off


[root@zk003 ~]# chkconfig iptables off
[root@zk003 ~]# chkconfig --list iptables
iptables        0:off 1:off 2:off 3:off 4:off 5:off 6:off

런레벨 3~5만 on이면 된다.

by pacino.kang 2019. 6. 4. 09:12


/*select count(*) from employees*/
>db.employees.aggregate([{$group:{_id:null, count:{$sum:1}}}])

/*select sum(sal) from employees*/
>db.employees.aggregate([{$group:{_id:"$deptno",total:{$sum:"$sal"}}}])

/*select deptno,sum(sal) from employees where sal=3000 group by deptno*/
>db.employees.aggregate([{$match:{sal:3000}}, {$group:{_id:"deptno", total:{$sum:"$sal"}}}])

/*deptno가 10인 데이터를 조회*/
>db.employees.find({deptno:{$all:[10]}},{_id:0, empno:1,ename:1,sal:1})

/*deptno가 10이고 deptno가 30인 데이터를 조회*/
>db.employees.find({deptno:{$all:[10,30]}},{_id:0, empno:1,ename:1,sal:1})

>db.employees.find({$and:[{deptno:10},{deptno:30}]},{_id:0, empno:1,ename:1,sal:1})

/*deptno가 10이거나 deptno가 30인 데이터를 조회*/
>db.employees.find({deptno:{$in:[10,30]}},{_id:0, empno:1,ename:1,sal:1})

>db.employees.find({$or:[{deptno:30},{deptno:10}]},{_id:0, empno:1,ename:1,sal:1})

/*comm field가 존재하는 데이터만 조회하라*/
db.employees.find({comm:{$exists:true}},{_id:0,empno:1,ename:1})

'mongoDB' 카테고리의 다른 글

mongoDB select문  (0) 2013.03.11
mongoDB 명령어  (1) 2013.03.08
by pacino.kang 2013. 3. 13. 13:31
| 1 2 3 4 5 ··· 8 |